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 2012/03/02 00:39:28 UTC
svn commit: r1295993 - in /pig/branches/branch-0.10: CHANGES.txt
src/org/apache/pig/parser/QueryParser.g
test/org/apache/pig/test/TestSchema.java
Author: daijy
Date: Thu Mar 1 23:39:27 2012
New Revision: 1295993
URL: http://svn.apache.org/viewvc?rev=1295993&view=rev
Log:
PIG-2509: Util.getSchemaFromString fails with java.lang.NullPointerException when a tuple in a bag has no name (as when used in MongoStorage UDF)
Modified:
pig/branches/branch-0.10/CHANGES.txt
pig/branches/branch-0.10/src/org/apache/pig/parser/QueryParser.g
pig/branches/branch-0.10/test/org/apache/pig/test/TestSchema.java
Modified: pig/branches/branch-0.10/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/CHANGES.txt?rev=1295993&r1=1295992&r2=1295993&view=diff
==============================================================================
--- pig/branches/branch-0.10/CHANGES.txt (original)
+++ pig/branches/branch-0.10/CHANGES.txt Thu Mar 1 23:39:27 2012
@@ -168,6 +168,8 @@ PIG-2228: support partial aggregation in
BUG FIXES
+PIG-2509: Util.getSchemaFromString fails with java.lang.NullPointerException when a tuple in a bag has no name (as when used in MongoStorage UDF) (jcoveney via daijy)
+
PIG-2559: Embedded pig in python; invoking sys.exit(0) causes script failure (vivekp via daijy)
PIG-2530: Reusing alias name in nested foreach causes incorrect results (daijy)
Modified: pig/branches/branch-0.10/src/org/apache/pig/parser/QueryParser.g
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/src/org/apache/pig/parser/QueryParser.g?rev=1295993&r1=1295992&r2=1295993&view=diff
==============================================================================
--- pig/branches/branch-0.10/src/org/apache/pig/parser/QueryParser.g (original)
+++ pig/branches/branch-0.10/src/org/apache/pig/parser/QueryParser.g Thu Mar 1 23:39:27 2012
@@ -312,7 +312,9 @@ tuple_type : TUPLE? LEFT_PAREN field_def
-> ^( TUPLE_TYPE field_def_list? )
;
-bag_type : BAG? LEFT_CURLY ( ( identifier COLON )? tuple_type )? RIGHT_CURLY
+bag_type : BAG? LEFT_CURLY ( null_keyword COLON tuple_type? ) RIGHT_CURLY
+ -> ^( BAG_TYPE tuple_type? )
+ | BAG? LEFT_CURLY ( ( identifier COLON )? tuple_type )? RIGHT_CURLY
-> ^( BAG_TYPE identifier? tuple_type? )
;
Modified: pig/branches/branch-0.10/test/org/apache/pig/test/TestSchema.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.10/test/org/apache/pig/test/TestSchema.java?rev=1295993&r1=1295992&r2=1295993&view=diff
==============================================================================
--- pig/branches/branch-0.10/test/org/apache/pig/test/TestSchema.java (original)
+++ pig/branches/branch-0.10/test/org/apache/pig/test/TestSchema.java Thu Mar 1 23:39:27 2012
@@ -882,7 +882,8 @@ public class TestSchema {
"a:double,b:float,t:tuple(x:int,b:bag{t:tuple(a:int,b:float,c:double,x:tuple(z:bag{r:tuple(z:bytearray)}))},z:bytearray)",
"a,b,t:tuple(x,b:bag{t:tuple(a,b,c,x:tuple(z:bag{r:tuple(z)}))},z)",
"a:bag{t:tuple(a:bag{t:tuple(a:bag{t:tuple(a:bag{t:tuple(a:bag{t:tuple(a:bag{t:tuple(a:int,b:float)})})})})})}",
- "a:bag{}"
+ "a:bag{}",
+ "b:{null:(a:int)}"
};
for (String schemaString : schemaStrings) {
Schema s1 = Utils.getSchemaFromString(schemaString);