You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by pa...@apache.org on 2015/04/01 20:41:19 UTC
[2/3] drill git commit: DRILL-1962: Added unit tests
DRILL-1962: Added unit tests
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/fb4533fe
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/fb4533fe
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/fb4533fe
Branch: refs/heads/master
Commit: fb4533fea25470e297b66b3c1aa320db60c32511
Parents: 565c995
Author: Parth Chandra <pc...@maprtech.com>
Authored: Tue Mar 31 14:23:35 2015 -0700
Committer: Parth Chandra <pc...@maprtech.com>
Committed: Wed Apr 1 11:40:45 2015 -0700
----------------------------------------------------------------------
.../exec/expr/TestSchemaPathMaterialization.java | 12 ++++++++++++
.../test/resources/complex/drill-1962-result.json | 3 +++
.../test/resources/complex/json/multiple/j1.json | 18 ++++++++++++++++++
.../test/resources/complex/json/multiple/j2.json | 18 ++++++++++++++++++
4 files changed, 51 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/fb4533fe/exec/java-exec/src/test/java/org/apache/drill/exec/expr/TestSchemaPathMaterialization.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/expr/TestSchemaPathMaterialization.java b/exec/java-exec/src/test/java/org/apache/drill/exec/expr/TestSchemaPathMaterialization.java
index 66947f1..c2ab18a 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/expr/TestSchemaPathMaterialization.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/expr/TestSchemaPathMaterialization.java
@@ -81,4 +81,16 @@ public class TestSchemaPathMaterialization extends BaseTestQuery {
.baselineValues(1L, 3L)
.go();
}
+
+ @Test //DRILL-1962
+ public void testProjectionMultipleFiles() throws Exception {
+ final String query="select t.oooa.oa.oab.oabc[1].rowValue1 rowValue from dfs.`${WORKING_PATH}/src/test/resources/complex/json/multiple/*.json` t";
+
+ testBuilder()
+ .sqlQuery(query)
+ .unOrdered()
+ .jsonBaselineFile("complex/drill-1962-result.json")
+ .go();
+ }
+
}
http://git-wip-us.apache.org/repos/asf/drill/blob/fb4533fe/exec/java-exec/src/test/resources/complex/drill-1962-result.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/complex/drill-1962-result.json b/exec/java-exec/src/test/resources/complex/drill-1962-result.json
new file mode 100644
index 0000000..d4dac85
--- /dev/null
+++ b/exec/java-exec/src/test/resources/complex/drill-1962-result.json
@@ -0,0 +1,3 @@
+{rowValue:[{"rv1":1,"rv2":2},{"rva1":3,"rva2":4}]}
+{rowValue:[{"rv1":1,"rv2":2},{"rva1":3,"rva2":4}]}
+
http://git-wip-us.apache.org/repos/asf/drill/blob/fb4533fe/exec/java-exec/src/test/resources/complex/json/multiple/j1.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/complex/json/multiple/j1.json b/exec/java-exec/src/test/resources/complex/json/multiple/j1.json
new file mode 100644
index 0000000..8d20176
--- /dev/null
+++ b/exec/java-exec/src/test/resources/complex/json/multiple/j1.json
@@ -0,0 +1,18 @@
+{
+ "id": 2,
+ "oooa": {
+ "oa": {
+ "oab": {
+ "oabc": [
+ {
+ "rowId": 2
+ },
+ {
+ "rowValue1": [{"rv1":1, "rv2":2}, {"rva1":3, "rva2":4}],
+ "rowValue2": [{"rw1":1, "rw2":2}, {"rwa1":3, "rwa2":4}]
+ }
+ ]
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/fb4533fe/exec/java-exec/src/test/resources/complex/json/multiple/j2.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/complex/json/multiple/j2.json b/exec/java-exec/src/test/resources/complex/json/multiple/j2.json
new file mode 100644
index 0000000..8d20176
--- /dev/null
+++ b/exec/java-exec/src/test/resources/complex/json/multiple/j2.json
@@ -0,0 +1,18 @@
+{
+ "id": 2,
+ "oooa": {
+ "oa": {
+ "oab": {
+ "oabc": [
+ {
+ "rowId": 2
+ },
+ {
+ "rowValue1": [{"rv1":1, "rv2":2}, {"rva1":3, "rva2":4}],
+ "rowValue2": [{"rw1":1, "rw2":2}, {"rwa1":3, "rwa2":4}]
+ }
+ ]
+ }
+ }
+ }
+}