Review Board 1.7.22


HIVE-5356: Move arithmatic UDFs to generic UDF implementations

Review Request #15113 - Created Oct. 31, 2013 and updated

Xuefu Zhang
trunk
HIVe-5356
Reviewers
hive
hive-git
Replace plus, minus, and so on 6 old UDFs with generic UDF implementations.
Full set of unit tests is to be run. Old testcases are also migrated.

Diff revision 8

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

1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9

  1. common/src/test/org/apache/hadoop/hive/common/type/TestHiveDecimal.java: Loading...
  2. ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java: Loading...
  3. ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java: Loading...
  4. ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java: Loading...
  5. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFBaseNumericOp.java: Loading...
  6. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java: Loading...
  7. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMinus.java: Loading...
  8. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMod.java: Loading...
  9. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMultiply.java: Loading...
  10. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPPlus.java: Loading...
  11. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFPosMod.java: Loading...
  12. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java: Loading...
  13. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPDivide.java: Loading...
  14. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMinus.java: Loading...
  15. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMod.java: Loading...
  16. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMultiply.java: Loading...
  17. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPPlus.java: Loading...
  18. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPosMod.java: Loading...
  19. ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSelectOperator.java: Loading...
  20. ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java: Loading...
This diff has been split across 4 pages: 1 2 3 4 >
common/src/test/org/apache/hadoop/hive/common/type/TestHiveDecimal.java
Revision e3a1620 New Change
[20] 99 lines
[+20] [+] public void testPlus() {
100
    HiveDecimal dec2 = HiveDecimal.create("1");
100
    HiveDecimal dec2 = HiveDecimal.create("1");
101
    Assert.assertNotNull(dec1.add(dec2));
101
    Assert.assertNotNull(dec1.add(dec2));
102
  }
102
  }
103

    
   
103

   
104
  @Test
104
  @Test

    
   
105
  public void testPosMod() {

    
   
106
    HiveDecimal hd1 = HiveDecimal.create("-100.91");

    
   
107
    HiveDecimal hd2 = HiveDecimal.create("9.8");

    
   
108
    HiveDecimal dec = hd1.remainder(hd2).add(hd2).remainder(hd2);

    
   
109
    Assert.assertEquals("6.89", dec.toString());

    
   
110
  }

    
   
111

   

    
   
112
  @Test
105
  public void testException() {
113
  public void testException() {
106
    HiveDecimal dec = HiveDecimal.create("3.1415.926");
114
    HiveDecimal dec = HiveDecimal.create("3.1415.926");
107
    Assert.assertNull(dec);
115
    Assert.assertNull(dec);
108
    dec = HiveDecimal.create("3abc43");
116
    dec = HiveDecimal.create("3abc43");
109
    Assert.assertNull(dec);
117
    Assert.assertNull(dec);
110
  }
118
  }
111

    
   
119

   
112
}
120
}
ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
Revision 5eb321c New Change
 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java
Revision 7c1ab0d New Change
 
ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
Revision 7838547 New Change
 
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFBaseNumericOp.java
Revision 1e74fce New Change
 
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java
Revision b892b84 New Change
 
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMinus.java
Revision 0996231 New Change
 
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMod.java
Revision 0942ac3 New Change
 
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMultiply.java
Revision 07c1957 New Change
 
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPPlus.java
Revision cfe7b2b New Change
 
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFPosMod.java
Revision 0da7eae New Change
 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java
New File
 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPDivide.java
New File
 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMinus.java
New File
 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMod.java
New File
 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMultiply.java
New File
 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPPlus.java
New File
 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPosMod.java
New File
 
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSelectOperator.java
Revision 4aeb4e6 New Change
 
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java
Revision 3f3e67f New Change
 
  1. common/src/test/org/apache/hadoop/hive/common/type/TestHiveDecimal.java: Loading...
  2. ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java: Loading...
  3. ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java: Loading...
  4. ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java: Loading...
  5. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFBaseNumericOp.java: Loading...
  6. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java: Loading...
  7. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMinus.java: Loading...
  8. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMod.java: Loading...
  9. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMultiply.java: Loading...
  10. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPPlus.java: Loading...
  11. ql/src/java/org/apache/hadoop/hive/ql/udf/UDFPosMod.java: Loading...
  12. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java: Loading...
  13. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPDivide.java: Loading...
  14. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMinus.java: Loading...
  15. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMod.java: Loading...
  16. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMultiply.java: Loading...
  17. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPPlus.java: Loading...
  18. ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPosMod.java: Loading...
  19. ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSelectOperator.java: Loading...
  20. ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java: Loading...
This diff has been split across 4 pages: 1 2 3 4 >