[
https://issues.apache.org/jira/browse/BEAM-10219?focusedWorklogId=451753&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-451753
]
ASF GitHub Bot logged work on BEAM-10219:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Jun/20 21:41
Start Date: 26/Jun/20 21:41
Worklog Time Spent: 10m
Work Description: ZijieSong946 commented on pull request #12054:
URL: https://github.com/apache/beam/pull/12054#issuecomment-650415974
> 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));
> }
> ```
OK. Sure.
----------------------------------------------------------------
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: 451753)
Time Spent: 7h 40m (was: 7.5h)
> 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 40m
> 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)