-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/17333/
-----------------------------------------------------------
Review request for drill.
Repository: drill-git
Description
-------
In this patch, the following code changes are made:
1. CodeGenerator.java : 1) use DEFAULT_CONSTANT_MAP for constant scope when
generates code.
2) Add a field isConst to HoldingContainer, to indicate
if a HoldingContainer corresponds to a constant expression.
3) use the constant boundaries which are determined by
ConstantExpressionIdentifier.
2. ConstantExpressionIdentifier.java : fix bugs to correct identify constant
boundaries for an expression.
3. MappingSet.java: Switch the GeneratorMapping when enter/exit a constant
scope.
4. EvaluationVisitor.java: In ConstantFilter, when visits a constant
expression, make sure the HoldingContainer would declare a classField, in stead
of local var, and set isConst.
5. DrillSimpleFuncHolder : pass in the array of inputVariables when generated
SETUP block, making them accessible if the input is a constant in SETUP block.
Other related changes:
1. Add a new type of FunctionDefinition, to model non-deterministic functions,
such as randomBigInt(3), alternator(), etc.
2. Make sure GeneratorMapping is static var; MappingSet is instance variable;
Make sure the naming convention for the change is consistent.
Diffs
-----
common/src/main/java/org/apache/drill/common/expression/FunctionDefinition.java
8009632
exec/java-exec/src/main/java/org/apache/drill/exec/compile/sig/ConstantExpressionIdentifier.java
46dbbe9
exec/java-exec/src/main/java/org/apache/drill/exec/compile/sig/MappingSet.java
1cb2380
exec/java-exec/src/main/java/org/apache/drill/exec/expr/CodeGenerator.java
2cebf5e
exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
ef43513
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/DrillSimpleFuncHolder.java
d31f950
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/Alternator.java
5bff29e
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/AggBatch.java
7586634
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
1d63a06
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingReceiverGeneratorBase.java
3193c76
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
f1bae15
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java
f120233
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java
e01fb74
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/GeneratorFunctions.java
b79ccd0
Diff: https://reviews.apache.org/r/17333/diff/
Testing
-------
Test is mainly done through running the existing unit testcases; no new unit
testcase is added.
In addition, I verified from the log that the generated java codes indeed put
the evaluation logic in doSetup for the following expressions:
1+2
cast(123 as varchar(10))
substring(varcharcol, 1+1, 1+2)
Thanks,
Jinfeng Ni