[
https://issues.apache.org/jira/browse/CALCITE-4322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Liya Fan updated CALCITE-4322:
------------------------------
Attachment: image-2020-10-10-10-36-50-697.png
> Inconsistent parameter types for splittable agg function
> --------------------------------------------------------
>
> Key: CALCITE-4322
> URL: https://issues.apache.org/jira/browse/CALCITE-4322
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Liya Fan
> Assignee: Liya Fan
> Priority: Major
> Attachments: image-2020-10-10-10-34-37-193.png,
> image-2020-10-10-10-36-50-697.png
>
>
> The \{{AggregateJoinTransposeRule}} rule often calls the
> \{{SqlSplittableAggFunction#topSplit}} method to split the workload of a agg
> call.
> This may involve generating a multiply operator (e.g. see
> [https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/SqlSplittableAggFunction.java#L302)]
> The problem is that the operands of the multiply can be different. For
> example, if the original agg call is a \{{sum}} on double values, here we
> would multiply a double with a big integer.
> This is undesirable, as the \{{SqlStdOperatorTable#MULTIPLY}} uses
> \{{InferTypes.FIRST_KNOWN}} to infer operand types. That is, it assumes all
> parameters have the same type, and it uses the first known type to infer
> other operand types.
> In our system, it causes the sql processing to crash.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)