[
https://issues.apache.org/jira/browse/KYLIN-6085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18031049#comment-18031049
]
Longfei Jiang commented on KYLIN-6085:
--------------------------------------
*Root Cause*
Due to a Calcite version upgrade, a feature was introduced that removes ORDER
BY clauses inside subqueries.
This feature is enabled by default, causing the subquery ORDER BY to be ignored
during RelNode parsing.
*Dev Design*
A new system-level configuration is introduced:
~kylin.query.calcite.remove-sort-in-subquery~
The default value is false, which means Kylin will keep the ORDER BY clause in
subqueries instead of removing it.
> Fix issue where ORDER BY in SQL subqueries does not take effect
> ---------------------------------------------------------------
>
> Key: KYLIN-6085
> URL: https://issues.apache.org/jira/browse/KYLIN-6085
> Project: Kylin
> Issue Type: Bug
> Affects Versions: 5.0.2
> Reporter: Longfei Jiang
> Assignee: Longfei Jiang
> Priority: Major
>
> When executing SQL queries that contain an ORDER BY clause inside a subquery,
> the ordering is not respected in the final query results. This behavior is
> inconsistent with standard SQL semantics and may cause incorrect result
> ordering or unexpected query outputs.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)