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-2034: Files required for executing python functions are not copied in testEval().
Date Wed, 06 Jan 2016 09:07:32 GMT
Repository: tajo
Updated Branches:
  refs/heads/branch-0.11.1 15f715a1b -> 780bb8121


TAJO-2034: Files required for executing python functions are not copied in testEval().


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

Branch: refs/heads/branch-0.11.1
Commit: 780bb8121a3fc5af201166505da2a407634f5f14
Parents: 15f715a
Author: Jihoon Son <jihoonson@apache.org>
Authored: Wed Jan 6 18:07:02 2016 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Wed Jan 6 18:07:25 2016 +0900

----------------------------------------------------------------------
 CHANGES                                            |  3 +++
 .../org/apache/tajo/engine/eval/ExprTestBase.java  | 17 +++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/780bb812/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index ab1ceb7..605ab5a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -29,6 +29,9 @@ Release 0.11.1 - unreleased
 
   BUG FIXES
 
+    TAJO-2034: Files required for executing python functions are not copied in 
+    testEval(). (jihoon)
+
     TAJO-2037: tajo-storage-hdfs tests occasionally hangs. (jinho)
 
     TAJO-2025: HBASE_LIB/metrics-core-*.jar should be included in CLASSPATH.

http://git-wip-us.apache.org/repos/asf/tajo/blob/780bb812/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
index 7c79724..c0938aa 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
@@ -34,15 +34,19 @@ import org.apache.tajo.engine.codegen.EvalCodeGenerator;
 import org.apache.tajo.engine.codegen.TajoClassLoader;
 import org.apache.tajo.engine.function.FunctionLoader;
 import org.apache.tajo.engine.json.CoreGsonHelper;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.exception.TajoInternalError;
 import org.apache.tajo.function.FunctionSignature;
 import org.apache.tajo.master.exec.QueryExecutor;
-import org.apache.tajo.plan.*;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
+import org.apache.tajo.plan.LogicalOptimizer;
+import org.apache.tajo.plan.LogicalPlan;
+import org.apache.tajo.plan.LogicalPlanner;
+import org.apache.tajo.plan.Target;
 import org.apache.tajo.plan.expr.EvalContext;
 import org.apache.tajo.plan.expr.EvalNode;
+import org.apache.tajo.plan.function.python.PythonScriptEngine;
 import org.apache.tajo.plan.serder.EvalNodeDeserializer;
 import org.apache.tajo.plan.serder.EvalNodeSerializer;
 import org.apache.tajo.plan.serder.PlanProto;
@@ -60,6 +64,7 @@ import org.apache.tajo.util.datetime.DateTimeUtil;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
@@ -276,6 +281,9 @@ public class ExprTestBase {
     EvalContext evalContext = new EvalContext();
 
     try {
+      if (needPythonFileCopy()) {
+        PythonScriptEngine.initPythonScriptEngineFiles();
+      }
       targets = getRawTargets(queryContext, query, condition);
 
       EvalCodeGenerator codegen = null;
@@ -333,6 +341,11 @@ public class ExprTestBase {
     }
   }
 
+  private static boolean needPythonFileCopy() {
+    File contoller = new File(PythonScriptEngine.getControllerPath());
+    return !contoller.exists();
+  }
+
   public static void assertEvalTreeProtoSerDer(OverridableConf context, EvalNode evalNode)
{
     PlanProto.EvalNodeTree converted = EvalNodeSerializer.serialize(evalNode);
     assertEquals(evalNode, EvalNodeDeserializer.deserialize(context, null, converted));


Mime
View raw message