Guoliang Sun created KYLIN-6044:
-----------------------------------

             Summary: 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


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