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/02/08 19:24:31 UTC

svn commit: r1566081 - in /pig/trunk: CHANGES.txt src/org/apache/pig/newplan/logical/relational/LOGenerate.java test/e2e/pig/tests/nightly.conf

Author: daijy
Date: Sat Feb  8 18:24:31 2014
New Revision: 1566081

URL: http://svn.apache.org/r1566081
Log:
PIG-3753: LOGenerate generates null schema

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/org/apache/pig/newplan/logical/relational/LOGenerate.java
    pig/trunk/test/e2e/pig/tests/nightly.conf

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1566081&r1=1566080&r2=1566081&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sat Feb  8 18:24:31 2014
@@ -87,6 +87,8 @@ OPTIMIZATIONS
  
 BUG FIXES
 
+PIG-3753: LOGenerate generates null schema (daijy)
+
 PIG-3447: Compiler warning message dropped for CastLineageSetter and others with no enum kind (knoguchi via cheolsoo)
 
 PIG-3627: Json storage : Doesn't work in cases , where other Store Functions (like PigStorage / AvroStorage)

Modified: pig/trunk/src/org/apache/pig/newplan/logical/relational/LOGenerate.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/newplan/logical/relational/LOGenerate.java?rev=1566081&r1=1566080&r2=1566081&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/newplan/logical/relational/LOGenerate.java (original)
+++ pig/trunk/src/org/apache/pig/newplan/logical/relational/LOGenerate.java Sat Feb  8 18:24:31 2014
@@ -144,11 +144,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/trunk/test/e2e/pig/tests/nightly.conf
URL: http://svn.apache.org/viewvc/pig/trunk/test/e2e/pig/tests/nightly.conf?rev=1566081&r1=1566080&r2=1566081&view=diff
==============================================================================
--- pig/trunk/test/e2e/pig/tests/nightly.conf (original)
+++ pig/trunk/test/e2e/pig/tests/nightly.conf Sat Feb  8 18:24:31 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}',
+			},
 		],
 		},
 		{