Teddy Choi created HIVE-26604:
---------------------------------

             Summary: Replace vectorization templates with overrides
                 Key: HIVE-26604
                 URL: https://issues.apache.org/jira/browse/HIVE-26604
             Project: Hive
          Issue Type: Improvement
            Reporter: Teddy Choi
            Assignee: Teddy Choi


Replace vectorization templates with overrides.
h1. Background

There are many combinations among different data types, column/scalar types, 
and operators in vectorization. It leaves a lot of code to implement. The 
current Hive vectorization is implemented with a simple string template engine 
for it. It replaces a <keyword> with a value at all places within each template 
file.

However, the template is written in a text file. It's not natively supported by 
modern IDEs. Also any change on the template needs a separate Maven step to 
generate actual code. It's time consuming.
h1. Design

The base abstract classes will respect Java's data type system. Each string 
template will be divided into several sub data types, such as long-long, 
long-double, double-long, double-double.
 * ColumnArithmeticColumn.txt will be separated into
 ** BaseLongColLongColumn.java
 *** Add: long func(long a, long b) \{ return a + b; }
 *** Subtract: long func(long a, long b) \{ return a - b; }
 *** Multiply: long func(long a, long b) \{ return a * b; }
 *** CheckedAdd: boolean supportsCheckedExecution() \{ return true; }
 *** CheckedSubtract: boolean supportsCheckedExecution() \{ return true; }
 *** CheckedMultiply: boolean supportsCheckedExecution() \{ return true; }
 ** BaseLongColDoubleColumn.java
 *** Add: double func(long a, double b) \{ return a + b; }
 *** Subtract, Multiply, CheckedAdd, CheckedSubtract, CheckMultiply
 ** BaseDoubleColLongColumn.java
 *** Add: double func(double a, long b) \{ return a + b; }
 *** Subtract, Multiply, CheckedAdd, CheckedSubtract, CheckMultiply
 ** BaseDoubleColDoubleColumn.java
 *** Add: double func(double a, double b) \{ return a + b; }
 *** Subtract, Multiply, CheckedAdd, CheckedSubtract, CheckedMultiply
 * ColumnArithmeticScalar.txt
 ** BaseLongColLongScalar.java
 *** Add: long func(long a, long b) \{ return a + b; }
 *** Subtract, Multiply, CheckedAdd, CheckedSubtract, CheckedMultiply
 ** BaseLongColDoubleScalar.java
 *** Add: double func(long a, double b) \{ return a + b; }
 *** Subtract, Multiply, CheckedAdd, CheckedSubtract, CheckedMultiply
 ** BaseDoubleColLongScalar.java
 *** Add: double func(double a, long b) \{ return a + b; }
 *** Subtract, Multiply, CheckedAdd, CheckedSubtract, CheckedMultiply
 ** BaseDoubleColDoubleColumn.java
 *** Add: double func(double a, double b) \{ return a + b; }
 *** Subtract, Multiply, CheckedAdd, CheckedSubtract, CheckedMultiply

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to