[ 
https://issues.apache.org/jira/browse/BEAM-9709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17082704#comment-17082704
 ] 

Yueyang Qiu edited comment on BEAM-9709 at 4/13/20, 10:33 PM:
--------------------------------------------------------------

(Previous comments are wrong. Writing the right version.)

Thank you Andrew for linking to the other bug. I took that as well. I think 
these 2 issues could be fixed together.

 


was (Author: robinyqiu):
OK I dug into this a bit more and found the actual problem.

 

Currently Beam ZetaSQL engine does not set default time zone. So in 
BeamZetaSqlCalcRel, when ZetaSQL evaluator evaluate an expression that depends 
on default time zone, it choose its own: "America/Los_Angeles" 
([https://github.com/google/zetasql/blob/master/zetasql/reference_impl/evaluation.cc#L122]).

 

The fix should be a one-line change in BeamZetaSqlCalcRel 
"options.setDefaultTimezone("UTC");" (i.e. Beam ZetaSQL defines its own default 
time zone to be UTC).

 

Thank you Andrew for linking to the other bug. I took that as well. I think 
these 2 issues could be fixed together.

 

> timezone off by 8 hours
> -----------------------
>
>                 Key: BEAM-9709
>                 URL: https://issues.apache.org/jira/browse/BEAM-9709
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql-zetasql
>            Reporter: Andrew Pilloud
>            Assignee: Yueyang Qiu
>            Priority: Trivial
>              Labels: zetasql-compliance
>
> two failures in shard 13, one failure in shard 19
> {code}
> Expected: ARRAY<STRUCT<TIMESTAMP>>[{2014-01-31 00:00:00+00}]
>   Actual: ARRAY<STRUCT<$col1 TIMESTAMP>>[{2014-01-31 08:00:00+00}], 
> {code}
> {code}
> select timestamp(date '2014-01-31')
> {code}



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

Reply via email to