Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill, mail # dev - [29/53] [abbrv] git commit: Added Visitor for logical plan graph and accompanying accept methods in each of the LogicalOperator classes. Created basic optimizer for logical to physical plan coversion.


Copy link to this message
-
[29/53] [abbrv] git commit: Added Visitor for logical plan graph and accompanying accept methods in each of the LogicalOperator classes. Created basic optimizer for logical to physical plan coversion.
jacques@... 2013-07-20, 01:57
Added Visitor for logical plan graph and accompanying accept methods in each of the LogicalOperator classes. Created basic optimizer for logical to physical plan coversion.

Signed-off-by: Jacques Nadeau <[EMAIL PROTECTED]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/1be6bd48
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/1be6bd48
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/1be6bd48

Branch: refs/heads/master
Commit: 1be6bd489827aae45155e45bc23ee7179d140897
Parents: 01278ae
Author: Jason Altekruse <[EMAIL PROTECTED]>
Authored: Thu Jun 13 16:39:51 2013 -0700
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Wed Jun 19 11:11:03 2013 -0700

----------------------------------------------------------------------
 .gitignore                                      |   1 +
 .../org/apache/drill/common/JSONOptions.java    |  17 ++-
 .../apache/drill/common/graph/GraphAlgos.java   |  20 ++-
 .../drill/common/logical/LogicalPlan.java       |   8 +-
 .../logical/data/CollapsingAggregate.java       |  14 ++
 .../drill/common/logical/data/Filter.java       |  14 ++
 .../drill/common/logical/data/Flatten.java      |  14 ++
 .../apache/drill/common/logical/data/Join.java  |  16 ++-
 .../apache/drill/common/logical/data/Limit.java |  18 ++-
 .../common/logical/data/LogicalOperator.java    |  21 +--
 .../logical/data/LogicalOperatorBase.java       |  25 ++--
 .../apache/drill/common/logical/data/Order.java |  17 ++-
 .../drill/common/logical/data/Project.java      |  15 +++
 .../common/logical/data/RunningAggregate.java   |  14 ++
 .../apache/drill/common/logical/data/Scan.java  |  19 ++-
 .../drill/common/logical/data/Segment.java      |  17 ++-
 .../drill/common/logical/data/Sequence.java     |  16 ++-
 .../apache/drill/common/logical/data/Store.java |  18 ++-
 .../drill/common/logical/data/Transform.java    |  15 +++
 .../apache/drill/common/logical/data/Union.java |  25 +++-
 .../drill/common/logical/data/WindowFrame.java  |  17 ++-
 .../data/visitors/AbstractLogicalVisitor.java   |  94 ++++++++++++++
 .../logical/data/visitors/LogicalVisitor.java   |  35 +++++
 .../java/org/apache/drill/storage/Simple.java   |   2 +-
 .../common/src/test/resources/jdbc_plan.json    |  33 +++++
 .../apache/drill/exec/client/DrillClient.java   |   2 +-
 .../exec/exception/OptimizerException.java      |  14 ++
 .../apache/drill/exec/opt/BasicOptimizer.java   | 127 +++++++++++++++++++
 .../drill/exec/physical/base/AbstractStore.java |   2 +-
 .../drill/exec/physical/config/Screen.java      |   2 +-
 .../apache/drill/exec/work/foreman/Foreman.java |   5 +-
 .../exec/client/DrillClientSystemTest.java      |   2 +
 .../drill/exec/opt/BasicOptimizerTest.java      |  24 ++++
 .../impl/TestDistributedFragmentRun.java        |  18 +++
 .../physical/impl/TestSimpleFragmentRun.java    |  92 +++++++-------
 .../src/test/resources/scan_screen_logical.json |  46 +++++++
 .../apache/drill/exec/ref/RecordPointer.java    |  18 +++
 37 files changed, 752 insertions(+), 105 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/1be6bd48/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 628a4e3..6bda406 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,5 @@
 .idea/
 *.iml
 target/
+*.DS_Store
 *~

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/1be6bd48/sandbox/prototype/common/src/main/java/org/apache/drill/common/JSONOptions.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/common/src/main/java/org/apache/drill/common/JSONOptions.java b/sandbox/prototype/common/src/main/java/org/apache/drill/common/JSONOptions.java
index ad4926b..e309c60 100644
--- a/sandbox/prototype/common/src/main/java/org/apache/drill/common/JSONOptions.java
+++ b/sandbox/prototype/common/src/main/java/org/apache/drill/common/JSONOptions.java
@@ -18,7 +18,12 @@
 package org.apache.drill.common;
 
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 
+import com.fasterxml.jackson.core.*;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.drill.common.JSONOptions.De;
 import org.apache.drill.common.JSONOptions.Se;
 import org.apache.drill.common.config.DrillConfig;
@@ -26,12 +31,6 @@ import org.apache.drill.common.exceptions.LogicalPlanParsingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.fasterxml.jackson.core.JsonGenerationException;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonLocation;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.TreeNode;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.SerializerProvider;
@@ -62,6 +61,12 @@ public class JSONOptions {
       throw new LogicalPlanParsingException(String.format("Failure while trying to convert late bound json options to type of %s. Reference was originally located at line %d, column %d.", c.getCanonicalName(), location.getLineNr(), location.getColumnNr()), e);
     }
   }
+
+  public <T> T getListWith(DrillConfig config, TypeReference<T> t) throws IOException {
+      ObjectMapper mapper = config.getMapper();
+      return mapper.treeAsTokens(root).readValueAs(t);
+     // return mapper.treeToValue(root,  mapper.getTypeFactory().constructCollectionType(List.class, c));
+  }
  
   public JsonNode path(String name){
     return root.path(name);

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/1be6bd48/sandbox/prototype/common/src/main/java/org/