You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2023/06/28 19:27:00 UTC
[jira] [Commented] (CALCITE-4987) JDBC adapter generates incorrect query when ORDER BY alias collides with field in SELECT ITEM
[ https://issues.apache.org/jira/browse/CALCITE-4987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17738261#comment-17738261 ]
Julian Hyde commented on CALCITE-4987:
--------------------------------------
[~yanjing.wang], I have removed 'fixVersion = 1.35.0' because the PR has conflicts. If you rebase the PR and remove the conflicts I will try to get it into the upcoming release.
> JDBC adapter generates incorrect query when ORDER BY alias collides with field in SELECT ITEM
> ---------------------------------------------------------------------------------------------
>
> Key: CALCITE-4987
> URL: https://issues.apache.org/jira/browse/CALCITE-4987
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.29.0
> Environment: jdk8
> Reporter: yanjing.wang
> Assignee: yanjing.wang
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> I reproduce with the following query.
>
> {code:java}
> SELECT sum(shelf_width) as shelf_width FROM product ORDER BY shelf_width{code}
> you must have noticed that the shelf_width alias is same with field 'shelf_width' in sum.
> I expected the query hasn't changed when I test in RelToSqlConverterTest. But I get unexpected query is
> {code:java}
> SELECT sum(shelf_width) as shelf_width FROM product ORDER BY sum(shelf_width) {code}
> the unexpected query is not valid in the dialect which support order by alias conformance.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)