Review Board 1.7.22


PIG-3414 Utils.getSchemaFromString() silently returns a wrong result when a comma is missing in the schema definition

Review Request #13551 - Created Aug. 14, 2013 and submitted

Cheolsoo Park
PIG-3414
Reviewers
pig
pig-git
I updated the schema parsing grammar, so an invalid schema string throws a parser exception rather than silently returns partial schema.

While running the unit tests, I found and fixed bugs in the following unit tests:
TestSchema
TestSchemaTuple
TestPOCast
Added a new test case to TestSchema.

All the unit tests pass.
src/org/apache/pig/parser/QueryParser.g
Revision 6040389 New Change
[20] 205 lines
[+20]
206
}
206
}
207

    
   
207

   
208
query : statement* EOF -> ^( QUERY statement* )
208
query : statement* EOF -> ^( QUERY statement* )
209
;
209
;
210

    
   
210

   

    
   
211
schema: field_def_list EOF

    
   
212
;

    
   
213

   
211
// STATEMENTS
214
// STATEMENTS
212

    
   
215

   
213
statement : SEMI_COLON!
216
statement : SEMI_COLON!
214
          | general_statement SEMI_COLON!
217
          | general_statement SEMI_COLON!
215
          | split_clause SEMI_COLON!
218
          | split_clause SEMI_COLON!
[+20] [20] 849 lines
src/org/apache/pig/parser/QueryParserDriver.java
Revision bdad431 New Change
 
test/org/apache/pig/data/TestSchemaTuple.java
Revision 212c00a New Change
 
test/org/apache/pig/test/TestPOCast.java
Revision b6c395f New Change
 
test/org/apache/pig/test/TestSchema.java
Revision bfe76c4 New Change
 
  1. src/org/apache/pig/parser/QueryParser.g: Loading...
  2. src/org/apache/pig/parser/QueryParserDriver.java: Loading...
  3. test/org/apache/pig/data/TestSchemaTuple.java: Loading...
  4. test/org/apache/pig/test/TestPOCast.java: Loading...
  5. test/org/apache/pig/test/TestSchema.java: Loading...