You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/10/05 22:28:00 UTC
[jira] [Commented] (CALCITE-4234)
org.apache.calcite.tools.RelBuilder.AggCallImpl#aggregateCall() should not
throw NPE
[ https://issues.apache.org/jira/browse/CALCITE-4234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17208378#comment-17208378 ]
Julian Hyde commented on CALCITE-4234:
--------------------------------------
Yes, it's a bug. The null collation will cause an NPE to be thrown. I don't think the null type is a problem.
The bug is not hit because no one has yet used {{RelBuilder}} to create a call to the {{GROUP_ID}} function.
> org.apache.calcite.tools.RelBuilder.AggCallImpl#aggregateCall() should not throw NPE
> ------------------------------------------------------------------------------------
>
> Key: CALCITE-4234
> URL: https://issues.apache.org/jira/browse/CALCITE-4234
> Project: Calcite
> Issue Type: Sub-task
> Components: core
> Affects Versions: 1.25.0
> Reporter: Vladimir Sitnikov
> Assignee: Julian Hyde
> Priority: Major
>
> CALCITE-4220 introduced the following method:
> {code:java}
> @Override public AggregateCall aggregateCall() {
> return AggregateCall.create(aggFunction, distinct, approximate,
> ignoreNulls, ImmutableList.of(), -1, /* collation: */ null, /* type: */ null, alias);
> }
> {code}
> In practice {{AggregateCall}} constructor has {{null}} checks, so {{aggregateCall}} would always throw NPE:
> {code:java}
> this.type = Objects.requireNonNull(type);
> this.collation = Objects.requireNonNull(collation);
> {code}
> [~julianhyde], would you please check if that behavior is expected?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)