Updated Branches: refs/heads/execwork [created] b53933f22
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/common/src/test/resources/logical_plan1.json ---------------------------------------------------------------------- diff --git a/sandbox/prototype/common/src/test/resources/logical_plan1.json b/sandbox/prototype/common/src/test/resources/logical_plan1.json deleted file mode 100644 index 2d1de3d..0000000 --- a/sandbox/prototype/common/src/test/resources/logical_plan1.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - head: { - type: "apache_drill_logical_plan", - version: "1", - generator: { - type: "manual", - info: "na" - } - - }, - - - sources: [ - { - type: "text", - name: "local-logs", - files: ["local://logs/*.log"], - compress: "gzip", - line-delimiter: "\n", - record-maker: {type: "first-row", delimiter: ","} - }, - { - type: "mongo", - name: "users", - connection: "mongodb://blue:red@localhost/users" - }, - { - type: "mysql", - name: "mysql", - connection: "jdbc:mysql://localhost/main" - } - - ], - - - query: [ - - { - @id: "log", - op: "sequence", - do: [ - { - op: "scan", - source: "local-logs", - name: "activity" - }, - { - op: "transform", - transforms: [ - { - name: "userId", - expr: "regex('activity.cookie', \"persistent=([^;]*)\")" - }, - - { - name: "session", - expr: "regex('activity.cookie', \"persistent=([^;]*)\")" - } - ] - }, - { - op: "group", - exprs: [ "sessionId", "session" ] - }, - { - op: "order", - orders: [ - { direction: "desc", expr: "timestamp" } - ] - }, - { - op: "transform", - transforms: [{name: "productId", expr: "session" }] - }, - { - op: "filter", - expr: "isNull(productId) && startsWith(path, \"/cart/add\")" - }, - { op: "aggregate", - - } - { - op: "group", - exprs: ["productId"] - }, - { - op: "combine", - name: "productId" - }, - { - op: "nest", - name: "sessions", - exprs: ["productId"] - }, - { - op: "nest", - name: "user" - }, - ] - }, - { - @id: "users", - op: "scan", - source: "mongo", - table: "users", - name: "users" - }, - { - @id: "transactions", - op: "scan", - source: "mysql", - name: "transactions", - table: "purchases" - }, - - { - @id: "usersAndTransactions", - op: "join", - left: "transactions", - right: "users", - conditions: [{left-expr: "userId", right-expr: "id", relationship: "equal"}] - }, - { - @id: "allData" - op: "join", - left: "usersAndTransactions", - right: "log", - conditions: [{left-expr: "userId", right-expr: "id", relationship: "equal"}] - }, - { - op: "project", - input: "7", - exprs: [] - } - ] - - - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/common/src/test/resources/simple_plan.json ---------------------------------------------------------------------- diff --git a/sandbox/prototype/common/src/test/resources/simple_plan.json b/sandbox/prototype/common/src/test/resources/simple_plan.json deleted file mode 100644 index 070290d..0000000 --- a/sandbox/prototype/common/src/test/resources/simple_plan.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - head:{ - type:"apache_drill_logical_plan", - version:"1", - generator:{ - type:"manual", - info:"na" - } - }, - storage:[ - { - type:"text", - name:"logs", - file: "local://logs/*.log", - compress:"gzip", - line-delimiter:"\n", - record-maker:{ - type:"first-row", - delimiter:"," - } - }, - { - type:"mongo", - name:"users", - connection:"mongodb://blue:red@localhost/users" - }, - { - type:"mysql", - name:"mysql", - connection:"jdbc:mysql://localhost/main" - } - ], - query:[ - { - @id:"1", - op:"scan", - memo:"initial_scan", - storageengine:"local-logs", - selection: {} - }, - { - @id:"2", - input:"1", - memo:"transform1", - op:"transform", - transforms:[ - { - ref:"userId", - expr:"regex_like('activity.cookie', \"persistent=([^;]*)\")" - }, - { - ref:"session", - expr:"regex_like('activity.cookie', \"session=([^;]*)\")" - } - ] - }, - { - @id:"3", - input:"2", - memo:"transform2", - op:"transform", - transforms:[ - { - ref:"userId", - expr:"regex_like('activity.cookie', \"persistent=([^;]*)\")" - }, - { - ref:"session", - expr:"regex_like('activity.cookie', \"session=([^;]*)\")" - } - ] - }, - { - @id:"7", - input:"3", - op:"sequence", - do:[ - { - op:"transform", - memo:"seq_transform", - transforms:[ - { - ref:"happy", - expr:"regex_like('ep2', \"dink\")" - } - ] - } - , - { - op:"transform", - memo:"last_transform", - transforms:[ - { - ref:"abc", - expr:"123" - } - ] - } - ] - }, - { - @id:"10", - input:"3", - op:"transform", - memo:"t3", - transforms:[ - { - ref:"happy", - expr:"regex_like('ep2', \"dink\")" - } - ] - }, - { - @id:12, - op:"join", - type: "inner", - left:"7", - right:"10", - conditions: [{relationship:"==", left: "1", right: "1" }] - } - , - { - input: 12, - op: "store", - memo: "output sink", - target: { - file: "console:///stdout" - } - - } - - - ] -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/common/src/test/resources/storage_engine_plan.json ---------------------------------------------------------------------- diff --git a/sandbox/prototype/common/src/test/resources/storage_engine_plan.json b/sandbox/prototype/common/src/test/resources/storage_engine_plan.json index e02c481..efde80d 100644 --- a/sandbox/prototype/common/src/test/resources/storage_engine_plan.json +++ b/sandbox/prototype/common/src/test/resources/storage_engine_plan.json @@ -1,19 +1,18 @@ { head:{ - type:"apache_drill_logical_plan", + type:"APACHE_DRILL_LOGICAL", version:"1", generator:{ type:"manual", info:"na" } }, - storage:[ - { + storage:{ + mock-engine: { type:"mock", - name:"mock-engine", url: "http://www.apache.org/" } - ], + }, query:[ { @id:"1", http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/pom.xml ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/pom.xml b/sandbox/prototype/exec/ref/pom.xml index 2f1a33f..b253f6b 100644 --- a/sandbox/prototype/exec/ref/pom.xml +++ b/sandbox/prototype/exec/ref/pom.xml @@ -24,7 +24,7 @@ <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-core</artifactId> - <version>1.1.0</version> + <version>1.1.1</version> <exclusions> <exclusion> <artifactId>jets3t</artifactId> @@ -36,6 +36,7 @@ </exclusion> </exclusions> </dependency> + <dependency> <groupId>com.carrotsearch</groupId> @@ -43,6 +44,11 @@ <version>0.4.2</version> </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-examples</artifactId> + <version>1.1.1</version> + </dependency> </dependencies> http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rops/OrderROP.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rops/OrderROP.java b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rops/OrderROP.java index 969df71..a692dbf 100644 --- a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rops/OrderROP.java +++ b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rops/OrderROP.java @@ -4,9 +4,9 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import org.apache.drill.common.defs.OrderDef; +import org.apache.drill.common.defs.OrderDef.Direction; import org.apache.drill.common.logical.data.Order; -import org.apache.drill.common.logical.data.Order.Direction; -import org.apache.drill.common.logical.data.Order.Ordering; import org.apache.drill.exec.ref.RecordIterator; import org.apache.drill.exec.ref.RecordPointer; import org.apache.drill.exec.ref.eval.EvaluatorFactory; @@ -33,7 +33,7 @@ public class OrderROP extends AbstractBlockingOperator<Order> { @Override protected void setupEvals(EvaluatorFactory builder) { - Ordering[] orderings = config.getOrderings(); + OrderDef[] orderings = config.getOrderings(); withinConstrained = config.getWithin() != null; if (withinConstrained) { withinExtra = 1; http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ClasspathRSE.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ClasspathRSE.java b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ClasspathRSE.java index d382e38..aa8186d 100644 --- a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ClasspathRSE.java +++ b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ClasspathRSE.java @@ -48,10 +48,6 @@ public class ClasspathRSE extends RSEBase { @JsonTypeName("classpath") public static class ClasspathRSEConfig extends StorageEngineConfigBase { - @JsonCreator - public ClasspathRSEConfig(@JsonProperty("name") String name) { - super(name); - } } public static class ClasspathInputConfig implements ReadEntry{ @@ -66,7 +62,7 @@ public class ClasspathRSE extends RSEBase { @Override public Collection<ReadEntry> getReadEntries(Scan scan) throws IOException { - ClasspathInputConfig c = scan.getSelection().getWith(ClasspathInputConfig.class); + ClasspathInputConfig c = scan.getSelection().getWith(dConfig, ClasspathInputConfig.class); c.rootPath = scan.getOutputReference(); return Collections.singleton((ReadEntry) c); } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ConsoleRSE.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ConsoleRSE.java b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ConsoleRSE.java index 76061ac..1570ea9 100644 --- a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ConsoleRSE.java +++ b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/ConsoleRSE.java @@ -24,19 +24,19 @@ import org.apache.drill.common.logical.StorageEngineConfigBase; import org.apache.drill.common.logical.data.Store; import org.apache.drill.exec.ref.rops.DataWriter.ConverterType; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; public class ConsoleRSE extends RSEBase { static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ConsoleRSE.class); - + + private final DrillConfig dConfig; + public static enum Pipe { STD_OUT, STD_ERR }; - public ConsoleRSE(ConsoleRSEConfig engineConfig, DrillConfig config){ - + public ConsoleRSE(ConsoleRSEConfig engineConfig, DrillConfig dConfig){ + this.dConfig = dConfig; } public static class ConsoleOutputConfig { @@ -44,21 +44,15 @@ public class ConsoleRSE extends RSEBase { public ConverterType type = ConverterType.JSON; } - @JsonTypeName("console") - public static class ConsoleRSEConfig extends StorageEngineConfigBase { - - @JsonCreator - public ConsoleRSEConfig(@JsonProperty("name") String name) { - super(name); - } - } + @JsonTypeName("console") public static class ConsoleRSEConfig extends StorageEngineConfigBase {} + public boolean supportsWrite() { return true; } @Override public RecordRecorder getWriter(Store store) { - ConsoleOutputConfig config = store.getTarget().getWith(ConsoleOutputConfig.class); + ConsoleOutputConfig config = store.getTarget().getWith(dConfig, ConsoleOutputConfig.class); OutputStream out = config.pipe == Pipe.STD_OUT ? System.out : System.err; return new OutputStreamWriter(out, config.type, false); } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/FileSystemRSE.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/FileSystemRSE.java b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/FileSystemRSE.java index 06a31f5..522191b 100644 --- a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/FileSystemRSE.java +++ b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/FileSystemRSE.java @@ -67,9 +67,9 @@ public class FileSystemRSE extends RSEBase { @JsonTypeName("fs") public static class FileSystemRSEConfig extends StorageEngineConfigBase { private String root; + @JsonCreator - public FileSystemRSEConfig(@JsonProperty("name") String name, @JsonProperty("root") String root) { - super(name); + public FileSystemRSEConfig(@JsonProperty("root") String root) { this.root = root; } } @@ -112,7 +112,7 @@ public class FileSystemRSE extends RSEBase { @Override public RecordRecorder getWriter(Store store) throws IOException { - FileSystemOutputConfig config = store.getTarget().getWith(FileSystemOutputConfig.class); + FileSystemOutputConfig config = store.getTarget().getWith(dConfig, FileSystemOutputConfig.class); OutputStream out = fs.create(new Path(basePath, config.file)); return new OutputStreamWriter(out, config.type, true); } @@ -120,7 +120,7 @@ public class FileSystemRSE extends RSEBase { @Override public Collection<ReadEntry> getReadEntries(Scan scan) throws IOException { Set<ReadEntry> s = new HashSet<ReadEntry>(); - for(FileSpec f : scan.getSelection().getWith(FileSystemInputConfig.class).files){ + for(FileSpec f : scan.getSelection().getWith(dConfig, FileSystemInputConfig.class).files){ s.add(new FSEntry(f, scan.getOutputReference())); } return s; http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/QueueRSE.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/QueueRSE.java b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/QueueRSE.java index 623e752..9a0a132 100644 --- a/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/QueueRSE.java +++ b/sandbox/prototype/exec/ref/src/main/java/org/apache/drill/exec/ref/rse/QueueRSE.java @@ -31,8 +31,6 @@ import org.apache.drill.exec.ref.RecordPointer; import org.apache.drill.exec.ref.RunOutcome.OutcomeType; import org.apache.drill.exec.ref.exceptions.SetupException; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; public class QueueRSE extends RSEBase { @@ -50,13 +48,7 @@ public class QueueRSE extends RSEBase { return sinkQueues.get(number); } - @JsonTypeName("queue") - public static class QueueRSEConfig extends StorageEngineConfigBase { - @JsonCreator - public QueueRSEConfig(@JsonProperty("name") String name) { - super(name); - } - } + @JsonTypeName("queue") public static class QueueRSEConfig extends StorageEngineConfigBase {} public static class QueueOutputInfo{ public int number; @@ -69,7 +61,7 @@ public class QueueRSE extends RSEBase { @Override public RecordRecorder getWriter(Store store) throws IOException { - QueueOutputInfo config = store.getTarget().getWith(QueueOutputInfo.class); + QueueOutputInfo config = store.getTarget().getWith(dConfig, QueueOutputInfo.class); Queue<Object> q = dConfig.getQueue(config.number); return new QueueRecordRecorder(q); } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/test/java/org/apache/drill/exec/ref/RunSimplePlan.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/test/java/org/apache/drill/exec/ref/RunSimplePlan.java b/sandbox/prototype/exec/ref/src/test/java/org/apache/drill/exec/ref/RunSimplePlan.java index e15c568..110e655 100644 --- a/sandbox/prototype/exec/ref/src/test/java/org/apache/drill/exec/ref/RunSimplePlan.java +++ b/sandbox/prototype/exec/ref/src/test/java/org/apache/drill/exec/ref/RunSimplePlan.java @@ -46,4 +46,28 @@ public class RunSimplePlan{ assertEquals(outcomes.size(), 1); assertEquals(outcomes.iterator().next().records, 2); } + + @Test + public void joinPlan() throws Exception{ + DrillConfig config = DrillConfig.create(); + LogicalPlan plan = LogicalPlan.parse(config, Files.toString(FileUtils.getResourceAsFile("/simple_join.json"), Charsets.UTF_8)); + IteratorRegistry ir = new IteratorRegistry(); + ReferenceInterpreter i = new ReferenceInterpreter(plan, ir, new BasicEvaluatorFactory(ir), new RSERegistry(config)); + i.setup(); + Collection<RunOutcome> outcomes = i.run(); + assertEquals(outcomes.size(), 1); + assertEquals(outcomes.iterator().next().outcome, RunOutcome.OutcomeType.SUCCESS); + } + + @Test + public void flattenPlan() throws Exception{ + DrillConfig config = DrillConfig.create(); + LogicalPlan plan = LogicalPlan.parse(config, Files.toString(FileUtils.getResourceAsFile("/simple_plan_flattened.json"), Charsets.UTF_8)); + IteratorRegistry ir = new IteratorRegistry(); + ReferenceInterpreter i = new ReferenceInterpreter(plan, ir, new BasicEvaluatorFactory(ir), new RSERegistry(config)); + i.setup(); + Collection<RunOutcome> outcomes = i.run(); + assertEquals(outcomes.size(), 1); + assertEquals(outcomes.iterator().next().outcome, RunOutcome.OutcomeType.SUCCESS); + } } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/test/resources/simple_join.json ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/test/resources/simple_join.json b/sandbox/prototype/exec/ref/src/test/resources/simple_join.json index 37e2a61..ba078d5 100644 --- a/sandbox/prototype/exec/ref/src/test/resources/simple_join.json +++ b/sandbox/prototype/exec/ref/src/test/resources/simple_join.json @@ -1,27 +1,17 @@ { head: { - type: "apache_drill_logical_plan", + type: "APACHE_DRILL_LOGICAL", version: "1", generator: { type: "manual", info: "na" } }, - storage:[ - { - type:"console", - name:"console" - }, - { - type:"fs", - name:"fs1", - root:"file:///" - }, - { - type:"classpath", - name:"cp" - } - ], + storage: { + console: {type:"console"}, + fs1: {type:"fs", root:"file:///"}, + cp: {type:"classpath"} + }, query: [ { @id: 1, @@ -61,7 +51,7 @@ }, { input: 3, - op: "write", + op: "store", memo: "output sink", storageengine: "console", target: {pipe: "STD_OUT"} http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/test/resources/simple_plan.json ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/test/resources/simple_plan.json b/sandbox/prototype/exec/ref/src/test/resources/simple_plan.json index 34297b4..0f38476 100644 --- a/sandbox/prototype/exec/ref/src/test/resources/simple_plan.json +++ b/sandbox/prototype/exec/ref/src/test/resources/simple_plan.json @@ -1,27 +1,17 @@ { head:{ - type:"apache_drill_logical_plan", + type:"APACHE_DRILL_LOGICAL", version:"1", generator:{ type:"manual", info:"na" } }, - storage:[ - { - type:"console", - name:"console" - }, - { - type:"fs", - name:"fs1", - root:"file:///" - }, - { - type:"classpath", - name:"cp" - } - ], + storage:{ + console: {type: "console"}, + fs1: {type: "fs", root:"file:///"}, + cp: {type: "classpath"} + }, query:[ { op:"sequence", @@ -64,7 +54,7 @@ { op: "order", orderings: [ - {order: "desc", expr: "donuts.ppu" } + {order: "DESC", expr: "donuts.ppu" } ] }, { http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/exec/ref/src/test/resources/simple_plan_flattened.json ---------------------------------------------------------------------- diff --git a/sandbox/prototype/exec/ref/src/test/resources/simple_plan_flattened.json b/sandbox/prototype/exec/ref/src/test/resources/simple_plan_flattened.json index 7e38b4e..1601b4a 100644 --- a/sandbox/prototype/exec/ref/src/test/resources/simple_plan_flattened.json +++ b/sandbox/prototype/exec/ref/src/test/resources/simple_plan_flattened.json @@ -1,21 +1,17 @@ { head:{ - type:"apache_drill_logical_plan", + type:"APACHE_DRILL_LOGICAL", version:"1", generator:{ type:"manual", info:"na" } }, - sources:[ - { - type:"json", - name:"donuts-json", - files:[ - "src/test/resources/donuts.json" - ] - } - ], + storage:{ + console: {type:"console"}, + fs1: {type:"fs", root:"file:///"}, + cp: {type:"classpath"} + }, query:[ { op:"sequence", @@ -24,8 +20,11 @@ op: "scan", memo: "initial_scan", ref: "donuts", - source: "donuts-json", - selection: {data: "activity"} + storageengine: "cp", + selection: { + path: "/donuts.json", + type: "JSON" + } }, { op: "transform", @@ -44,9 +43,10 @@ drop: 1 }, { - op: "write", + op: "store", memo: "output sink", - file: "console:///stdout" + storageengine: "console", + target: {pipe: "STD_OUT"} } ] } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/jdbc/Driver.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/jdbc/Driver.java b/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/jdbc/Driver.java index 0a0594c..ceb2027 100644 --- a/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/jdbc/Driver.java +++ b/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/jdbc/Driver.java @@ -73,7 +73,7 @@ public class Driver extends UnregisteredDriver { MapSchema.create(connection, rootSchema, schemaName); connection.setSchema(schemaName); - final ClasspathRSEConfig rseConfig = new ClasspathRSEConfig("donuts-json"); + final ClasspathRSEConfig rseConfig = new ClasspathRSEConfig(); final ClasspathInputConfig inputConfig = new ClasspathInputConfig(); inputConfig.path = "/donuts.json"; inputConfig.type = ConverterType.JSON; http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillImplementor.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillImplementor.java b/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillImplementor.java index 445b118..29c4d12 100644 --- a/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillImplementor.java +++ b/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillImplementor.java @@ -43,7 +43,7 @@ public class DrillImplementor { public DrillImplementor() { final ObjectNode headNode = mapper.createObjectNode(); rootNode.put("head", headNode); - headNode.put("type", "apache_drill_logical_plan"); + headNode.put("type", "APACHE_DRILL_LOGICAL"); headNode.put("version", "1"); final ObjectNode generatorNode = mapper.createObjectNode(); @@ -53,21 +53,19 @@ public class DrillImplementor { // TODO: populate sources based on the sources of scans that occur in // the query - final ArrayNode sourcesNode = mapper.createArrayNode(); + final ObjectNode sourcesNode = mapper.createObjectNode(); rootNode.put("storage", sourcesNode); // input file source { final ObjectNode sourceNode = mapper.createObjectNode(); - sourceNode.put("name", "donuts-json"); sourceNode.put("type", "classpath"); - sourcesNode.add(sourceNode); + sourcesNode.put("donuts-json", sourceNode); } { final ObjectNode sourceNode = mapper.createObjectNode(); - sourceNode.put("name", "queue"); sourceNode.put("type", "queue"); - sourcesNode.add(sourceNode); + sourcesNode.put("queue", sourceNode); } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2a6e1b33/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillScan.java ---------------------------------------------------------------------- diff --git a/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillScan.java b/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillScan.java index c18baaf..2e2849a 100644 --- a/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillScan.java +++ b/sandbox/prototype/sqlparser/src/main/java/org/apache/drill/optiq/DrillScan.java @@ -38,7 +38,8 @@ public class DrillScan extends TableAccessRelBase implements DrillRel { node.put("op", "scan"); node.put("memo", "initial_scan"); node.put("ref", "donuts"); - node.put("storageengine", drillTable.storageEngineConfig.getName()); + final ObjectNode engines = implementor.mapper.createObjectNode(); + node.put("storageengine", "donuts-json"); node.put("selection", implementor.mapper.convertValue(drillTable.selection, JsonNode.class)); implementor.add(node); }
