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

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

                Author: ASF GitHub Bot
            Created on: 06/Jul/20 17:50
            Start Date: 06/Jul/20 17:50
    Worklog Time Spent: 10m 
      Work Description: ibzib commented on a change in pull request #12163:
URL: https://github.com/apache/beam/pull/12163#discussion_r450384095



##########
File path: 
sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSQLQueryPlanner.java
##########
@@ -65,9 +65,12 @@ public ZetaSQLQueryPlanner(FrameworkConfig config) {
     plannerImpl = new ZetaSQLPlannerImpl(config);
   }
 
-  public ZetaSQLQueryPlanner(JdbcConnection jdbcConnection, RuleSet[] 
ruleSets) {
+  // Called by BeamSqlEnv.instantiatePlanner() reflectively

Review comment:
       Consider making this a javadoc comment so we can add a link.

##########
File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/BeamSqlPipelineOptions.java
##########
@@ -30,6 +30,12 @@
 
   void setPlannerName(String className);
 
+  @Description("Default timezone for ZetaSQL analyzer; currently has no effect 
on CalciteSQL.")

Review comment:
       Can you add a note about which values are allowed here?

##########
File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/CalciteQueryPlanner.java
##########
@@ -75,7 +75,9 @@
   private final Planner planner;
   private final JdbcConnection connection;
 
-  public CalciteQueryPlanner(JdbcConnection connection, RuleSet[] ruleSets) {
+  public CalciteQueryPlanner(
+      JdbcConnection connection, RuleSet[] ruleSets, String defaultTimezone) {
+    // TODO: support setting default timezone?

Review comment:
       If defaultTimezone is set here, we should warn the user it will have no 
effect.

##########
File path: 
sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/SqlAnalyzer.java
##########
@@ -187,8 +167,10 @@ static AnalyzerOptions initAnalyzerOptions() {
     return options;
   }
 
-  static AnalyzerOptions initAnalyzerOptions(QueryParameters queryParams) {
-    AnalyzerOptions options = initAnalyzerOptions();
+  static AnalyzerOptions initAnalyzerOptions(QueryParameters queryParams, 
String defaultTimezone) {

Review comment:
       While we're at it, maybe we should rename this `getAnalyzerOptions`. To 
me, `init` implies a one-time setup operation, which this is not.

##########
File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/CalciteQueryPlanner.java
##########
@@ -75,7 +75,9 @@
   private final Planner planner;
   private final JdbcConnection connection;
 
-  public CalciteQueryPlanner(JdbcConnection connection, RuleSet[] ruleSets) {
+  public CalciteQueryPlanner(
+      JdbcConnection connection, RuleSet[] ruleSets, String defaultTimezone) {
+    // TODO: support setting default timezone?

Review comment:
       Can you create and link a JIRA?




----------------------------------------------------------------
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: 454984)
    Time Spent: 20m  (was: 10m)

> setting default timezone doesn't work
> -------------------------------------
>
>                 Key: BEAM-9712
>                 URL: https://issues.apache.org/jira/browse/BEAM-9712
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql-zetasql
>            Reporter: Andrew Pilloud
>            Assignee: Robin Qiu
>            Priority: P4
>              Labels: zetasql-compliance
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> several failures in shard 14
> (note: fixing the internal tests requires plumbing through the timezone 
> config.)
> {code}
> [name=timestamp_to_string_1]
> select [cast(timestamp "2015-01-28" as string),
>         cast(timestamp "2015-01-28 00:00:00" as string),
>         cast(timestamp "2015-01-28 00:00:00.0" as string),
>         cast(timestamp "2015-01-28 00:00:00.00" as string),
>         cast(timestamp "2015-01-28 00:00:00.000" as string),
>         cast(timestamp "2015-01-28 00:00:00.0000" as string),
>         cast(timestamp "2015-01-28 00:00:00.00000" as string),
>         cast(timestamp "2015-01-28 00:00:00.000000" as string)]
> --
> ARRAY<STRUCT<ARRAY<>>>[
>   {ARRAY<STRING>[
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45"
>    ]}
> ]
> {code}
> {code}
> [default_time_zone=Pacific/Chatham]
> [name=timestamp_to_string_1]
> select [cast(timestamp "2015-01-28" as string),
>         cast(timestamp "2015-01-28 00:00:00" as string),
>         cast(timestamp "2015-01-28 00:00:00.0" as string),
>         cast(timestamp "2015-01-28 00:00:00.00" as string),
>         cast(timestamp "2015-01-28 00:00:00.000" as string),
>         cast(timestamp "2015-01-28 00:00:00.0000" as string),
>         cast(timestamp "2015-01-28 00:00:00.00000" as string),
>         cast(timestamp "2015-01-28 00:00:00.000000" as string)]
> --
> ARRAY<STRUCT<ARRAY<>>>[
>   {ARRAY<STRING>[
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45",
>      "2015-01-28 00:00:00+13:45"
>    ]}
> ]
> {code}



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

Reply via email to