tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [1/2] tajo git commit: TAJO-1449: TestSelectQuery.testExplainSelect() fails. (jihoon)
Date Wed, 25 Mar 2015 01:26:56 GMT
Repository: tajo
Updated Branches:
  refs/heads/index_support 12846ccae -> db292ac7d


TAJO-1449: TestSelectQuery.testExplainSelect() fails. (jihoon)

Closes #460


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

Branch: refs/heads/index_support
Commit: 12f30c5856e46d56e217ef0d3f48accc878600f5
Parents: 3e9a2dd
Author: Jihoon Son <jihoonson@apache.org>
Authored: Wed Mar 25 10:25:15 2015 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Wed Mar 25 10:25:42 2015 +0900

----------------------------------------------------------------------
 CHANGES                                            |  2 ++
 .../tajo/engine/codegen/TajoGeneratorAdapter.java  |  6 ------
 .../reporter/MetricsFileScheduledReporter.java     |  5 +++--
 .../apache/tajo/engine/query/TestSelectQuery.java  | 17 +++++++++++++----
 .../TestSelectQuery/testExplainSelect.result       |  2 +-
 5 files changed, 19 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/12f30c58/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f573550..59ca1d5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -44,6 +44,8 @@ Release 0.11.0 - unreleased
 
   BUG FIXES
 
+    TAJO-1449: TestSelectQuery.testExplainSelect() fails. (jihoon)
+
     TAJO-1396: Unexpected IllegalMonitorStateException can be thrown 
     in QueryInProgress. (Contributed by navis. Committed by jinho)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/12f30c58/tajo-core/src/main/java/org/apache/tajo/engine/codegen/TajoGeneratorAdapter.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/codegen/TajoGeneratorAdapter.java
b/tajo-core/src/main/java/org/apache/tajo/engine/codegen/TajoGeneratorAdapter.java
index 21cad7e..8c45fae 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/codegen/TajoGeneratorAdapter.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/codegen/TajoGeneratorAdapter.java
@@ -885,12 +885,6 @@ class TajoGeneratorAdapter {
     return varId;
   }
 
-  private int getCurVarIdAndIncrease(TajoDataTypes.DataType type) {
-    int varId = nextVarId;
-    nextVarId += getWordSize(type);
-    return varId;
-  }
-
   public int store(TajoDataTypes.DataType type) {
     int varId = nextVarId;
     nextVarId += TajoGeneratorAdapter.getWordSize(type);

http://git-wip-us.apache.org/repos/asf/tajo/blob/12f30c58/tajo-core/src/main/java/org/apache/tajo/util/metrics/reporter/MetricsFileScheduledReporter.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/util/metrics/reporter/MetricsFileScheduledReporter.java
b/tajo-core/src/main/java/org/apache/tajo/util/metrics/reporter/MetricsFileScheduledReporter.java
index 386fb79..e853dc8 100644
--- a/tajo-core/src/main/java/org/apache/tajo/util/metrics/reporter/MetricsFileScheduledReporter.java
+++ b/tajo-core/src/main/java/org/apache/tajo/util/metrics/reporter/MetricsFileScheduledReporter.java
@@ -20,6 +20,7 @@ package org.apache.tajo.util.metrics.reporter;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.io.IOUtils;
 
 import java.io.*;
 
@@ -47,11 +48,11 @@ public class MetricsFileScheduledReporter extends MetricsStreamScheduledReporter
           LOG.warn("Can't create dir for tajo metrics:" + parentFile.getAbsolutePath());
         }
       }
-      this.setOutput(new FileOutputStream(fileName, true));
+      this.output = new FileOutputStream(fileName, true);
       this.setDateFormat(null);
     } catch (FileNotFoundException e) {
       LOG.warn("Can't open metrics file:" + fileName);
-      this.close();
+      IOUtils.cleanup(LOG, this);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/12f30c58/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
index b54d7ea..176d44e 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
@@ -99,9 +99,14 @@ public class TestSelectQuery extends QueryTestCaseBase {
   @Test
   public final void testExplainSelect() throws Exception {
     // explain select l_orderkey, l_partkey from lineitem;
-    ResultSet res = executeQuery();
-    assertResultSet(res);
-    cleanupQuery(res);
+    testingCluster.getConfiguration().set(ConfVars.$TEST_PLAN_SHAPE_FIX_ENABLED.varname,
"true");
+    try {
+      ResultSet res = executeQuery();
+      assertResultSet(res);
+      cleanupQuery(res);
+    } finally {
+      testingCluster.getConfiguration().set(ConfVars.$TEST_PLAN_SHAPE_FIX_ENABLED.varname,
"false");
+    }
   }
 
   @Test
@@ -117,7 +122,11 @@ public class TestSelectQuery extends QueryTestCaseBase {
   public final void testExplainSelectPhysical() throws Exception {
     // Enable this option to fix the shape of the generated plans.
     testingCluster.getConfiguration().set(ConfVars.$TEST_PLAN_SHAPE_FIX_ENABLED.varname,
"true");
-    runSimpleTests();
+    try {
+      runSimpleTests();
+    } finally {
+      testingCluster.getConfiguration().set(ConfVars.$TEST_PLAN_SHAPE_FIX_ENABLED.varname,
"false");
+    }
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/tajo/blob/12f30c58/tajo-core/src/test/resources/results/TestSelectQuery/testExplainSelect.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestSelectQuery/testExplainSelect.result
b/tajo-core/src/test/resources/results/TestSelectQuery/testExplainSelect.result
index 2dc746d..7a1520a 100644
--- a/tajo-core/src/test/resources/results/TestSelectQuery/testExplainSelect.result
+++ b/tajo-core/src/test/resources/results/TestSelectQuery/testExplainSelect.result
@@ -3,4 +3,4 @@ explain
 SCAN(0) on default.lineitem
   => target list: default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4)
   => out schema: {(2) default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4)}
-  => in schema: {(16) default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4),
default.lineitem.l_suppkey (INT4), default.lineitem.l_linenumber (INT4), default.lineitem.l_quantity
(FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_discount (FLOAT8),
default.lineitem.l_tax (FLOAT8), default.lineitem.l_returnflag (TEXT), default.lineitem.l_linestatus
(TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_receiptdate
(TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_comment
(TEXT)}
\ No newline at end of file
+  => in schema: {(16) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate
(TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber
(INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey
(INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag
(TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode
(TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)}
\ No newline at end of file


Mime
View raw message