PHILO-HE commented on code in PR #9541:
URL: https://github.com/apache/incubator-gluten/pull/9541#discussion_r2084007523
##########
gluten-flink/runtime/src/main/java/org/apache/gluten/util/LogicalTypeConverter.java:
##########
@@ -58,6 +59,9 @@ public static Type toVLType(LogicalType logicalType) {
return new io.github.zhztheplayer.velox4j.type.DecimalType(
decimalType.getPrecision(),
decimalType.getScale());
+ } else if (logicalType instanceof DayTimeIntervalType) {
+ // TODO: it seems interval now can be used as bigint for nexmark.
+ return new io.github.zhztheplayer.velox4j.type.BigIntType();
Review Comment:
Can we use `IntervalDayTimeType()`? IntervalDayTimeType is implemented based
on BigIntType in Velox, but they are logically different.
##########
gluten-flink/planner/src/main/java/org/apache/gluten/rexnode/FunctionMappings.java:
##########
@@ -16,25 +16,32 @@
*/
package org.apache.gluten.rexnode;
+import org.apache.gluten.rexnode.functions.DefaultFunctionConverter;
+import org.apache.gluten.rexnode.functions.FunctionConverter;
+import org.apache.gluten.rexnode.functions.SubtractFunctionConverter;
+
import java.util.HashMap;
import java.util.Map;
/** Mapping of flink function and velox function. */
public class FunctionMappings {
// A map stores the relationship between flink function name and velox
function.
- private static Map<String, String> functionMappings = new HashMap() {
+ private static Map<String, FunctionConverter> functionMappings = new
HashMap() {
{
// TODO: support more functions.
- put(">", "greaterthan");
- put("<", "lessthan");
- put("=", "equalto");
- put("CAST", "cast");
- put("CASE", "if");
- put("*", "multiply");
+ put(">", new DefaultFunctionConverter("greaterthan"));
+ put("<", new DefaultFunctionConverter("lessthan"));
+ put("=", new DefaultFunctionConverter("equalto"));
+ put("CAST", new DefaultFunctionConverter("cast"));
+ put("CASE", new DefaultFunctionConverter("if"));
+ put("*", new DefaultFunctionConverter("multiply"));
+ put("-", new SubtractFunctionConverter("subtract"));
+ put("MOD", new DefaultFunctionConverter("pmod"));
Review Comment:
Should be mapped to "remainder". "pmod" has different meaning, which returns
positive remainder.
--
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]