yuanhang-dev commented on code in PR #9893:
URL: https://github.com/apache/incubator-gluten/pull/9893#discussion_r2154183503
##########
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:
Here, the return type required by Flink is bigIntType.
--
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]