You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2020/11/30 17:27:30 UTC

[GitHub] [kylin] hit-lacus commented on pull request #1493: KYLIN-4823 Fix duplicate groupBy columns in OLAPAggregateRel

hit-lacus commented on pull request #1493:
URL: https://github.com/apache/kylin/pull/1493#issuecomment-735928205


   ## Reproduce SQL
   
   ```sql
   SELECT SELLER_ID,
       CASE WHEN LSTG_SITE_ID > 1 then LSTG_SITE_ID + 0.3 else LSTG_SITE_ID END AS dyna_group,
       SUM(PRICE)
   FROM KYLIN_SALES
   GROUP BY SELLER_ID,
       CASE WHEN LSTG_SITE_ID > 1 then LSTG_SITE_ID + 0.3 else LSTG_SITE_ID END
   HAVING SUM(PRICE)>10
   ```
   
   
   ### Cause Analysis
   
   1. Having Filter is wrong!
   <img width="1127" alt="image" src="https://user-images.githubusercontent.com/14030549/100642316-993b7b80-3373-11eb-88cf-b1a7db7044e8.png">
   
   2. Fetch duplicate column in TupleExpression
   <img width="842" alt="image" src="https://user-images.githubusercontent.com/14030549/100642470-c556fc80-3373-11eb-9601-0e2ac26f3c90.png">
   
   3. Add same column to groupBy column twice.
   <img width="857" alt="image" src="https://user-images.githubusercontent.com/14030549/100642615-f1727d80-3373-11eb-977a-a530e2ab36f6.png">
   
   4. Start to create a having TupleFilter
   <img width="1042" alt="image" src="https://user-images.githubusercontent.com/14030549/100642787-31d1fb80-3374-11eb-9acc-babce32c535b.png">
   
   5. `$2` is wrong.
   <img width="1210" alt="image" src="https://user-images.githubusercontent.com/14030549/100642872-5201ba80-3374-11eb-872f-b44c46e85b80.png">
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org