yuanhang-dev commented on code in PR #9893:
URL: https://github.com/apache/incubator-gluten/pull/9893#discussion_r2158461846
##########
gluten-flink/planner/src/main/java/org/apache/gluten/rexnode/functions/BaseRexCallConverters.java:
##########
@@ -84,3 +86,30 @@ public TypedExpr toTypedExpr(RexCall callNode,
RexConversionContext context) {
return new CallTypedExpr(resultType, alignedParams, functionName);
}
}
+
+class SubtractRexCallConverter extends BaseRexCallConverter {
+
+ public SubtractRexCallConverter() {
+ super("subtract");
+ }
+
+ @Override
+ public TypedExpr toTypedExpr(RexCall callNode, RexConversionContext context)
{
+ List<TypedExpr> params = getParams(callNode, context);
+
+ if (params.size() == 2
+ && params.get(0).getReturnType() instanceof TimestampType
+ && params.get(1).getReturnType() instanceof BigIntType) {
+
+ Type bigIntType = new BigIntType();
+ TypedExpr castedParam0 = new CallTypedExpr(bigIntType,
List.of(params.get(0)), "cast");
+
+ List<TypedExpr> newParams = List.of(castedParam0, params.get(1));
+ return new CallTypedExpr(bigIntType, newParams, functionName);
Review Comment:
The conversion from `INTERVAL SECOND` to `BigIntType` happens in the
upstream `RexNodeConverter.toVariant()` method.
https://github.com/apache/incubator-gluten/blob/50111a44112b5e0f63d2167bb982a87c9afef0eb/gluten-flink/planner/src/main/java/org/apache/gluten/rexnode/RexNodeConverter.java#L111
This is why `bigint` is used here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]