You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "peasee (via GitHub)" <gi...@apache.org> on 2024/10/18 06:51:31 UTC
[I] MySQL does not support derived tables without aliases [datafusion]
peasee opened a new issue, #12993:
URL: https://github.com/apache/datafusion/issues/12993
### Describe the bug
In some logical plans, `.derive()` creates a new subquery as a derived table like `FROM (SELECT ...)`.
In MySQL, every derived table requires an alias. `.derive()` does not supply an alias to these derived tables, so the queries fail in MySQL.
### To Reproduce
Run a query on MySQL that triggers a logical plan derive, like:
```
select min(ta.j1_id) as j1_min from j1 ta order by min(ta.j1_id) limit 10;
```
Observe the query fail, because the re-written SQL contains a derived table without an alias.
### Expected behavior
The query should succeed without a syntax error.
### Additional context
As seen from the MySQL manual: https://dev.mysql.com/doc/refman/8.4/en/derived-tables.html
> The [AS] tbl_name clause is mandatory because every table in a FROM clause must have a name.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] MySQL does not support derived tables without aliases [datafusion]
Posted by "goldmedal (via GitHub)" <gi...@apache.org>.
goldmedal closed issue #12993: MySQL does not support derived tables without aliases
URL: https://github.com/apache/datafusion/issues/12993
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org