You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2013/04/12 02:29:37 UTC
svn commit: r1467150 - in /pig/branches/branch-0.11: CHANGES.txt
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java
test/org/apache/pig/test/TestMRCompiler.java
Author: daijy
Date: Fri Apr 12 00:29:37 2013
New Revision: 1467150
URL: http://svn.apache.org/r1467150
Log:
PIG-3267: HCatStorer fail in limit query
Modified:
pig/branches/branch-0.11/CHANGES.txt
pig/branches/branch-0.11/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java
pig/branches/branch-0.11/test/org/apache/pig/test/TestMRCompiler.java
Modified: pig/branches/branch-0.11/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.11/CHANGES.txt?rev=1467150&r1=1467149&r2=1467150&view=diff
==============================================================================
--- pig/branches/branch-0.11/CHANGES.txt (original)
+++ pig/branches/branch-0.11/CHANGES.txt Fri Apr 12 00:29:37 2013
@@ -55,6 +55,8 @@ OPTIMIZATIONS
BUG FIXES
+PIG-3267: HCatStorer fail in limit query (daijy)
+
PIG-3252: AvroStorage gives wrong schema for schemas with named records (mwagner via cheolsoo)
PIG-3132: NPE when illustrating a relation with HCatLoader (daijy)
Modified: pig/branches/branch-0.11/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.11/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java?rev=1467150&r1=1467149&r2=1467150&view=diff
==============================================================================
--- pig/branches/branch-0.11/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java (original)
+++ pig/branches/branch-0.11/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java Fri Apr 12 00:29:37 2013
@@ -196,6 +196,7 @@ public class POStore extends PhysicalOpe
public void setSFile(FileSpec sFile) {
this.sFile = sFile;
+ storer = null;
}
public void setInputSpec(FileSpec lFile) {
Modified: pig/branches/branch-0.11/test/org/apache/pig/test/TestMRCompiler.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.11/test/org/apache/pig/test/TestMRCompiler.java?rev=1467150&r1=1467149&r2=1467150&view=diff
==============================================================================
--- pig/branches/branch-0.11/test/org/apache/pig/test/TestMRCompiler.java (original)
+++ pig/branches/branch-0.11/test/org/apache/pig/test/TestMRCompiler.java Fri Apr 12 00:29:37 2013
@@ -123,7 +123,8 @@ import org.junit.runner.RunWith;
"testSortedDistinctInForeach",
"testUDFInMergedCoGroup",
"testUDFInMergedJoin",
- "testSchemaInStoreForDistinctLimit" })
+ "testSchemaInStoreForDistinctLimit",
+ "testStorerLimit"})
public class TestMRCompiler {
static MiniCluster cluster = MiniCluster.buildCluster();
@@ -1208,4 +1209,25 @@ public class TestMRCompiler {
Utils.getSchemaFromString("a : int,b :float ,c : int")
);
}
+
+ //PIG-2146
+ @Test
+ public void testStorerLimit() throws Exception {
+ // test if the POStore in the 1st mr plan
+ // use the right StoreFunc
+ String query = "a = load 'input1';" +
+ "b = limit a 10;" +
+ "store b into 'output' using " + PigStorageNoDefCtor.class.getName() + "(',');";
+
+ PhysicalPlan pp = Util.buildPp(pigServer, query);
+ MROperPlan mrPlan = Util.buildMRPlan(pp, pc);
+
+ LimitAdjuster la = new LimitAdjuster(mrPlan, pc);
+ la.visit();
+ la.adjust();
+
+ MapReduceOper firstMrOper = mrPlan.getRoots().get(0);
+ POStore store = (POStore)firstMrOper.reducePlan.getLeaves().get(0);
+ assertEquals(store.getStoreFunc().getClass().getName(), "org.apache.pig.impl.io.InterStorage");
+ }
}
\ No newline at end of file