calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Mushin <>
Subject RE: Null literals in AggregateReduceFunctionsRule
Date Tue, 07 Feb 2017 09:21:23 GMT
Thanks Julian for your reply!

I created jira case[1] and I will try submit a pull request in near future.


Anton Mushin

-----Original Message-----
From: Julian Hyde [] 
Sent: Tuesday, February 07, 2017 5:05 AM
Cc: Timo Walther <>
Subject: Re: Null literals in AggregateReduceFunctionsRule

Adding a cast around the null literal makes sense. I would use “rexBuilder.makeCast(type,
constantNull())” rather than “rexBuilder.makeNullLiteral(type.getSqlTypeName())” because
there’s a chance that the type needs precision & scale.

Can you please create a Calcite jira case and submit a pull request?

And by the way, I think I see similar patterns in AggregateExpandDistinctAggregatesRule, AggregateValuesRule
and even RexBuilder.makeOver.


> On Feb 2, 2017, at 12:57 AM, Anton Mushin <> wrote:
> Hello community,
> I have worked for support  standard deviation/variance functions in Flink SQL [1] and
I got exception " Type NULL is not supported. Null values must have a supported type.". 
> I started search root cause and found what problem come up from AggregateReduceFunctionsRule[2].
 @twalthr confirmed it after[3].
> Now I have been used WA - the copy AggregateReduceFunctionsRule inside Flink with changes.
> Could we resolve the problem some way?
> I look forward to your reply.
> [1]
> [2] 
> 5280&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabp
> anel#comment-15615280 [3] 
> 7697&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabp
> anel#comment-15667697
> Regards,
> Anton Mushin

View raw message