drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject drill git commit: DRILL-2596: Let the plan for CTAS queries be saved and shown in WebUI
Date Sat, 04 Apr 2015 00:11:49 GMT
Repository: drill
Updated Branches:
  refs/heads/master f215c4629 -> 10be89fe0


DRILL-2596: Let the plan for CTAS queries be saved and shown in WebUI


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/10be89fe
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/10be89fe
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/10be89fe

Branch: refs/heads/master
Commit: 10be89fe03b1b71595c658a8b5c2586210d28bc7
Parents: f215c46
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Thu Apr 2 14:36:18 2015 -0700
Committer: Hsuan-Yi Chu <hsuanyi@usc.edu>
Committed: Fri Apr 3 14:13:04 2015 -0700

----------------------------------------------------------------------
 .../org/apache/drill/exec/planner/sql/DrillSqlWorker.java   | 6 ++++++
 .../drill/exec/planner/sql/handlers/CreateTableHandler.java | 6 +++---
 .../apache/drill/exec/planner/sql/parser/DrillSqlCall.java  | 7 ++++++-
 .../drill/exec/planner/sql/parser/SqlCreateTable.java       | 9 ++++++++-
 4 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/10be89fe/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
index 710418b..d6f25fb 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
@@ -41,6 +41,7 @@ import org.apache.drill.exec.planner.sql.handlers.ExplainHandler;
 import org.apache.drill.exec.planner.sql.handlers.SetOptionHandler;
 import org.apache.drill.exec.planner.sql.handlers.SqlHandlerConfig;
 import org.apache.drill.exec.planner.sql.parser.DrillSqlCall;
+import org.apache.drill.exec.planner.sql.parser.SqlCreateTable;
 import org.apache.drill.exec.planner.sql.parser.impl.DrillParserWithCompoundIdConverter;
 import org.apache.drill.exec.store.StoragePluginRegistry;
 import org.apache.drill.exec.util.Pointer;
@@ -132,6 +133,11 @@ public class DrillSqlWorker {
       handler = new SetOptionHandler(context);
       break;
     case OTHER:
+      if(sqlNode instanceof SqlCreateTable) {
+        handler = ((DrillSqlCall)sqlNode).getSqlHandler(config, textPlan);
+        break;
+      }
+
       if (sqlNode instanceof DrillSqlCall) {
         handler = ((DrillSqlCall)sqlNode).getSqlHandler(config);
         break;

http://git-wip-us.apache.org/repos/asf/drill/blob/10be89fe/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java
index 111222e..300d65d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java
@@ -38,6 +38,7 @@ import org.apache.drill.exec.planner.sql.DrillSqlWorker;
 import org.apache.drill.exec.planner.sql.parser.SqlCreateTable;
 import org.apache.drill.exec.planner.types.DrillFixedRelDataTypeImpl;
 import org.apache.drill.exec.store.AbstractSchema;
+import org.apache.drill.exec.util.Pointer;
 import org.apache.drill.exec.work.foreman.ForemanSetupException;
 import org.eigenbase.rel.RelNode;
 import org.eigenbase.relopt.RelOptUtil;
@@ -46,9 +47,8 @@ import org.eigenbase.reltype.RelDataType;
 import org.eigenbase.sql.SqlNode;
 
 public class CreateTableHandler extends DefaultSqlHandler {
-
-  public CreateTableHandler(SqlHandlerConfig config) {
-    super(config);
+  public CreateTableHandler(SqlHandlerConfig config, Pointer<String> textPlan) {
+    super(config, textPlan);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/drill/blob/10be89fe/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/DrillSqlCall.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/DrillSqlCall.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/DrillSqlCall.java
index a6bd8b7..3e8d4f1 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/DrillSqlCall.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/DrillSqlCall.java
@@ -23,6 +23,7 @@ import org.apache.drill.exec.ops.QueryContext;
 import org.apache.drill.exec.planner.sql.handlers.AbstractSqlHandler;
 import org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler;
 import org.apache.drill.exec.planner.sql.handlers.SqlHandlerConfig;
+import org.apache.drill.exec.util.Pointer;
 import org.eigenbase.relopt.hep.HepPlanner;
 import org.eigenbase.sql.SqlCall;
 import org.eigenbase.sql.parser.SqlParserPos;
@@ -39,4 +40,8 @@ public abstract class DrillSqlCall extends SqlCall {
   public AbstractSqlHandler getSqlHandler(SqlHandlerConfig config) {
     return new DefaultSqlHandler(config);
   }
-}
+
+  public AbstractSqlHandler getSqlHandler(SqlHandlerConfig config, Pointer<String>
textPlan) {
+    return new DefaultSqlHandler(config, textPlan);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/10be89fe/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateTable.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateTable.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateTable.java
index 5e3c215..ae1c744 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateTable.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateTable.java
@@ -25,6 +25,7 @@ import org.apache.drill.exec.ops.QueryContext;
 import org.apache.drill.exec.planner.sql.handlers.AbstractSqlHandler;
 import org.apache.drill.exec.planner.sql.handlers.CreateTableHandler;
 import org.apache.drill.exec.planner.sql.handlers.SqlHandlerConfig;
+import org.apache.drill.exec.util.Pointer;
 import org.eigenbase.relopt.hep.HepPlanner;
 import org.eigenbase.sql.SqlCall;
 import org.eigenbase.sql.SqlIdentifier;
@@ -93,7 +94,13 @@ public class SqlCreateTable extends DrillSqlCall {
 
   @Override
   public AbstractSqlHandler getSqlHandler(SqlHandlerConfig config) {
-    return new CreateTableHandler(config);
+    return getSqlHandler(config, null);
+  }
+
+  @Override
+  public AbstractSqlHandler getSqlHandler(SqlHandlerConfig config, Pointer<String>
textPlan) {
+    assert textPlan != null : "Create table statement should have a plan";
+    return new CreateTableHandler(config, textPlan);
   }
 
   public List<String> getSchemaPath() {


Mime
View raw message