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

Guoliang Sun commented on KYLIN-6034:
-------------------------------------

h3. Root Cause

When creating an `OlapContext` with `OlapWindowRel` as the top node, only the 
fields used by the window function were collected as dimensions for the 
`OlapContext`.  
The correct result of `Sql2` is because `OlapProjectRel` is outside the 
`OlapContext`, and the columns in `OlapProjectRel` are set to the `OlapContext`.
h3. Dev Design

When creating an `OlapContext` with `OlapWindowRel` as the top node, if there 
is no project in the parent node of `OlapWindowRel` that requires pushing down 
dimensions, collect dimension information from both `OlapWindowRel` and its 
child project nodes.

> Query using the `DENSE_RANK()` function hits the model execution, but the 
> smart recommendation does not recommend an index
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-6034
>                 URL: https://issues.apache.org/jira/browse/KYLIN-6034
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Guoliang Sun
>            Priority: Major
>
> - After model construction, execute the first query.  
> - Click on the homepage recommendation: No index is recommended.  
> - Execute the query with the `DENSE_RANK()` function again.  
> - Recommend again: Index recommendation succeeds.



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

Reply via email to