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)

 
src/org/apache/pig/builtin/BigDecimalAbs.java
New File

    
   
1
package org.apache.pig.builtin;

    
   
2

   

    
   
3
import java.io.IOException;

    
   
4
import java.math.BigDecimal;

    
   
5

   

    
   
6
import org.apache.pig.EvalFunc;

    
   
7
import org.apache.pig.data.Tuple;

    
   
8

   

    
   
9
@OutputSchema("x:bigdecimal")

    
   
10
public class BigDecimalAbs extends EvalFunc<BigDecimal> {

    
   
11
    @Override

    
   
12
    public BigDecimal exec(Tuple input) throws IOException {

    
   
13
        return ((BigDecimal)input.get(0)).abs();

    
   
14
    }

    
   
15
}
src/org/apache/pig/builtin/BigIntegerAbs.java
New File
 
src/org/apache/pig/builtin/BinStorage.java
Revision 38b4492 New Change
 
src/org/apache/pig/builtin/TextLoader.java
Revision d5bcf02 New Change
 
src/org/apache/pig/builtin/Utf8StorageConverter.java
Revision da12ed6 New Change
 
src/org/apache/pig/data/BinInterSedes.java
Revision e851d8b New Change
 
src/org/apache/pig/data/DataReaderWriter.java
Revision 37a162a New Change
 
src/org/apache/pig/data/DataType.java
Revision e4c7b98 New Change
 
src/org/apache/pig/data/DefaultTuple.java
Revision e182b06 New Change
 
src/org/apache/pig/data/SizeUtil.java
Revision 90e5d94 New Change
 
src/org/apache/pig/data/TypeAwareTuple.java
Revision cf78d0a New Change
 
src/org/apache/pig/impl/io/NullableBigDecimalWritable.java
New File
 
src/org/apache/pig/impl/io/NullableBigIntegerWritable.java
New File
 
src/org/apache/pig/impl/logicalLayer/schema/SchemaUtil.java
Revision c257ada New Change
 
src/org/apache/pig/impl/util/CastUtils.java
Revision 309130a New Change
 
src/org/apache/pig/impl/util/NumValCarrier.java
Revision af519fd New Change
 
src/org/apache/pig/impl/util/StorageUtil.java
Revision 087651a New Change
 
src/org/apache/pig/newplan/logical/rules/ConstExpEvaluator.java
Revision f968294 New Change
 
src/org/apache/pig/newplan/logical/visitor/TypeCheckingExpVisitor.java
Revision d7a1370 New Change
 
src/org/apache/pig/parser/AliasMasker.g
Revision 8cb1b30 New Change
 
  1. src/org/apache/pig/builtin/BigDecimalAbs.java: Loading...
  2. src/org/apache/pig/builtin/BigIntegerAbs.java: Loading...
  3. src/org/apache/pig/builtin/BinStorage.java: Loading...
  4. src/org/apache/pig/builtin/TextLoader.java: Loading...
  5. src/org/apache/pig/builtin/Utf8StorageConverter.java: Loading...
  6. src/org/apache/pig/data/BinInterSedes.java: Loading...
  7. src/org/apache/pig/data/DataReaderWriter.java: Loading...
  8. src/org/apache/pig/data/DataType.java: Loading...
  9. src/org/apache/pig/data/DefaultTuple.java: Loading...
  10. src/org/apache/pig/data/SizeUtil.java: Loading...
  11. src/org/apache/pig/data/TypeAwareTuple.java: Loading...
  12. src/org/apache/pig/impl/io/NullableBigDecimalWritable.java: Loading...
  13. src/org/apache/pig/impl/io/NullableBigIntegerWritable.java: Loading...
  14. src/org/apache/pig/impl/logicalLayer/schema/SchemaUtil.java: Loading...
  15. src/org/apache/pig/impl/util/CastUtils.java: Loading...
  16. src/org/apache/pig/impl/util/NumValCarrier.java: Loading...
  17. src/org/apache/pig/impl/util/StorageUtil.java: Loading...
  18. src/org/apache/pig/newplan/logical/rules/ConstExpEvaluator.java: Loading...
  19. src/org/apache/pig/newplan/logical/visitor/TypeCheckingExpVisitor.java: Loading...
  20. src/org/apache/pig/parser/AliasMasker.g: Loading...
This diff has been split across 4 pages: < 1 2 3 4 >