tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject tajo git commit: TAJO-2142: Temporarily disable NOT IN subquery.
Date Thu, 05 May 2016 05:42:22 GMT
Repository: tajo
Updated Branches:
  refs/heads/master c156e5c93 -> 0a2535e67


TAJO-2142: Temporarily disable NOT IN subquery.

Closes #1010


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/0a2535e6
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/0a2535e6
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/0a2535e6

Branch: refs/heads/master
Commit: 0a2535e677e192574221aa0547b4cbc1027a7c8b
Parents: c156e5c
Author: Jihoon Son <jihoonson@apache.org>
Authored: Thu May 5 14:41:36 2016 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Thu May 5 14:41:36 2016 +0900

----------------------------------------------------------------------
 CHANGES                                                        | 2 ++
 .../test/java/org/apache/tajo/engine/query/TestInSubquery.java | 6 ++++++
 .../apache/tajo/plan/rewrite/rules/InSubqueryRewriteRule.java  | 5 +++++
 3 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/0a2535e6/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 4838614..31fbd2a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -254,6 +254,8 @@ Release 0.12.0 - unreleased
 
   TASKS
 
+    TAJO-2142: Temporarily disable NOT IN subquery. (jihoon)
+
     TAJO-2088: Change QueryTestCaseBase.runSimpleTests() to return a set of 
     TajoResultSetBase. (jihoon)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/0a2535e6/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInSubquery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInSubquery.java
b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInSubquery.java
index 41c0bd5..9ef84ba 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInSubquery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInSubquery.java
@@ -21,6 +21,7 @@ package org.apache.tajo.engine.query;
 import org.apache.tajo.IntegrationTest;
 import org.apache.tajo.NamedTest;
 import org.apache.tajo.exception.NotImplementedException;
+import org.apache.tajo.exception.TajoException;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -170,4 +171,9 @@ public class TestInSubquery extends TestJoinQuery {
     // (select l_partkey from lineitem where l_linenumber in (1, 3, 5, 7, 9))
     runSimpleTests();
   }
+
+  @Test(expected = NotImplementedException.class)
+  public final void testNotInSubquery() throws TajoException {
+    executeString("select n_name from nation where n_nationkey not in (select r_regionkey
from region)");
+  }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/0a2535e6/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/InSubqueryRewriteRule.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/InSubqueryRewriteRule.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/InSubqueryRewriteRule.java
index 979c9d7..eb617e6 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/InSubqueryRewriteRule.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/InSubqueryRewriteRule.java
@@ -22,7 +22,9 @@ import com.google.common.base.Preconditions;
 import org.apache.tajo.algebra.JoinType;
 import org.apache.tajo.catalog.Schema;
 import org.apache.tajo.catalog.SchemaUtil;
+import org.apache.tajo.exception.NotImplementedException;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.exception.TajoRuntimeException;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlan.QueryBlock;
 import org.apache.tajo.plan.Target;
@@ -113,6 +115,9 @@ public class InSubqueryRewriteRule implements LogicalPlanRewriteRule {
 
         // 2. create join
         JoinType joinType = eachIn.isNot() ? JoinType.LEFT_ANTI : JoinType.LEFT_SEMI;
+        if (joinType == JoinType.LEFT_ANTI) {
+          throw new TajoRuntimeException(new NotImplementedException("Not-in subquery"));
+        }
         JoinNode joinNode = new JoinNode(plan.newPID());
         joinNode.init(joinType, baseRelation, subqueryEval.getSubQueryNode());
         joinNode.setJoinQual(buildJoinCondition(leftEval, subqueryEval.getSubQueryNode()));


Mime
View raw message