[GLUTEN-10013][FLINK] Support function reinterpret#10022
[GLUTEN-10013][FLINK] Support function reinterpret#10022shuai-xu merged 6 commits intoapache:mainfrom
Conversation
|
UTs are missed |
| // Date -> Long | ||
| // Time -> Long | ||
| // Interval Months -> Long | ||
| if (targetType.equals(DATE) && resultType.equals(INTEGER)) { |
There was a problem hiding this comment.
A better approach might be to use a Map[class, Set[Class]] to assist with the matching.
| } | ||
| } | ||
|
|
||
| private List<String> getRexNodeInputNames(RexNode node, List<String> fieldNames) { |
There was a problem hiding this comment.
It would be best to provide an explanation of the purpose of this function
|
The reviews is fixed @lgbo-ustc |
| operandExpr.getInputs(), | ||
| operandExpr.getFunctionName()); | ||
| } else { | ||
| throw new RuntimeException( |
There was a problem hiding this comment.
Could these unsupported cases be checked in isSupported?
984e1bf to
83aceae
Compare
|
@xushuai @yuanhang-dev please take a review at this pr ? |
| public class ReinterpretRexCallConverter extends BaseRexCallConverter { | ||
|
|
||
| private static final String FUNCTION_NAME = "cast"; | ||
| // internal reinterpretation of temporal types: from Flink |
There was a problem hiding this comment.
Should we wrap this comment in /*.. */ ?
|
Is there tests in Flink to cover this function? |
The |
|
Which nexmark query need this function? |
| LogicalType resultType = FlinkTypeFactory.toLogicalType(operand.getType()); | ||
| LogicalType targetType = FlinkTypeFactory.toLogicalType(callNode.getType()); | ||
| if (resultType.getTypeRoot() != targetType.getTypeRoot()) { | ||
| CallTypedExpr operandExpr = (CallTypedExpr) convertRexCallToTypeExpr(operand, context); |
There was a problem hiding this comment.
Why not call RexNodeConverter.toTypedExpr but add convertRexCallToTypeExpr ?
There was a problem hiding this comment.
We can not use toTypedExpr to convert callNode directly, but to convert its operand, and the given context has no informations about operand, so we need to construct its own context bu using convertRexCallToTypeExpr
in nexmark q0 when use kafka source |
What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)
(Fixes: #10013)
refer to
Flinkimplementation ofScalarOperatorGens#generateReinterpret: https://github.com/apache/flink/blob/5334e7d1f977c04f7eea34abff3b4640ad4db931/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala#L870How was this patch tested?
UT