You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Andrew Pilloud (JIRA)" <ji...@apache.org> on 2019/03/26 17:04:00 UTC

[jira] [Updated] (BEAM-6401) NullPointerException and regression in BeamCalcRel

     [ https://issues.apache.org/jira/browse/BEAM-6401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Pilloud updated BEAM-6401:
---------------------------------
    Fix Version/s: 2.12.0

> 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
>              Labels: triaged
>             Fix For: 2.12.0
>
>
> 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)