[ https://issues.apache.org/jira/browse/CALCITE-4160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17172777#comment-17172777 ]
Jiatao Tao edited comment on CALCITE-4160 at 8/7/20, 2:41 AM: -------------------------------------------------------------- Hi [~zabetak], [~julianhyde] In ByteDance, we use Calcite as the SQL layer(parser/validate/optimizer) to build a Federated Query System like google F1. So it needs to adapt to the various engines like Spark/Presto/ClickHouse. Take Spark, for example, we need to use RelNode to construct DataFrame, and Spark allows sort in sub-query. Take other engines, we convert RelNode back to SQL, whether they can handle sort in sub-query is by themself, but the SQL should have this info. In fact, Presto/ClickHouse support sort in sub-query too. was (Author: aron.tao): Hi [~zabetak], [~julianhyde] In ByteDance, we use Calcite as the SQL layer(parser/validate/optimizer) to build a Federated Query System like google F1. So it needs to adapt to the various engines like Spark/Presto/ClickHouse. Take Spark, for example, we need to use RelNode to construct DataFrame, and Spark allows sort in sub-query. Take other engines, we convert RelNode back to SQL, whether the can handle sort in sub-query is by themself, but the SQL should have this info. In fact, Presto/ClickHouse support sort in sub-query too. > 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 > > 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)