You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/07/17 21:23:34 UTC

[GitHub] [beam] robinyqiu commented on a change in pull request #12261: [BEAM-10490] Support read/write ZetaSQL DATE/TIME types from/to BigQuery

robinyqiu commented on a change in pull request #12261:
URL: https://github.com/apache/beam/pull/12261#discussion_r456680548



##########
File path: sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtilsTest.java
##########
@@ -410,96 +415,49 @@ public void testSubMilliPrecisionRejected() {
     assertThrows(
         "precision",
         IllegalArgumentException.class,
-        () ->
-            BigQueryUtils.convertAvroFormat(
-                Schema.Field.of("dummy", Schema.FieldType.DATETIME).getType(),
-                1000000001L,
-                REJECT_OPTIONS));
+        () -> BigQueryUtils.convertAvroFormat(FieldType.DATETIME, 1000000001L, REJECT_OPTIONS));
   }
 
   @Test
   public void testMilliPrecisionOk() {
     long millis = 123456789L;
     assertThat(
-        BigQueryUtils.convertAvroFormat(
-            Schema.Field.of("dummy", Schema.FieldType.DATETIME).getType(),
-            millis * 1000,
-            REJECT_OPTIONS),
+        BigQueryUtils.convertAvroFormat(FieldType.DATETIME, millis * 1000, REJECT_OPTIONS),
         equalTo(new Instant(millis)));
   }
 
   @Test
   public void testSubMilliPrecisionTruncated() {
     long millis = 123456789L;
     assertThat(
-        BigQueryUtils.convertAvroFormat(
-            Schema.Field.of("dummy", Schema.FieldType.DATETIME).getType(),
-            millis * 1000 + 123,
-            TRUNCATE_OPTIONS),
+        BigQueryUtils.convertAvroFormat(FieldType.DATETIME, millis * 1000 + 123, TRUNCATE_OPTIONS),
         equalTo(new Instant(millis)));
   }
 
   @Test
-  public void testSubMilliPrecisionLogicalTypeRejected() {

Review comment:
       Yes, it's not relavent anymore. ZetaSQL TIME type is now able to support micro-second precision.




----------------------------------------------------------------
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:
users@infra.apache.org