You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2024/04/12 08:25:00 UTC

[jira] [Commented] (KYLIN-5830) When the query connects two or more tables, the query results are inconsistent whether the order by field is in the select field or not

    [ https://issues.apache.org/jira/browse/KYLIN-5830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17836486#comment-17836486 ] 

ASF subversion and git services commented on KYLIN-5830:
--------------------------------------------------------

Commit 191d08c272b48d04441783290459291f70c2e9e6 in kylin's branch refs/heads/kylin5 from Pengfei Zhan
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=191d08c272 ]

KYLIN-5830 Push columns of sortRel to subOlapContexts


> When the query connects two or more tables, the query results are inconsistent whether the order by field is in the select field or not
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-5830
>                 URL: https://issues.apache.org/jira/browse/KYLIN-5830
>             Project: Kylin
>          Issue Type: New Feature
>          Components: Query Engine
>    Affects Versions: 5.0-beta
>            Reporter: Zhimin Wu
>            Assignee: Zhimin Wu
>            Priority: Major
>             Fix For: 5.0.0
>
>
> Q1:
> {code:java}
> select CUSTOMER.C_PHONE
> -- ,LO_PARTKEY
> from SSB.CUSTOMER left join SSB.LINEORDER on CUSTOMER.C_CUSTKEY=LINEORDER.LO_CUSTKEY
> order by LINEORDER.LO_PARTKEY NULLS LAST
> LIMIT 500{code}
> Calcite Plan:
> {code:java}
> KapProjectRel(C_PHONE=[$6], ctx=[])
>   KapLimitRel(ctx=[], fetch=[500])
>     KapSortRel(sort0=[$12], dir0=[ASC], ctx=[])
>       KapJoinRel(condition=[=($0, $11)], joinType=[left], ctx=[])
>         KapTableScan(table=[[SSB, CUSTOMER]], ctx=[1@NDataflow [test]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8]])
>         KapTableScan(table=[[SSB, LINEORDER]], ctx=[2@NDataflow [test1]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]]){code}
> Q2:
> {code:java}
> select CUSTOMER.C_PHONE
> ,LO_PARTKEY
> from SSB.CUSTOMER left join SSB.LINEORDER on CUSTOMER.C_CUSTKEY=LINEORDER.LO_CUSTKEY
> order by LINEORDER.LO_PARTKEY NULLS LAST
> LIMIT 500{code}
> Calcite Plan
> {code:java}
> KapLimitRel(ctx=[], fetch=[500])
>   KapSortRel(sort0=[$1], dir0=[ASC], ctx=[])
>     KapProjectRel(C_PHONE=[$6], LO_PARTKEY=[$12], ctx=[])
>       KapJoinRel(condition=[=($0, $11)], joinType=[left], ctx=[])
>         KapTableScan(table=[[SSB, CUSTOMER]], ctx=[1@NDataflow [test]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8]])
>         KapTableScan(table=[[SSB, LINEORDER]], ctx=[2@NDataflow [test1]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]])
> {code}
> In SortRel, the columns used are not pushed down to the sub OlapContext. To fix this issue, need to add the columns to the sub OlapContext.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)