hit-lacus commented on pull request #1493: URL: https://github.com/apache/kylin/pull/1493#issuecomment-736166077
### Analysis The method in `buildGroups` in `OLAPAggregateRel.java` return duplicate column, thus cause `sqlDigest.havingFilter` be set to a wrong column. ### Step by step Analysis 1. Having Filter is wrong, should be `price` not `LSTG_SITE_ID` ! Let's see what happen ? <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, two `LSTG_SITE_ID`. <img width="842" alt="image" src="https://user-images.githubusercontent.com/14030549/100642470-c556fc80-3373-11eb-9601-0e2ac26f3c90.png"> 3. Add same column(`LSTG_SITE_ID`) 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 because <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: [email protected]
