[ https://issues.apache.org/jira/browse/CALCITE-4160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17173945#comment-17173945 ]
Julian Hyde commented on CALCITE-4160: -------------------------------------- I am against a global config option because it affects all users of the system, and it makes the system more difficult for developers to understand/debug/configure. I don't see a hint as much of an inconvenience to the users. The users are already adding {{ORDER BY}} into their sub-queries, which is non-standard, and in my opinion does not belong in SQL. (BigData systems have a history of adding bringing physical considerations into what is otherwise a logical language. Consider for example [Hive's CLUSTER BY and DISTRIBUTE BY clauses|https://www.tutorialspoint.com/hive/hiveql_select_where.htm]. Those extensions are a mistake.) It seems to me that allowing {{ORDER BY}} in sub-queries but ignoring it unless the hint is present is a good compromise. If you want to achieve this via configuration, add a flag to the particular component's configuration. Probably {{SqlToRelConverter.Config}}, since this is probably where the {{ORDER BY}} gets removed. But not a global config flag. > Add configuration to retain ORDER BY in sub-query > ------------------------------------------------- > > Key: CALCITE-4160 > URL: https://issues.apache.org/jira/browse/CALCITE-4160 > Project: Calcite > Issue Type: Improvement > Components: core > Reporter: Jiatao Tao > Assignee: Jiatao Tao > Priority: Minor > Attachments: image-2020-08-07-10-48-59-599.png, > image-2020-08-07-10-50-22-351.png > > > Pre discussion see in > https://issues.apache.org/jira/browse/CALCITE-2798 > https://issues.apache.org/jira/browse/CALCITE-3664 > IMO, we should at least provide a configuration about this. People use > Calcite most for its optimizer, and this info users may care, How it executed > is by the engine, but users should know this in the plan. > -- This message was sent by Atlassian Jira (v8.3.4#803005)