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

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

                Author: ASF GitHub Bot
            Created on: 05/Feb/19 21:42
            Start Date: 05/Feb/19 21:42
    Worklog Time Spent: 10m 
      Work Description: chamikaramj commented on pull request #7441: 
[BEAM-6392] Add support for the BigQuery read API to BigQueryIO.
URL: https://github.com/apache/beam/pull/7441#discussion_r253175366
 
 

 ##########
 File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryAvroUtils.java
 ##########
 @@ -100,6 +116,62 @@ static String formatTimestamp(String timestamp) {
     return String.format("%s.%s UTC", dayAndTime, fractionalSeconds);
   }
 
+  /**
+   * This method formats a BigQuery DATE value into a String matching the 
format used by JSON
+   * export. Date records are stored in "days since epoch" format, and 
BigQuery uses the proleptic
+   * Gregorian calendar.
+   */
+  private static String formatDate(int date) {
+    return 
LocalDate.ofEpochDay(date).format(java.time.format.DateTimeFormatter.ISO_LOCAL_DATE);
+  }
+
+  private static final java.time.format.DateTimeFormatter 
ISO_LOCAL_TIME_FORMATTER_MICROS =
+      new DateTimeFormatterBuilder()
+          .appendValue(HOUR_OF_DAY, 2)
+          .appendLiteral(':')
+          .appendValue(MINUTE_OF_HOUR, 2)
+          .appendLiteral(':')
+          .appendValue(SECOND_OF_MINUTE, 2)
+          .appendLiteral('.')
+          .appendFraction(NANO_OF_SECOND, 6, 6, false)
+          .toFormatter();
+
+  private static final java.time.format.DateTimeFormatter 
ISO_LOCAL_TIME_FORMATTER_MILLIS =
+      new DateTimeFormatterBuilder()
+          .appendValue(HOUR_OF_DAY, 2)
+          .appendLiteral(':')
+          .appendValue(MINUTE_OF_HOUR, 2)
+          .appendLiteral(':')
+          .appendValue(SECOND_OF_MINUTE, 2)
+          .appendLiteral('.')
+          .appendFraction(NANO_OF_SECOND, 3, 3, false)
+          .toFormatter();
+
+  private static final java.time.format.DateTimeFormatter 
ISO_LOCAL_TIME_FORMATTER_SECONDS =
+      new DateTimeFormatterBuilder()
+          .appendValue(HOUR_OF_DAY, 2)
+          .appendLiteral(':')
+          .appendValue(MINUTE_OF_HOUR, 2)
+          .appendLiteral(':')
+          .appendValue(SECOND_OF_MINUTE, 2)
+          .toFormatter();
+
+  /**
+   * This method formats a BigQuery TIME value into a String matching the 
format used by JSON
+   * export. Time records are stored in "microseconds since midnight" format.
+   */
+  private static String formatTime(long timeMicros) {
 
 Review comment:
   Just to clarify, why don't we always use most precise version 
(ISO_LOCAL_TIME_FORMATTER_MICROS) here ?
 
----------------------------------------------------------------
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: 194819)
    Time Spent: 1h 10m  (was: 1h)

> Add support for new BigQuery streaming read API to BigQueryIO
> -------------------------------------------------------------
>
>                 Key: BEAM-6392
>                 URL: https://issues.apache.org/jira/browse/BEAM-6392
>             Project: Beam
>          Issue Type: New Feature
>          Components: io-java-gcp
>            Reporter: Kenneth Jung
>            Assignee: Kenneth Jung
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> BigQuery has developed a new streaming egress API which will soon reach 
> public availability. Add support for the new API in BigQueryIO.



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

Reply via email to