ibzib commented on pull request #15174:
URL: https://github.com/apache/beam/pull/15174#issuecomment-884585032


   > Hi @ibzib, I am working on a group of related issues using some of your 
work in #14392. Could you help me to take a look at the progress so far and 
provide some guidance on the next steps?
   > 
   > I am planning to include 
[BEAM-12098](https://issues.apache.org/jira/browse/BEAM-12098) and 
[BEAM-12099](https://issues.apache.org/jira/browse/BEAM-12099) in this PR, but 
for those, I have a problem, in the transformation related to UNNEST, when it 
receives an empty array, does not return anything so it fails before 
aggregation transforms (COUNT, BIT_OR).
   > 
   > I think the problem could be in this part 
https://github.com/apache/beam/blob/master/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/unnest/BeamZetaSqlUncollectRel.java#L115
 because when the array is empty, this transform does not output anything.
   > 
   > Any guidance on this would be appreciated.
   > Thanks!
   
   Hi Benjamin, thanks for working on this.
   
   If I understand correctly, `UNNEST([])` returning no values (an empty 
pcollection) is intended behavior.
   
   I experimented with other queries and found that `SELECT COUNT(*) FROM 
table_empty` also returned no values. So I think the problem is Beam SQL's 
aggregation implementation. Aggregations on empty pcollections are supposed to 
return some default value, for example Count on an empty pcollection is 
expected to return 0. I filed a bug for this: BEAM-12647
   
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to