You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2015/11/18 04:34:29 UTC

incubator-zeppelin git commit: ZEPPELIN-427: Upgrade to Apache TAJO 0.11.0

Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master c2cbafd1d -> d9ac131e1


ZEPPELIN-427: Upgrade to Apache TAJO 0.11.0

I bumped up Tajo to 0.11.0. And I enabled ```cancel()``` because Tajo supports it since 0.11.0 release. For the reference, this patch ran successfully on my Tajo testing cluster.

Author: JaeHwa Jung <bl...@apache.org>

Closes #439 from blrunner/ZEPPELIN-427 and squashes the following commits:

295e59e [JaeHwa Jung] Remove unused packages
8346f90 [JaeHwa Jung] Add more unit test cases
2b81d4f [JaeHwa Jung] Bump up Tajo to 0.11.0


Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/d9ac131e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/d9ac131e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/d9ac131e

Branch: refs/heads/master
Commit: d9ac131e1301cf8fbf8946cd5be5b6fd84d6b184
Parents: c2cbafd
Author: JaeHwa Jung <bl...@apache.org>
Authored: Tue Nov 17 10:37:00 2015 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Wed Nov 18 12:34:52 2015 +0900

----------------------------------------------------------------------
 tajo/pom.xml                                    |  2 +-
 .../apache/zeppelin/tajo/TajoInterpreter.java   | 22 ++++++++--------
 .../zeppelin/tajo/TajoInterpreterTest.java      | 27 ++++++++++----------
 3 files changed, 24 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d9ac131e/tajo/pom.xml
----------------------------------------------------------------------
diff --git a/tajo/pom.xml b/tajo/pom.xml
index c08a0db..cf4311f 100644
--- a/tajo/pom.xml
+++ b/tajo/pom.xml
@@ -33,7 +33,7 @@
   <url>http://www.apache.org</url>
 
   <properties>
-    <tajo.version>0.10.0</tajo.version>
+    <tajo.version>0.11.0</tajo.version>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d9ac131e/tajo/src/main/java/org/apache/zeppelin/tajo/TajoInterpreter.java
----------------------------------------------------------------------
diff --git a/tajo/src/main/java/org/apache/zeppelin/tajo/TajoInterpreter.java b/tajo/src/main/java/org/apache/zeppelin/tajo/TajoInterpreter.java
index 716a32a..f896061 100644
--- a/tajo/src/main/java/org/apache/zeppelin/tajo/TajoInterpreter.java
+++ b/tajo/src/main/java/org/apache/zeppelin/tajo/TajoInterpreter.java
@@ -165,18 +165,16 @@ public class TajoInterpreter extends Interpreter {
 
   @Override
   public void cancel(InterpreterContext context) {
-    // Currently, Tajo doesn't provide JDBC cancel method. It will be implemented in
-    // Tajo 0.11.0 version. You can find related issue progress at TAJO-751.
-//    if (statement != null) {
-//      try {
-//        statement.cancel();
-//      }
-//      catch (SQLException ex) {
-//      }
-//      finally {
-//        statement = null;
-//      }
-//    }
+    if (statement != null) {
+      try {
+        statement.cancel();
+      }
+      catch (SQLException ex) {
+      }
+      finally {
+        statement = null;
+      }
+    }
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d9ac131e/tajo/src/test/java/org/apache/zeppelin/tajo/TajoInterpreterTest.java
----------------------------------------------------------------------
diff --git a/tajo/src/test/java/org/apache/zeppelin/tajo/TajoInterpreterTest.java b/tajo/src/test/java/org/apache/zeppelin/tajo/TajoInterpreterTest.java
index abe1ca6..4390d58 100644
--- a/tajo/src/test/java/org/apache/zeppelin/tajo/TajoInterpreterTest.java
+++ b/tajo/src/test/java/org/apache/zeppelin/tajo/TajoInterpreterTest.java
@@ -18,19 +18,16 @@
 
 package org.apache.zeppelin.tajo;
 
-import com.google.gson.JsonParseException;
 import org.apache.tajo.jdbc.TajoDriver;
 import org.apache.zeppelin.interpreter.InterpreterResult;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
+import java.lang.reflect.Constructor;
 import java.util.Properties;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.*;
 
 /**
  * Tajo interpreter unit tests
@@ -45,21 +42,20 @@ public class TajoInterpreterTest {
   }
 
   @Test
-  public void test() {
+  public void testTajoInterpreter() throws Exception {
     TajoInterpreter t = new TesterTajoInterpreter(new Properties());
     t.open();
 
-    Class clazz;
-    try {
-      clazz = Class.forName(t.TAJO_DRIVER_NAME);
-    } catch (ClassNotFoundException e) {
-      e.printStackTrace();
-      throw new JsonParseException(e);
-    }
-
     // check tajo jdbc driver
+    Class clazz = Class.forName(t.TAJO_DRIVER_NAME);
     assertNotNull(clazz);
 
+    Constructor cons = clazz.getConstructor(new Class[]{});
+
+    TajoDriver driver = (TajoDriver) cons.newInstance();
+    assertTrue(driver.acceptsURL("jdbc:tajo:"));
+    assertFalse(driver.acceptsURL("jdbc:taju:"));
+
     // simple select test
     InterpreterResult result = t.interpret("select * from t", null);
     assertEquals(result.type(), InterpreterResult.Type.TABLE);
@@ -67,6 +63,9 @@ public class TajoInterpreterTest {
     // explain test
     result = t.interpret("explain select * from t", null);
     assertEquals(result.type(), InterpreterResult.Type.TEXT);
+
     t.close();
   }
+
+
 }
\ No newline at end of file