public final class FlinkRexBuilder
extends org.apache.calcite.rex.RexBuilder
RexBuilder
. See the overridden methods for more explanation.Constructor and Description |
---|
FlinkRexBuilder(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) |
Modifier and Type | Method and Description |
---|---|
org.apache.calcite.rex.RexNode |
makeFieldAccess(org.apache.calcite.rex.RexNode expr,
int i)
Compared to the original method we adjust the nullability of the nested column based on the
nullability of the enclosing type.
|
org.apache.calcite.rex.RexNode |
makeFieldAccess(org.apache.calcite.rex.RexNode expr,
String fieldName,
boolean caseSensitive)
Compared to the original method we adjust the nullability of the nested column based on the
nullability of the enclosing type.
|
org.apache.calcite.rex.RexNode |
makeIn(org.apache.calcite.rex.RexNode arg,
List<? extends org.apache.calcite.rex.RexNode> ranges)
Convert the conditions into the
IN and fix [CALCITE-4888]: Unexpected RexNode
when call RelBuilder.in(org.apache.calcite.rex.RexNode, org.apache.calcite.rex.RexNode...) to create an IN predicate with a list of varchar
literals which have different length in RexBuilder.makeIn(org.apache.calcite.rex.RexNode, java.util.List<? extends org.apache.calcite.rex.RexNode>) . |
org.apache.calcite.rex.RexLiteral |
makeZeroLiteral(org.apache.calcite.rel.type.RelDataType type)
Creates a literal of the default value for the given type.
|
addAggCall, addAggCall, addAggCall, baseUnit, constantNull, copy, decodeIntervalOrDecimal, deriveReturnType, encodeIntervalOrDecimal, ensureType, getOpTab, getTypeFactory, identityProjects, makeAbstractCast, makeApproxLiteral, makeApproxLiteral, makeBetween, makeBigintLiteral, makeBinaryLiteral, makeCall, makeCall, makeCall, makeCast, makeCast, makeCharLiteral, makeCorrel, makeDateLiteral, makeDateLiteral, makeDynamicParam, makeExactLiteral, makeExactLiteral, makeFlag, makeInputRef, makeInputRef, makeIntervalLiteral, makeIntervalLiteral, makeLiteral, makeLiteral, makeLiteral, makeLiteral, makeLiteral, makeLiteral, makeLocalRef, makeNewInvocation, makeNotNull, makeNullLiteral, makeNullLiteral, makeNullLiteral, makeOver, makeOver, makePatternFieldRef, makePreciseStringLiteral, makePreciseStringLiteral, makeRangeReference, makeRangeReference, makeReinterpretCast, makeSearchArgumentLiteral, makeTimeLiteral, makeTimeLiteral, makeTimestampLiteral, makeTimestampLiteral, makeTimestampWithLocalTimeZoneLiteral, makeTimeWithLocalTimeZoneLiteral, makeWindow, matchNullability, multiplyDivide
public FlinkRexBuilder(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory)
public org.apache.calcite.rex.RexNode makeFieldAccess(org.apache.calcite.rex.RexNode expr, String fieldName, boolean caseSensitive)
If the fields type is NOT NULL, but the enclosing ROW is nullable we still can produce nulls.
makeFieldAccess
in class org.apache.calcite.rex.RexBuilder
public org.apache.calcite.rex.RexNode makeFieldAccess(org.apache.calcite.rex.RexNode expr, int i)
If the fields type is NOT NULL, but the enclosing ROW is nullable we still can produce nulls.
makeFieldAccess
in class org.apache.calcite.rex.RexBuilder
public org.apache.calcite.rex.RexLiteral makeZeroLiteral(org.apache.calcite.rel.type.RelDataType type)
This value is:
Uses '1970-01-01 00:00:00'(epoch 0 second) as zero value for TIMESTAMP_LTZ, the zero value '0000-00-00 00:00:00' in Calcite is an invalid time whose month and day is invalid, we workaround here. Stop overriding once CALCITE-4555 fixed.
makeZeroLiteral
in class org.apache.calcite.rex.RexBuilder
type
- Typepublic org.apache.calcite.rex.RexNode makeIn(org.apache.calcite.rex.RexNode arg, List<? extends org.apache.calcite.rex.RexNode> ranges)
IN
and fix [CALCITE-4888]: Unexpected RexNode
when call RelBuilder.in(org.apache.calcite.rex.RexNode, org.apache.calcite.rex.RexNode...)
to create an IN
predicate with a list of varchar
literals which have different length in RexBuilder.makeIn(org.apache.calcite.rex.RexNode, java.util.List<? extends org.apache.calcite.rex.RexNode>)
.
The bug is because the origin implementation doesn't take FlinkTypeSystem.shouldConvertRaggedUnionTypesToVarying()
into consideration. When this is
true, the behaviour should not padding char. Please see
https://issues.apache.org/jira/browse/CALCITE-4590 and
https://issues.apache.org/jira/browse/CALCITE-2321. Please refer to org.apache.calcite.rex.RexSimplify.RexSargBuilder#getType
for the correct behaviour.
Once CALCITE-4888 is fixed, this method (and related methods) should be removed.
makeIn
in class org.apache.calcite.rex.RexBuilder
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.