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 2014/03/16 04:54:57 UTC
svn commit: r1577974 - in /pig/branches/branch-0.12: CHANGES.txt
src/org/apache/pig/newplan/logical/relational/LOGenerate.java
test/e2e/pig/tests/nightly.conf
Author: daijy
Date: Sun Mar 16 03:54:57 2014
New Revision: 1577974
URL: http://svn.apache.org/r1577974
Log:
PIG-3753: LOGenerate generates null schema
Modified:
pig/branches/branch-0.12/CHANGES.txt
pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LOGenerate.java
pig/branches/branch-0.12/test/e2e/pig/tests/nightly.conf
Modified: pig/branches/branch-0.12/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.12/CHANGES.txt?rev=1577974&r1=1577973&r2=1577974&view=diff
==============================================================================
--- pig/branches/branch-0.12/CHANGES.txt (original)
+++ pig/branches/branch-0.12/CHANGES.txt Sun Mar 16 03:54:57 2014
@@ -34,6 +34,8 @@ PIG-3480: TFile-based tmpfile compressio
BUG FIXES
+PIG-3753: LOGenerate generates null schema (daijy)
+
PIG-3782: PushDownForEachFlatten + ColumnMapKeyPrune with user defined schema failing due to incorrect UID assignment (knoguchi via daijy)
PIG-3779: Assert constructs ConstantExpression with null when no comment is given (thedatachef via cheolsoo)
Modified: pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LOGenerate.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LOGenerate.java?rev=1577974&r1=1577973&r2=1577974&view=diff
==============================================================================
--- pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LOGenerate.java (original)
+++ pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LOGenerate.java Sun Mar 16 03:54:57 2014
@@ -146,11 +146,12 @@ public class LOGenerate extends LogicalR
fs.stampFieldSchema();
mergedSchema.addField(new LogicalFieldSchema(fs));
}
- if(mergedSchema.size() == 1 && mergedSchema.getField(0).type == DataType.NULL){
- //this is the use case where a new alias has been specified by user
- mergedSchema.getField(0).type = DataType.BYTEARRAY;
+ for (LogicalFieldSchema fs : mergedSchema.getFields()) {
+ if (fs.type == DataType.NULL){
+ //this is the use case where a new alias has been specified by user
+ fs.type = DataType.BYTEARRAY;
+ }
}
-
} else {
// Merge uid with the exp field schema
Modified: pig/branches/branch-0.12/test/e2e/pig/tests/nightly.conf
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.12/test/e2e/pig/tests/nightly.conf?rev=1577974&r1=1577973&r2=1577974&view=diff
==============================================================================
--- pig/branches/branch-0.12/test/e2e/pig/tests/nightly.conf (original)
+++ pig/branches/branch-0.12/test/e2e/pig/tests/nightly.conf Sun Mar 16 03:54:57 2014
@@ -2173,6 +2173,14 @@ describe A;
store A into ':OUTPATH:';\,
},
+ {
+ 'num' => 2,
+ 'pig' => q\
+A = load 'sample' as (line:chararray);
+B = foreach A generate flatten(STRSPLIT(line)) as (i0, i1, i2);
+describe B;\,
+ 'expected_out_regex' => 'B: {i0: bytearray,i1: bytearray,i2: bytearray}',
+ },
],
},
{