aboutsummaryrefslogtreecommitdiff
path: root/contrib/storage-jdbc
diff options
context:
space:
mode:
authorJacques Nadeau <jacques@apache.org>2016-01-15 11:45:29 -0800
committerJacques Nadeau <jacques@apache.org>2016-01-20 07:30:00 -0800
commit664d34e3c64c3b52e1ed6347cab9ea27a4722a28 (patch)
tree2be14f3d44bdc393bd1e3db867bb4026143ada8c /contrib/storage-jdbc
parent43414e1e2731c85a52febaaedebfa2f392dd6d2f (diff)
DRILL-4277: Fix for JdbcPrel serialization issue.
This closes #326.
Diffstat (limited to 'contrib/storage-jdbc')
-rw-r--r--contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcPrel.java3
-rw-r--r--contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java9
-rw-r--r--contrib/storage-jdbc/src/test/resources/jdbcmulti/file1.json1
-rw-r--r--contrib/storage-jdbc/src/test/resources/jdbcmulti/file2.json1
4 files changed, 13 insertions, 1 deletions
diff --git a/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcPrel.java b/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcPrel.java
index 2433fbd3d..22894c932 100644
--- a/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcPrel.java
+++ b/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcPrel.java
@@ -80,7 +80,8 @@ public class JdbcPrel extends AbstractRelNode implements Prel {
@Override
public PhysicalOperator getPhysicalOperator(PhysicalPlanCreator creator) throws IOException {
- return new JdbcGroupScan(sql, convention.getPlugin(), rows);
+ JdbcGroupScan output = new JdbcGroupScan(sql, convention.getPlugin(), rows);
+ return creator.addMetadata(this, output);
}
@Override
diff --git a/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java b/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java
index 021ed665d..6d59cfe7c 100644
--- a/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java
+++ b/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithDerbyIT.java
@@ -32,6 +32,15 @@ import static org.junit.Assert.assertEquals;
public class TestJdbcPluginWithDerbyIT extends PlanTestBase {
@Test
+ public void testCrossSourceMultiFragmentJoin() throws Exception {
+ testNoResult("USE derby");
+ testNoResult("SET `planner.slice_target` = 1");
+ String query = "select x.person_id, y.salary from DRILL_DERBY_TEST.PERSON x "
+ + "join dfs.`${WORKING_PATH}/src/test/resources/jdbcmulti/` y on x.person_id = y.person_id ";
+ test(query);
+ }
+
+ @Test
public void validateResult() throws Exception {
// Skip date, time, and timestamp types since derby mangles these due to improper timezone support.
diff --git a/contrib/storage-jdbc/src/test/resources/jdbcmulti/file1.json b/contrib/storage-jdbc/src/test/resources/jdbcmulti/file1.json
new file mode 100644
index 000000000..28752fabc
--- /dev/null
+++ b/contrib/storage-jdbc/src/test/resources/jdbcmulti/file1.json
@@ -0,0 +1 @@
+{person_id: 1, salary: 10} \ No newline at end of file
diff --git a/contrib/storage-jdbc/src/test/resources/jdbcmulti/file2.json b/contrib/storage-jdbc/src/test/resources/jdbcmulti/file2.json
new file mode 100644
index 000000000..7cd6c4a5e
--- /dev/null
+++ b/contrib/storage-jdbc/src/test/resources/jdbcmulti/file2.json
@@ -0,0 +1 @@
+{person_id: 2, salary: 20} \ No newline at end of file