[
https://issues.apache.org/jira/browse/BEAM-7100?focusedWorklogId=229449&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-229449
]
ASF GitHub Bot logged work on BEAM-7100:
----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Apr/19 22:18
Start Date: 17/Apr/19 22:18
Worklog Time Spent: 10m
Work Description: amaliujia commented on pull request #8339: [BEAM-7100]
BeamValuesRel should accept empty tuples
URL: https://github.com/apache/beam/pull/8339#discussion_r276455617
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamValuesRel.java
##########
@@ -80,15 +80,13 @@ public BeamValuesRel(
BeamValuesRel.class.getSimpleName(),
pinput);
+ Schema schema = CalciteUtils.toSchema(getRowType());
if (tuples.isEmpty()) {
- throw new IllegalStateException("Values with empty tuples!");
+ return pinput.getPipeline().begin().apply(Create.empty(schema));
+ } else {
+ List<Row> rows = tuples.stream().map(tuple -> tupleToRow(schema,
tuple)).collect(toList());
+ return
pinput.getPipeline().begin().apply(Create.of(rows)).setRowSchema(schema);
Review comment:
You are right.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 229449)
Time Spent: 1.5h (was: 1h 20m)
> BeamValuesRel should accept empty tuples
> ----------------------------------------
>
> Key: BEAM-7100
> URL: https://issues.apache.org/jira/browse/BEAM-7100
> Project: Beam
> Issue Type: Bug
> Components: dsl-sql
> Reporter: Rui Wang
> Assignee: Rui Wang
> Priority: Major
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> It is possible for a OUTER JOIN, one side of JOIN contains no tuples. Right
> now such case will thrown an exception with "empty tuples are not allowed".
> However, for OUTER JOIN, empty values on one side can still produce results
> if another side has tuples.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)