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

Andrew Pilloud commented on BEAM-6401:
--------------------------------------

Opened a calcite issue: CALCITE-2783

Because you have a workaround I'm going to stop working on this for the moment.

> NullPointerException and regression in BeamCalcRel
> --------------------------------------------------
>
>                 Key: BEAM-6401
>                 URL: https://issues.apache.org/jira/browse/BEAM-6401
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql
>            Reporter: Gleb Kanterov
>            Assignee: Andrew Pilloud
>            Priority: Major
>
> Test case to reproduce:
> {code}
>     Schema schema =
>         Schema.builder()
>             .addNullableField("f0", Schema.FieldType.BOOLEAN)
>             .build();
>     String sql =
>         "SELECT SUM(case when coalesce(f0, true) = true then 1 else 0 end) " +
>         "FROM PCOLLECTION";
>     List<Row> rows = ImmutableList.of(
>         Row.withSchema(schema).addValue(false).build(),
>         Row.withSchema(schema).addValue(true).build(),
>         Row.withSchema(schema).addValue(null).build());
>     PCollection<Row> input = pipeline.apply("rows", 
> Create.of(rows).withRowSchema(schema));
>     
> PAssert.that(input.apply(SqlTransform.query(sql))).satisfies(matchesScalar(2));
>     pipeline.run();
> {code}
> Similar test case doesn't throw NPE, but fails:
> {code}
>     Schema schema =
>         Schema.builder()
>             .addNullableField("f0", Schema.FieldType.BOOLEAN)
>             .build();
>     String sql =
>         "SELECT SUM(case when coalesce(f0, false) = true then 1 else 0 end) " 
> +
>         "FROM PCOLLECTION";
>     List<Row> rows = ImmutableList.of(
>         Row.withSchema(schema).addValue(false).build(),
>         Row.withSchema(schema).addValue(true).build(),
>         Row.withSchema(schema).addValue(null).build());
>     PCollection<Row> input = pipeline.apply("rows", 
> Create.of(rows).withRowSchema(schema));
>     
> PAssert.that(input.apply(SqlTransform.query(sql))).satisfies(matchesScalar(1));
>     pipeline.run();
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to