Review Board 1.7.22


PIG-3268 Case statement support

Review Request #10341 - Created April 8, 2013 and submitted

Cheolsoo Park
PIG-3268
Reviewers
pig
pig-git
Add SQL CASE statement to Pig. Please see:
https://issues.apache.org/jira/browse/PIG-3268
Added two new test suites:
- TestCase.java
- TestCaseUdf.java

Also ran ant test-commit.
src/org/apache/pig/parser/AliasMasker.g
Revision 9cc7971 New Change
[20] 349 lines
[+20]
350
var_expr
350
var_expr
351
    : projectable_expr ( dot_proj | pound_proj )*
351
    : projectable_expr ( dot_proj | pound_proj )*
352
;
352
;
353

    
   
353

   
354
projectable_expr
354
projectable_expr
355
    : func_eval | col_ref | bin_expr
355
    : func_eval | col_ref | bin_expr | case_expr
356
;
356
;
357

    
   
357

   
358
dot_proj
358
dot_proj
359
    : ^( PERIOD col_alias_or_index+ )
359
    : ^( PERIOD col_alias_or_index+ )
360
;
360
;
[+20] [20] 20 lines
[+20]
381

    
   
381

   
382
bin_expr
382
bin_expr
383
    : ^( BIN_EXPR cond expr expr )
383
    : ^( BIN_EXPR cond expr expr )
384
;
384
;
385

    
   
385

   

    
   
386
case_expr

    
   
387
    : ^( CASE expr+ )

    
   
388
;

    
   
389

   
386
limit_clause
390
limit_clause
387
    : ^( LIMIT rel ( INTEGER | LONGINTEGER | expr ) )
391
    : ^( LIMIT rel ( INTEGER | LONGINTEGER | expr ) )
388
;
392
;
389

    
   
393

   
390
sample_clause
394
sample_clause
[+20] [20] 347 lines
src/org/apache/pig/parser/AstPrinter.g
Revision 5d83bea New Change
 
src/org/apache/pig/parser/AstValidator.g
Revision b85e238 New Change
 
src/org/apache/pig/parser/LogicalPlanGenerator.g
Revision 26f13f6 New Change
 
src/org/apache/pig/parser/QueryLexer.g
Revision c7f9fdd New Change
 
src/org/apache/pig/parser/QueryParser.g
Revision 538621b New Change
 
test/commit-tests
Revision 5081fbc New Change
 
test/org/apache/pig/test/TestCase.java
New File
 
  1. src/org/apache/pig/parser/AliasMasker.g: Loading...
  2. src/org/apache/pig/parser/AstPrinter.g: Loading...
  3. src/org/apache/pig/parser/AstValidator.g: Loading...
  4. src/org/apache/pig/parser/LogicalPlanGenerator.g: Loading...
  5. src/org/apache/pig/parser/QueryLexer.g: Loading...
  6. src/org/apache/pig/parser/QueryParser.g: Loading...
  7. test/commit-tests: Loading...
  8. test/org/apache/pig/test/TestCase.java: Loading...