[
https://issues.apache.org/jira/browse/CALCITE-4869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Brian Hulette resolved CALCITE-4869.
------------------------------------
Resolution: Not A Problem
Looking at this closer I think it is WAI. In Beam we are uneccessarily wrapping
an expression in a BlockStatment to use it with BlockBuilder.append. Instead we
can just add it with BlockBuilder.add. Sending
https://github.com/apache/beam/pull/15837 to fix.
> BlockBuilder.append raises an NPE when called with a ConditionalStatement
> -------------------------------------------------------------------------
>
> Key: CALCITE-4869
> URL: https://issues.apache.org/jira/browse/CALCITE-4869
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.27.0, 1.28.0
> Reporter: Brian Hulette
> Priority: Major
>
> I noticed this while working on BEAM-13099. Beam's usage of BlockBuilder
> [here|https://github.com/apache/beam/blob/cd4b7f3b1af4f51bdab1a0b1a98f94b5288c09ec/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamCalcRel.java#L662-L666]
> raises an NPE, due to the null-checking added in
> https://github.com/apache/calcite/commit/d9a81b88ad561e7e4cedae93e805e0d7a53a7f1a.
> We pass a ConditionalStatement to BlockBuilder.append, which doesn't match
> either [if
> statement|https://github.com/apache/calcite/blob/f61541d633cfde53a4b0de0c23a010250c93274e/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java#L165-L180],
> and produces a null result.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)