Review Board 1.7.22


Add BigInteger and BigDecimal to Pig

Review Request #9012 - Created Jan. 17, 2013 and updated

Jonathan Coveney
add_bigint_bigdec
PIG-2764
Reviewers
pig
gates, herberts
pig-git
This patch adds big integer and big decimal support to Pig. It could use more tests, something I'd appreciate feedback on (but I wanted to make sure the core implementation is good)

 

Diff revision 2

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

1 2 3
1 2 3

  1. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/LessThanExpr.java: Loading...
  2. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Mod.java: Loading...
  3. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Multiply.java: Loading...
  4. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/NotEqualToExpr.java: Loading...
  5. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POBinCond.java: Loading...
  6. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java: Loading...
  7. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POIsNull.java: Loading...
  8. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/PONegative.java: Loading...
  9. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POProject.java: Loading...
  10. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POUserComparisonFunc.java: Loading...
  11. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POUserFunc.java: Loading...
  12. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Subtract.java: Loading...
  13. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POForEach.java: Loading...
  14. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POLocalRearrange.java: Loading...
  15. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POPartialAgg.java: Loading...
  16. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POPreCombinerLocalRearrange.java: Loading...
  17. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POSort.java: Loading...
  18. src/org/apache/pig/backend/hadoop/hbase/HBaseBinaryConverter.java: Loading...
  19. src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java: Loading...
  20. src/org/apache/pig/builtin/ABS.java: Loading...
This diff has been split across 4 pages: < 1 2 3 4 >
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/LessThanExpr.java
Revision 0320698 New Change
[20] 16 lines
[+20]
17
 */
17
 */
18
package org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators;
18
package org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators;
19

    
   
19

   
20
import org.apache.commons.logging.Log;
20
import org.apache.commons.logging.Log;
21
import org.apache.commons.logging.LogFactory;
21
import org.apache.commons.logging.LogFactory;
22

    
   

   
23
import org.apache.pig.PigException;
22
import org.apache.pig.PigException;
24
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhyPlanVisitor;
23
import org.apache.pig.backend.executionengine.ExecException;
25
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.POStatus;
24
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.POStatus;
26
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.Result;
25
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.Result;

    
   
26
import org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhyPlanVisitor;
27
import org.apache.pig.data.DataType;
27
import org.apache.pig.data.DataType;
28
import org.apache.pig.impl.plan.OperatorKey;

   
29
import org.apache.pig.impl.plan.NodeIdGenerator;
28
import org.apache.pig.impl.plan.NodeIdGenerator;

    
   
29
import org.apache.pig.impl.plan.OperatorKey;
30
import org.apache.pig.impl.plan.VisitorException;
30
import org.apache.pig.impl.plan.VisitorException;
31
import org.apache.pig.backend.executionengine.ExecException;

   
32

    
   
31

   
33
public class LessThanExpr extends BinaryComparisonOperator {
32
public class LessThanExpr extends BinaryComparisonOperator {
34

    
   
33

   
35
    /**
34
    /**
36
     *
35
     *
[+20] [20] 27 lines
[+20] [+] public Result getNext(Boolean bool) throws ExecException {
64
        switch (operandType) {
63
        switch (operandType) {
65
        case DataType.BYTEARRAY:
64
        case DataType.BYTEARRAY:
66
        case DataType.DOUBLE:
65
        case DataType.DOUBLE:
67
        case DataType.FLOAT:
66
        case DataType.FLOAT:
68
        case DataType.INTEGER:
67
        case DataType.INTEGER:

    
   
68
        case DataType.BIGINTEGER:

    
   
69
        case DataType.BIGDECIMAL:
69
        case DataType.LONG:
70
        case DataType.LONG:
70
        case DataType.DATETIME:
71
        case DataType.DATETIME:
71
        case DataType.CHARARRAY: {
72
        case DataType.CHARARRAY: {
72
            Object dummy = getDummy(operandType);
73
            Object dummy = getDummy(operandType);
73
            Result r = accumChild(null, dummy, operandType);
74
            Result r = accumChild(null, dummy, operandType);
[+20] [20] 55 lines
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Mod.java
Revision 6819185 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Multiply.java
Revision 7b57bed New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/NotEqualToExpr.java
Revision 79a4461 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POBinCond.java
Revision 08544d5 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java
Revision e8c2f2c New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POIsNull.java
Revision f20b839 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/PONegative.java
Revision c076ae7 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POProject.java
Revision 8887133 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POUserComparisonFunc.java
Revision 479eb83 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POUserFunc.java
Revision 3c7e741 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Subtract.java
Revision 79d4c73 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POForEach.java
Revision bf2ba08 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POLocalRearrange.java
Revision ddb25f1 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POPartialAgg.java
Revision aa11409 New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POPreCombinerLocalRearrange.java
Revision 52401eb New Change
 
src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POSort.java
Revision ad33e7b New Change
 
src/org/apache/pig/backend/hadoop/hbase/HBaseBinaryConverter.java
Revision 60a5899 New Change
 
src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java
Revision a6f4ea6 New Change
 
src/org/apache/pig/builtin/ABS.java
Revision 8a7c631 New Change
 
  1. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/LessThanExpr.java: Loading...
  2. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Mod.java: Loading...
  3. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Multiply.java: Loading...
  4. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/NotEqualToExpr.java: Loading...
  5. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POBinCond.java: Loading...
  6. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java: Loading...
  7. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POIsNull.java: Loading...
  8. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/PONegative.java: Loading...
  9. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POProject.java: Loading...
  10. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POUserComparisonFunc.java: Loading...
  11. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POUserFunc.java: Loading...
  12. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/Subtract.java: Loading...
  13. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POForEach.java: Loading...
  14. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POLocalRearrange.java: Loading...
  15. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POPartialAgg.java: Loading...
  16. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POPreCombinerLocalRearrange.java: Loading...
  17. src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POSort.java: Loading...
  18. src/org/apache/pig/backend/hadoop/hbase/HBaseBinaryConverter.java: Loading...
  19. src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java: Loading...
  20. src/org/apache/pig/builtin/ABS.java: Loading...
This diff has been split across 4 pages: < 1 2 3 4 >