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

Julian Hyde commented on CALCITE-883:
-------------------------------------

[~Chunwei Lei],

I like the idea of adding "wrapper" SqlNodes. It minimizes the changes in the 
AST layer (SqlNode). So, that part of the change can stand.

At the Rel layer (RexNode, AggregateCall), is it true that we only need null 
treatment for windowed aggregate calls (RexOver and RexWinAggCall)? The goal of 
this case is just LEAD, LAG, FIRST_VALUE, LAST_VALUE, which are all window 
functions. I believe that we don't need null treatment for aggregate functions 
(AggregateCall) or ordinary functions (RexCall). If so, we can revert a lot of 
changes relating to AggregateCall, RelBuilder.AggCall and RexCall, and just 
keep the changes to RexOver and RexWinAggCall. I think that would make this a 
much smaller change.

Are there plans, or does the SQL standard, allow RESPECT NULLS or IGNORE NULLS 
in aggregate functions or regular functions? We could consider keeping the 
broader changes if they are needed for future expansion.

Let me know what the goals are here. I am happy to start from the work you and 
[~zhztheplayer] have done.

> Support RESPECT NULLS, IGNORE NULLS option for LEAD, LAG, FIRST_VALUE, 
> LAST_VALUE window functions
> --------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-883
>                 URL: https://issues.apache.org/jira/browse/CALCITE-883
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Sean Hsuan-Yi Chu
>            Assignee: Chunwei Lei
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> This issue was brought up in Drill community: 
> (https://issues.apache.org/jira/browse/DRILL-3597)
> For convenience, I copied and pasted the reporter Khurram Faraaz's 
> description here:
> "The SQL standard defines a RESPECT NULLS or IGNORE NULLS option for lead, 
> lag, first_value, and last_value window functions."
> In Calcite, we should have been able to recognized this option.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to