Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,19 @@ public RexNode visitCall(final RexCall call, ScriptParameterHelper helper) {
// Do normalization before standardization
Pair<SqlOperator, List<RexNode>> normalized = RexNormalize.normalize(call.op, call.operands);
List<RexNode> standardizedOperands = visitList(normalized.right, helper, update);
return helper.rexBuilder.makeCall(call.getType(), normalized.left, standardizedOperands);
RexNode result =
helper.rexBuilder.makeCall(call.getType(), normalized.left, standardizedOperands);

if (allowNumericTypeWiden
&& SqlTypeUtil.isExactNumeric(call.getType())
&& !call.getType().getSqlTypeName().equals(SqlTypeName.BIGINT)) {
RelDataType targetType =
OpenSearchTypeFactory.TYPE_FACTORY.createTypeWithNullability(
call.getType(), call.getType().isNullable());
result = helper.rexBuilder.makeCast(targetType, result);
}

return result;
} finally {
helper.stack.pop();
}
Expand Down
Loading