[ 
https://issues.apache.org/jira/browse/BEAM-5274?focusedWorklogId=139915&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-139915
 ]

ASF GitHub Bot logged work on BEAM-5274:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Aug/18 22:41
            Start Date: 30/Aug/18 22:41
    Worklog Time Spent: 10m 
      Work Description: amaliujia commented on a change in pull request #6309: 
[BEAM-5274][SQL] Catch NoSuchElementException
URL: https://github.com/apache/beam/pull/6309#discussion_r214202380
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamEnumerableConverter.java
 ##########
 @@ -304,7 +305,11 @@ private static Object fieldToAvatica(Schema.FieldType 
type, Object beamValue) {
                   MetricsFilter.builder()
                       
.addNameFilter(MetricNameFilter.named(BeamEnumerableConverter.class, "rows"))
                       .build());
-      count = metrics.getCounters().iterator().next().getAttempted();
+      try {
+        count = metrics.getCounters().iterator().next().getAttempted();
+      } catch (NoSuchElementException e) {
 
 Review comment:
   Updated.
   
   Thought about it. Your approach is better from the perspective of avoiding 
catching other NoSuchElementExceptions that are not caused by this issue.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 139915)
    Time Spent: 1h  (was: 50m)

> Handle NoSuchElementException When select from an empty table and insert into 
> another table
> -------------------------------------------------------------------------------------------
>
>                 Key: BEAM-5274
>                 URL: https://issues.apache.org/jira/browse/BEAM-5274
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




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

Reply via email to