apilloud commented on a change in pull request #12054:
URL: https://github.com/apache/beam/pull/12054#discussion_r445774777



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/logicaltypes/SqlTypes.java
##########
@@ -27,4 +28,7 @@ private SqlTypes() {}
 
   /** Beam LogicalType corresponding to ZetaSQL/CalciteSQL DATE type. */
   public static final LogicalType<LocalDate, Long> DATE = new Date();
+
+  /** Beam LogicalType corresponding to ZetaSQL/CalciteSQL TIME type. */
+  public static final LogicalType<LocalTime, Long> TIME = new Time();

Review comment:
       Actually, the ZetaSQL standard calls for those lossy conversions. The 
test is failing due to truncation of precision to millisecond. Expected right 
answers for this test case:
   ```
     {
       "f0_": "00:00:00",
       "f1_": "23:59:59.999999",
       "f2_": "01:02:03.123456",
       "f3_": "01:02:03.123450",
       "f4_": "01:02:03.120000",
       "f5_": "01:02:03",
       "f6_": "01:02:03",
       "f7_": "01:02:03",
       "f8_": "00:00:00",
       "f9_": "13:00:00",
       "f10_": "13:00:00",
       "f11_": "00:00:00",
       "f12_": "23:59:59.999999",
       "f13_": "01:02:03.123456",
       "f14_": "01:02:03.123450",
       "f15_": "01:02:03.120",
       "f16_": "01:02:03",
       "f17_": "01:02:03",
       "f18_": "01:02:03",
       "f19_": "00:00:00",
       "f20_": "13:00:00",
       "f21_": "13:00:00"
     }
   ```




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


Reply via email to