lushuifeng commented on a change in pull request #1481: DRILL-6763: Codegen
optimization of SQL functions with constant values
URL: https://github.com/apache/drill/pull/1481#discussion_r225764315
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/ClassGenerator.java
##########
@@ -646,7 +687,7 @@ public void preparePlainJava() {
Class<?> p = params[i];
childNew.arg(shim.param(model._ref(p), "arg" + i));
}
- shim.body()._return(childNew);
+ shim.body()._return(JExpr._this().invoke("injectMembers").arg(childNew));
Review comment:
The innerClasses like BatchHolder may have the constants, BatchHolder
instance is created via newBatchHolder dynamically when processing recordBatch,
that is the difference between innerClasses and nested splitting classes.
The innerClasses member fields is initialized by invoking
injectMembers(innerClassInstance) which is override generated by this code as
shown in
`protected BatchHolder newBatchHolder(int batchRowCount) {
return this.injectMembers(new BatchHolder(batchRowCount));
}`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services