darshanj commented on pull request #11967:
URL: https://github.com/apache/beam/pull/11967#issuecomment-657055611
@amaliujia
Thanks for pointing out.
I tried to debug and see coder is throwing the exception. Looks like
Any idea/suggestion how do we fix this/make it work? Test below it passes.
But combination of byte string and null fails.
```
@Test
public void testUnionAllBytes() {
String sql = "SELECT DISTINCT val.BYTES "
+"from (select b\"1\" BYTES union all "
// +"select cast(NULL as bytes) union all "
+"select b\"-1\" union all "
+"select b\"1\" ) val";
// +"select cast(NULL as bytes)) val";
ZetaSQLQueryPlanner zetaSQLQueryPlanner = new
ZetaSQLQueryPlanner(config);
BeamRelNode beamRelNode = zetaSQLQueryPlanner.convertToBeamRel(sql);
PCollection<Row> stream = BeamSqlRelUtils.toPCollection(pipeline,
beamRelNode);
final Schema schema =
Schema.builder().addNullableField("field1",FieldType.BYTES).build();
byte[] nullValue = null;
PAssert.that(stream)
.containsInAnyOrder(
// Row.withSchema(schema).addValues(nullValue).build(),
Row.withSchema(schema).addValues("-1".getBytes(StandardCharsets.UTF_8)).build(),
Row.withSchema(schema).addValues("1".getBytes(StandardCharsets.UTF_8)).build());
pipeline.run().waitUntilFinish(Duration.standardMinutes(PIPELINE_EXECUTION_WAITTIME_MINUTES));
}
```
Was this scenerio working with old code, as i don't see such a test in
BeamUnionRelTest?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]