[
https://issues.apache.org/jira/browse/CALCITE-6374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17838837#comment-17838837
]
allendang edited comment on CALCITE-6374 at 4/19/24 3:19 AM:
-------------------------------------------------------------
Hello, [~julianhyde] , I've removed the png and description has been
redesigned. Please take a look.
was (Author: allendang):
Hello, [~julianhyde] , I've removed the png and replace npe with
NullPointerException. Please take a look.
> LatticeSuggester throw NullPointerException when agg call covered with cast
> ----------------------------------------------------------------------------
>
> Key: CALCITE-6374
> URL: https://issues.apache.org/jira/browse/CALCITE-6374
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: allendang
> Priority: Critical
> Attachments: image-2024-04-18-21-44-04-262.png
>
>
> I changed {color:#de350b}q1{color} in
> {color:#4c9aff}org.apache.calcite.materialize.LatticeSuggesterTest#testExpressionEvolution{color}
> It was originally like this
> {code:java}
> select
> "num_children_at_home" + 10 as "n10",
> "num_children_at_home" + 14 as "n14",
> sum("num_children_at_home" + 12) as "n12",
> sum("num_children_at_home" + 13) as "n13"
> from "customer"
> group by "num_children_at_home" + 10, "num_children_at_home" + 14 {code}
> i changed it like following
> {code:java}
> select
> "num_children_at_home" + 10 as "n10",
> "num_children_at_home" + 14 as "n14",
> cast(sum("num_children_at_home" + 12) as double) as "n12",
> sum("num_children_at_home" + 13) as "n13"
> from "customer"
> group by "num_children_at_home" + 10, "num_children_at_home" + 14 {code}
> Re-running the test case throws the following exception
> {code:java}
> measure.name
> java.lang.NullPointerException: measure.name
> at java.util.Objects.requireNonNull(Objects.java:228)
> at
> org.apache.calcite.materialize.LatticeSuggester.deriveAlias(LatticeSuggester.java:290)
> at
> org.apache.calcite.materialize.LatticeSuggester.lambda$addFrame$3(LatticeSuggester.java:250)
> at org.apache.calcite.util.Util$TransformingList.get(Util.java:2810)
> at java.util.AbstractList$Itr.next(AbstractList.java:358)
> at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
> at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:265)
> at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:238)
> at org.apache.calcite.materialize.Lattice$Measure.<init>(Lattice.java:567)
> at
> org.apache.calcite.materialize.LatticeSuggester.addFrame(LatticeSuggester.java:240)
>
> at
> org.apache.calcite.materialize.LatticeSuggester.lambda$addQuery$1(LatticeSuggester.java:143)
> at java.util.ArrayList.forEach(ArrayList.java:1259)
> at
> org.apache.calcite.materialize.LatticeSuggester.addQuery(LatticeSuggester.java:143)
> at
> org.apache.calcite.materialize.LatticeSuggesterTest$Tester.addQuery(LatticeSuggesterTest.java:851)
> at
> org.apache.calcite.materialize.LatticeSuggesterTest.testExpressionEvolution(LatticeSuggesterTest.java:551){code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)