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

Guoliang Sun commented on KYLIN-6044:
-------------------------------------

h3. Workaround

Verify whether aggregate indexes can be hit by disabling 
**PROJECT_AGGREGATE_MERGE**. The verification was successful with the following 
configuration parameter:  


{code:java}
kylin.query.calcite.remove-rule=org.apache.calcite.rel.rules.CoreRules#PROJECT_AGGREGATE_MERGE{code}
  
In some cases, if aggregate indexes cannot be used to answer the query and you 
want to use detailed indexes instead, configure the following parameter:  


{code:java}
kylin.query.use-tableindex-answer-non-raw-query=true{code}


With this configuration, queries can be correctly answered using detailed 
indexes, provided the query logic plan is based on the removal of 
PROJECT_AGGREGATE_MERGE.

> Subqueries containing JOIN may lead to incorrect query results
> --------------------------------------------------------------
>
>                 Key: KYLIN-6044
>                 URL: https://issues.apache.org/jira/browse/KYLIN-6044
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Guoliang Sun
>            Priority: Major
>
> It was discovered that a specific SQL query hits inconsistent indexes in a 
> particular version compared to earlier versions. Further simplification of 
> the SQL revealed that this issue might lead to incorrect query results.  
>  
> {code:java}
> SELECT count(1)
> FROM (
>     SELECT 1
>     FROM (
>         SELECT sum(D_YEAR) as acct_bal_CURR
>             ,1 AS DT
>         FROM SSB.DATES
>         ) a
>     left JOIN (
>         SELECT sum(D_YEARMONTHNUM) acct_id_CURR
>             ,1 AS DT
>         FROM SSB.DATES 
>         ) b ON a.DT = b.DT
>     )
> LIMIT 500{code}
> The model contains two SUM metrics from the SQL, and the correct query result 
> should be 1.
>  



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

Reply via email to