The variable name of the input row in generated code.
Holding all the functions those will be added into generated class.
Returns the boxed type in Java.
Returns the representation of default value for a given Java Type.
Holds expressions that are equivalent.
Holds expressions that are equivalent. Used to perform subexpression elimination during codegen.
For expressions that appear more than once, generate additional code to prevent recomputing the value.
For example, consider two exprsesion generated from this SQL statement: SELECT (col1 + col2), (col1 + col2) / col3.
equivalentExpressions will match the tree containing col1 + col2
and it will only
be evaluated once.
Returns a term name that is unique within this instance of a CodeGenerator
.
Returns a term name that is unique within this instance of a CodeGenerator
.
(Since we aren't in a macro context we do not seem to have access to the built in freshName
function.)
Generates code for comparing two expressions.
Generates code for comparing two expressions.
data type of the expressions
name of the variable of expression 1's output
name of the variable of expression 2's output
Generates code for equal expression in Java.
Generates code for greater of two expressions.
Generates code for greater of two expressions.
data type of the expressions
name of the variable of expression 1's output
name of the variable of expression 2's output
Generates code for expressions.
Generates code for expressions. If doSubexpressionElimination is true, subexpression
elimination will be performed. Subexpression elimination assumes that the code will for each
expression will be combined in the expressions
order.
get a map of the pair of a place holder and a corresponding comment
Returns the specialized code to access a value from inputRow
at ordinal
.
Returns true if the Java type has a special accessor and setter in InternalRow.
Returns the Java type for a DataType.
Holding expressions' mutable states like MonotonicallyIncreasingID.count
as a
3-tuple: java type, variable name, code to init it.
Holding expressions' mutable states like MonotonicallyIncreasingID.count
as a
3-tuple: java type, variable name, code to init it.
As an example, ("int", "count", "count = 0;") will produce code:
private int count;
as a member variable, and add
count = 0;
to the constructor.
They will be kept as member variables in generated classes like SpecificProjection
.
Returns the name used in accessor and setter for a Java primitive type.
List of java data types that have special accessors and setters in InternalRow.
Holding all the expressions those do not support codegen, will be evaluated directly.
Register a comment and return the corresponding place holder
Returns the code to update a column in Row for a given DataType.
Splits the generated code of expressions into multiple functions, because function has 64kb code size limit in JVM
Splits the generated code of expressions into multiple functions, because function has 64kb code size limit in JVM
the variable name of row that is used by expressions
the codes to evaluate expressions.
A context for codegen, which is used to bookkeeping the expressions those are not supported by codegen, then they are evaluated directly. The unsupported expression is appended at the end of
references
, the position of it is kept in the code, used to access and evaluate it.