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

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

                Author: ASF GitHub Bot
            Created on: 26/Jun/20 21:39
            Start Date: 26/Jun/20 21:39
    Worklog Time Spent: 10m 
      Work Description: robinyqiu commented on pull request #12054:
URL: https://github.com/apache/beam/pull/12054#issuecomment-650415147


   Thanks for patching the precision fix! The only remaining issue revealed 
from internal tests is that during `CAST` operation time microsecond-precision 
could be lost. Could you please add the following unit test to the end of the 
new test lists? If you have time you can look into it a bit more to see if 
there is a quick fix. Otherwise feel free to create a new JIRA to track the 
problem and then ignore the test.
   
   ```
     @Test
     public void testCastBetweenTimeAndString() {
       String sql =
           "SELECT CAST(s1 as TIME) as t2, CAST(t1 as STRING) as s2 FROM "
               + "(SELECT '12:34:56.123456' as s1, TIME '12:34:56.123456' as 
t1)";
    
       ZetaSQLQueryPlanner zetaSQLQueryPlanner = new 
ZetaSQLQueryPlanner(config);
       BeamRelNode beamRelNode = zetaSQLQueryPlanner.convertToBeamRel(sql);
       PCollection<Row> stream = BeamSqlRelUtils.toPCollection(pipeline, 
beamRelNode);
    
       PAssert.that(stream)
           .containsInAnyOrder(
               Row.withSchema(
                       Schema.builder()
                           .addLogicalTypeField("t2", SqlTypes.TIME)
                           .addStringField("s2")
                           .build())
                   .addValues(LocalTime.of(12, 34, 56, 123456000), 
"12:34:56.123456")
                   .build());
       
pipeline.run().waitUntilFinish(Duration.standardMinutes(PIPELINE_EXECUTION_WAITTIME_MINUTES));
     }
   
   ```


----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 451751)
    Time Spent: 7h 20m  (was: 7h 10m)

> Support ZetaSQL TIME functions in BeamSQL
> -----------------------------------------
>
>                 Key: BEAM-10219
>                 URL: https://issues.apache.org/jira/browse/BEAM-10219
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql-zetasql
>            Reporter: Robin Qiu
>            Assignee: Zijie Song
>            Priority: P2
>          Time Spent: 7h 20m
>  Remaining Estimate: 0h
>
> Support *all* TIME functions defined in ZetaSQL (BigQuery Standard SQL). See 
> the list of functions below:
> [https://github.com/google/zetasql/blob/master/docs/time_functions.md]



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

Reply via email to