Weiqing Yang created FLINK-41597:
------------------------------------

             Summary: Same-name catalog functions from different databases are 
merged in UNION ALL, OVER and process table function plans
                 Key: FLINK-41597
                 URL: https://issues.apache.org/jira/browse/FLINK-41597
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
    Affects Versions: 2.4.0
            Reporter: Weiqing Yang


When two catalog functions have the same name in different databases, e.g. 
{{db1.f}} and {{db2.f}}, the planner can treat plan parts that differ only in 
the function as identical and reuse one result for both:

* UNION ALL branches that differ only in the function, for scalar and aggregate 
functions, in batch and streaming. Both branches return the result of {{db1.f}}:
{code:sql}
SELECT db1.f(s) FROM src
UNION ALL
SELECT db2.f(s) FROM src
{code}
* OVER aggregates: in {{SELECT db1.agg(s) OVER (), db2.agg(s) OVER () FROM 
src}}, both columns return the result of {{db1.agg}}.
* Process table functions in UNION ALL with sub-plan reuse enabled (the 
default).

The plan digests print only the simple function name ({{f}}).




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to