You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Flink Jira Bot (Jira)" <ji...@apache.org> on 2022/01/01 22:39:00 UTC
[jira] [Updated] (FLINK-7339) aggregationToString fails when user defined aggregation contains constants
[ https://issues.apache.org/jira/browse/FLINK-7339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Flink Jira Bot updated FLINK-7339:
----------------------------------
Labels: auto-deprioritized-major auto-deprioritized-minor auto-unassigned (was: auto-deprioritized-major auto-unassigned stale-minor)
Priority: Not a Priority (was: Minor)
This issue was labeled "stale-minor" 7 days ago and has not received any updates so it is being deprioritized. If this ticket is actually Minor, please raise the priority and ask a committer to assign you the issue or revive the public discussion.
> aggregationToString fails when user defined aggregation contains constants
> --------------------------------------------------------------------------
>
> Key: FLINK-7339
> URL: https://issues.apache.org/jira/browse/FLINK-7339
> Project: Flink
> Issue Type: Bug
> Components: API / DataStream, Table SQL / API
> Affects Versions: 1.3.1
> Reporter: Stefano Bortoli
> Priority: Not a Priority
> Labels: auto-deprioritized-major, auto-deprioritized-minor, auto-unassigned
>
> Issue related to FLINK-7338, when the user defined aggregation contains a constant it breaks the aggregation translation to string, which are mapped 1 to 1 to the input fields.
> OverAggregates.scala aggregationToString function fails to find a parameter of the function among the input fields, and therefore throws a RuntimeException.
> {code}
> private[flink] def aggregationToString(
> inputType: RelDataType,
> rowType: RelDataType,
> namedAggregates: Seq[CalcitePair[AggregateCall, String]]): String = {
> val inFields = inputType.getFieldNames.asScala
> val outFields = rowType.getFieldNames.asScala
> val aggStrings = namedAggregates.map(_.getKey).map(
> a => s"${a.getAggregation}(${
> if (a.getArgList.size() > 0) {
> // ERROR HAPPENS HERE!
> a.getArgList.asScala.map(inFields(_)).mkString(", ")
> } else {
> "*"
> }
> })")
> (inFields ++ aggStrings).zip(outFields).map {
> case (f, o) => if (f == o) {
> f
> } else {
> s"$f AS $o"
> }
> }.mkString(", ")
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)