Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.27.0
Description
AbstractRelNode#getId can overflow into a negative value.
This id is used by the implement method of several Enumerable operators (EnumerableBatchNestedLoopJoin and EnumerableMergeUnion) to guarantee a unique variable name in the dynamic code, e.g.:
final ParameterExpression corrArgList = Expressions.parameter(Modifier.FINAL, List.class, "corrList" + this.getId());
However, if the id is negative, this variable name will have a "-", causing a CompileException:
... final org.apache.calcite.linq4j.Enumerable _inputEnumerable1 = org.apache.calcite.linq4j.EnumerableDefaults.correlateBatchJoin(org.apache.calcite.linq4j.JoinType.LEFT, left0, new org.apache.calcite.linq4j.function.Function1() { public org.apache.calcite.linq4j.AbstractEnumerable apply(final java.util.List corrList-1794407755) { ... Caused by: java.util.concurrent.ExecutionException: org.codehaus.commons.compiler.CompileException: Line 134, Column 103: One of ', )' expected instead of '-'
Attachments
Issue Links
- relates to
-
CALCITE-4300 EnumerableBatchNestedLoopJoin dynamic code generation can lead to variable name issues if two EBNLJ are nested
- Closed
-
CALCITE-3879 Rel Id should be generated per query context instead of globally
- Open
- links to