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

Brian Hulette commented on CALCITE-4869:
----------------------------------------

[~jhyde] I'd be happy to send a patch to fix but I could use advice on what the 
appropriate change is since I'm not that familiar with this code. Is it 
actually acceptable for this method to return null (in which case we should 
just update the annotations), or should some logic be added to handle a 
ConditionalStatement?

> 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)

Reply via email to