Vas Shabu created FLINK-40844:
---------------------------------

             Summary: Planner inserting a ghost column when all rows are 
partition keys
                 Key: FLINK-40844
                 URL: https://issues.apache.org/jira/browse/FLINK-40844
             Project: Flink
          Issue Type: Bug
            Reporter: Vas Shabu


While adding EXPR$0 handling for PTFs, we found SystemTypeInference always 
falls back to a phantom EXPR$0 column whenever the function's own output is 
empty — even when PARTITION BY or rowtime columns already populate the row:

- deriveFunctionOutputFields returns EXPR$0 unconditionally for an empty 
function output, without checking whether pass-through/rowtime columns already 
contributed fields.
- This produces a wrong resolved schema (extra column) and a codegen arity 
mismatch whenever an empty-output PTF is combined with PARTITION BY.
- Fix: only fall back to EXPR$0 when the whole assembled output row 
(pass-through + function output + rowtime) is empty.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to