robinyqiu commented on a change in pull request #12348: URL: https://github.com/apache/beam/pull/12348#discussion_r463286427
########## File path: sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlBeamTranslationUtils.java ########## @@ -184,6 +188,19 @@ private static Value beamLogicalObjectToZetaSqlValue(Object object, String ident } else { // input type return Value.createTimeValue(CivilTimeEncoder.encodePacked64TimeNanos((LocalTime) object)); } + } else if (SqlTypes.DATETIME.getIdentifier().equals(identifier)) { + // DateTime value + LocalDateTime datetime; + if (object instanceof Row) { // base type + datetime = + LocalDateTime.of( + LocalDate.ofEpochDay(((Row) object).getValue("Date")), + LocalTime.ofNanoOfDay(((Row) object).getValue("Time"))); + } else { // input type + datetime = (LocalDateTime) object; + } + return Value.createDatetimeValue( Review comment: I created a JIRA for this: https://issues.apache.org/jira/browse/BEAM-10611 Please add a TODO here such that we can make improvement on this in the future. ---------------------------------------------------------------- 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