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

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

                Author: ASF GitHub Bot
            Created on: 29/Sep/21 07:56
            Start Date: 29/Sep/21 07:56
    Worklog Time Spent: 10m 
      Work Description: blackhogz commented on a change in pull request #15485:
URL: https://github.com/apache/beam/pull/15485#discussion_r718249345



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java
##########
@@ -594,10 +591,15 @@ public static TableRow toTableRow(Row row) {
           java.time.format.DateTimeFormatter localDateTimeFormatter =
               (0 == localDateTime.getNano()) ? ISO_LOCAL_DATE_TIME : 
BIGQUERY_DATETIME_FORMATTER;
           return localDateTimeFormatter.format(localDateTime);
-        } else if ("Enum".equals(identifier)) {
+        } else if (EnumerationType.IDENTIFIER.equals(identifier)) {
           return fieldType
               .getLogicalType(EnumerationType.class)
               .toString((EnumerationType.Value) fieldValue);
+        } else if (NanosInstant.IDENTIFIER.equals(identifier)) {
+          if (fieldValue instanceof java.time.Instant) {

Review comment:
       @amuletxheart I think we should align with other field types and just 
perform the type coercion without the if clause here. This allows us to fail 
loudly instead of silently dropping the field. 




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 657045)
    Time Spent: 2h 40m  (was: 2.5h)

> Cannot write "google.protobuf.Timestamp" (NanosInstant) to BigQuery through 
> schemas
> -----------------------------------------------------------------------------------
>
>                 Key: BEAM-10655
>                 URL: https://issues.apache.org/jira/browse/BEAM-10655
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-gcp
>            Reporter: Chamikara Madhusanka Jayalath
>            Assignee: Xinshen Yong
>            Priority: P2
>              Labels: starter
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> See here for details and instructions for reproducing.
> [https://lists.apache.org/thread.html/r1657ccf41dda3f2d9d082c5ebb006dd2da92863983971ad23485f16e%40%3Cdev.beam.apache.org%3E]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to