You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/07/06 17:50:09 UTC

[GitHub] [beam] ibzib commented on a change in pull request #12163: [BEAM-9712] Refactor ZetaSQL planner code and support setting default timezone

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:
users@infra.apache.org