[
https://issues.apache.org/jira/browse/CALCITE-5412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17642116#comment-17642116
]
Julian Hyde commented on CALCITE-5412:
--------------------------------------
[~lchistov1987], Can you please split this into separate bugs? As it stands, it
says 'bugs exist' and therefore we can never mark it fixed. Maybe change the
summary of this case to "JDBC adapter incorrectly generates CUBE for MySQL 5",
and log another case for 'Result RelToSqlConverter::visit(Sort e)'.
The check for "GROUP BY GROUPING SETS" is not actionable. If there is a
particular dialect/version then we can potentially fix. But we chose to assume
that a dialect supports GROUPING SETS and we override for specific dialects
that do not.
For links, please write CALCITE-5411 rather than the full URL, and also add a
Jira link.
> ROLLUP/CUBE non-standard syntax support logic is buggy
> ------------------------------------------------------
>
> Key: CALCITE-5412
> URL: https://issues.apache.org/jira/browse/CALCITE-5412
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.32.0
> Reporter: Leonid Chistov
> Priority: Minor
>
> There are currently several dialects supported by Calcite which share a logic
> of using 'GROUP BY ... WITH ROLLUP' or 'GROUP BY ... WITH CUBE' syntax
> instead of 'GROUP BY ROLLUP(...)' and 'GROUP BY CUBE(...)' syntax: MySQL5,
> MsSQL, Hive and Spark.
> Note: actually Spark should not be on this list anymore, see
> https://issues.apache.org/jira/browse/CALCITE-5411
> Following issues exist regarding current implementation of this logic:
> * There is a bug in 'Result RelToSqlConverter::visit(Sort e)' method. Check
> 'hasTrickyRollup' does not take into account possibility of different order
> of fields in 'ROLLUP' clause and 'ORDER BY' clause. Because of this, we loose
> information about order of fields in 'ORDER BY' clause in the conversion
> under this check.
> * CUBE clause seems to be not supported in MYSQL5.x in any form
> ([https://dev.mysql.com/doc/refman/5.7/en/group-by-modifiers.html]), but we
> don’t check it.
> * We don't have an check for the “GROUP BY GROUPING SETS(...)” syntax
> support, thus we always generate SQL code for such clause, as if it was
> supported
--
This message was sent by Atlassian Jira
(v8.20.10#820010)