peasee commented on code in PR #12994:
URL: https://github.com/apache/datafusion/pull/12994#discussion_r1807298937
##########
datafusion/sql/tests/cases/plan_to_sql.rs:
##########
@@ -261,6 +261,24 @@ fn roundtrip_statement_with_dialect() -> Result<()> {
unparser_dialect: Box<dyn UnparserDialect>,
}
let tests: Vec<TestStatementWithDialect> = vec![
+ TestStatementWithDialect {
+ sql: "select min(ta.j1_id) as j1_min from j1 ta order by
min(ta.j1_id) limit 10;",
+ expected:
+ // top projection sort gets derived into a subquery
+ // for MySQL, this subquery needs an alias
+ "SELECT `j1_min` FROM (SELECT min(`ta`.`j1_id`) AS `j1_min`,
min(`ta`.`j1_id`) FROM `j1` AS `ta` ORDER BY min(`ta`.`j1_id`) ASC) AS
`derived_sort` LIMIT 10",
Review Comment:
It is valid for MySQL, I just tested it out in my CLI. I've added both as
new cases, thanks!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]