calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject calcite git commit: [CALCITE-1877] Move the Pig test data files into target for the test runtime
Date Fri, 07 Jul 2017 18:19:29 GMT
Repository: calcite
Updated Branches:
  refs/heads/master a61098b6a -> dac513ab4


[CALCITE-1877] Move the Pig test data files into target for the test runtime

Closes #493


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

Branch: refs/heads/master
Commit: dac513ab446ad7cfed4be7858721659591134a00
Parents: a61098b
Author: Josh Elser <elserj@apache.org>
Authored: Fri Jul 7 11:51:34 2017 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Jul 7 14:19:12 2017 -0400

----------------------------------------------------------------------
 .../calcite/test/PigRelBuilderStyleTest.java    | 29 ++++++++++----------
 1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/dac513ab/pig/src/test/java/org/apache/calcite/test/PigRelBuilderStyleTest.java
----------------------------------------------------------------------
diff --git a/pig/src/test/java/org/apache/calcite/test/PigRelBuilderStyleTest.java b/pig/src/test/java/org/apache/calcite/test/PigRelBuilderStyleTest.java
index 583b441..605e07b 100644
--- a/pig/src/test/java/org/apache/calcite/test/PigRelBuilderStyleTest.java
+++ b/pig/src/test/java/org/apache/calcite/test/PigRelBuilderStyleTest.java
@@ -75,7 +75,7 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
         .filter(builder.call(GREATER_THAN, builder.field("tc0"), builder.literal("abc"))).build();
     final RelNode optimized = optimizeWithVolcano(node);
     assertScriptAndResults("t", getPigScript(optimized, schema),
-        "t = LOAD 'data.txt"
+        "t = LOAD 'target/data.txt"
             + "' USING PigStorage() AS (tc0:chararray, tc1:chararray);\n"
             + "t = FILTER t BY (tc0 > 'abc');",
         new String[] { "(b,2)", "(c,3)" });
@@ -93,7 +93,7 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
         .build();
     final RelNode optimized = optimizeWithVolcano(node);
     assertScriptAndResults("t", getPigScript(optimized, schema),
-        "t = LOAD 'data.txt"
+        "t = LOAD 'target/data.txt"
             + "' USING PigStorage() AS (tc0:chararray, tc1:chararray);\n"
             + "t = FILTER t BY (tc0 > 'abc') AND (tc1 == '3');",
         new String[] { "(c,3)" });
@@ -109,7 +109,7 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
         .build();
     final RelNode optimized = optimizeWithVolcano(node);
     assertScriptAndResults("t", getPigScript(optimized, schema),
-        "t = LOAD 'data.txt"
+        "t = LOAD 'target/data.txt"
             + "' USING PigStorage() AS (tc0:chararray, tc1:chararray);\n"
             + "t = GROUP t BY (tc0);\n"
             + "t = FOREACH t {\n"
@@ -126,7 +126,7 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
         .aggregate(builder.groupKey(), builder.count(false, "c", builder.field("tc0"))).build();
     final RelNode optimized = optimizeWithVolcano(node);
     assertScriptAndResults("t", getPigScript(optimized, schema),
-        "t = LOAD 'data.txt"
+        "t = LOAD 'target/data.txt"
             + "' USING PigStorage() AS (tc0:chararray, tc1:chararray);\n"
             + "t = GROUP t ALL;\n"
             + "t = FOREACH t {\n"
@@ -145,7 +145,7 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
         .build();
     final RelNode optimized = optimizeWithVolcano(node);
     assertScriptAndResults("t", getPigScript(optimized, schema),
-        "t = LOAD 'data.txt"
+        "t = LOAD 'target/data.txt"
             + "' USING PigStorage() AS (tc0:chararray, tc1:chararray);\n"
             + "t = GROUP t BY (tc0, tc1);\n"
             + "t = FOREACH t {\n"
@@ -163,7 +163,7 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
         .build();
     final RelNode optimized = optimizeWithVolcano(node);
     assertScriptAndResults("t", getPigScript(optimized, schema),
-        "t = LOAD 'data.txt"
+        "t = LOAD 'target/data.txt"
             + "' USING PigStorage() AS (tc0:chararray, tc1:chararray);\n"
             + "t = GROUP t BY (tc0, tc1);\n"
             + "t = FOREACH t {\n"
@@ -183,10 +183,10 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
         .filter(builder.call(GREATER_THAN, builder.field("tc0"), builder.literal("a"))).build();
     final RelNode optimized = optimizeWithVolcano(node);
     assertScriptAndResults("t", getPigScript(optimized, schema),
-        "t = LOAD 'data.txt"
+        "t = LOAD 'target/data.txt"
             + "' USING PigStorage() AS (tc0:chararray, tc1:chararray);\n"
             + "t = FILTER t BY (tc0 > 'a');\n"
-            + "s = LOAD 'data2.txt"
+            + "s = LOAD 'target/data2.txt"
             + "' USING PigStorage() AS (sc0:chararray, sc1:chararray);\n"
             + "t = JOIN t BY tc1 , s BY sc0;",
         new String[] { "(b,2,2,label2)" });
@@ -205,10 +205,10 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
         .build();
     final RelNode optimized = optimizeWithVolcano(node);
     assertScriptAndResults("t", getPigScript(optimized, schema),
-        "t = LOAD 'data.txt"
+        "t = LOAD 'target/data.txt"
             + "' USING PigStorage() AS (tc0:chararray, tc1:chararray);\n"
             + "t = FILTER t BY (tc0 > 'abc');\n"
-            + "s = LOAD 'data2.txt"
+            + "s = LOAD 'target/data2.txt"
             + "' USING PigStorage() AS (sc0:chararray, sc1:chararray);\n"
             + "t = JOIN t BY tc1 LEFT, s BY sc0;\n"
             + "t = GROUP t BY (tc1);\n"
@@ -221,10 +221,10 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
   private SchemaPlus createTestSchema() {
     SchemaPlus result = Frameworks.createRootSchema(false);
     result.add("t",
-        new PigTable("data.txt",
+        new PigTable("target/data.txt",
         new String[] { "tc0", "tc1" }));
     result.add("s",
-        new PigTable("data2.txt",
+        new PigTable("target/data2.txt",
         new String[] { "sc0", "sc1" }));
     return result;
   }
@@ -285,12 +285,13 @@ public class PigRelBuilderStyleTest extends AbstractPigTest {
     System.getProperties().setProperty("pigunit.exectype",
         Util.getLocalTestMode().toString());
     Cluster cluster = PigTest.getCluster();
+    // Put the data files in target/ so they don't dirty the local git checkout
     cluster.update(
         new Path(getFullPathForTestDataFile("data.txt")),
-        new Path("data.txt"));
+        new Path("target/data.txt"));
     cluster.update(
         new Path(getFullPathForTestDataFile("data2.txt")),
-        new Path("data2.txt"));
+        new Path("target/data2.txt"));
   }
 }
 


Mime
View raw message