Review Board 1.7.22


DRILL-182 : abs() function implementation

Review Request #13760 - Created Aug. 23, 2013 and updated

Tanujit Ghosh
Reviewers
drill-git
drill-git
Implementation of the abs() function within DRILL.
org.apache.drill.exec.physical.impl.TestSimpleFunctions.testAbsoluteValueInt
org.apache.drill.exec.physical.impl.TestSimpleFunctions.testAbsoluteValueBigInt
org.apache.drill.exec.physical.impl.TestSimpleFunctions.testAbsoluteValueFloat4
org.apache.drill.exec.physical.impl.TestSimpleFunctions.testAbsoluteValueFloat8
sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/FixedValueVectors.java
Revision 311e715 New Change
[20] 240 lines
[+20] [+] public void set(int index, ${minor.class}Holder holder){
241
   public void generateTestData() {
241
   public void generateTestData() {
242
     setValueCount(getValueCapacity());
242
     setValueCount(getValueCapacity());
243
     boolean even = true;
243
     boolean even = true;
244
     for(int i =0; i < valueCount; i++, even = !even){
244
     for(int i =0; i < valueCount; i++, even = !even){
245
       if(even){
245
       if(even){
246
         set(i, ${minor.boxedType!type.boxedType}.MIN_VALUE);
246
         //set(i, ${minor.boxedType!type.boxedType}.MIN_VALUE);

    
   
247
         set(i, i);
247
       }else{
248
       }else{
248
         set(i, ${minor.boxedType!type.boxedType}.MAX_VALUE);
249
         //set(i, ${minor.boxedType!type.boxedType}.MAX_VALUE);

    
   
250
         set(i, -1*i);
249
       }
251
       }
250
     }
252
     }
251
   }
253
   }
252

    
   
254

   
253
  </#if> <#-- type.width -->
255
  </#if> <#-- type.width -->
[+20] [20] 18 lines
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/MathFunctions.java
Revision 78630ba New Change
 
sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFunctions.java
Revision ce5dccd New Change
 
sandbox/prototype/exec/java-exec/src/test/resources/functions/testMathFunctions.json
New File
 
  1. sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/FixedValueVectors.java: Loading...
  2. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/MathFunctions.java: Loading...
  3. sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFunctions.java: Loading...
  4. sandbox/prototype/exec/java-exec/src/test/resources/functions/testMathFunctions.json: Loading...