VasShabu opened a new pull request, #29335: URL: https://github.com/apache/flink/pull/29335
## What is the purpose of the change I found a bug in the Framework in relation of how the engine decides to decide row types when dealing with the Partition By key. So i changed the framework to ensure that this $EXPR column is only added in that case that (pass-through + function output + rowtime) is empty ## Brief change log - SystemTypeInference applies the EXPR$0 placeholder column only when a PTF's entire output row (pass-through + function output + rowtime) is empty — previously it triggered whenever the function's own output was empty - Fixes the phantom EXPR$0 column that appeared (and broke arity) when an empty function output was combined with PARTITION BY pass-through or rowtime columns - Added a ProcessTableFunctionTest case: empty-output PTF + PARTITION BY now resolves to just the partition key, no EXPR$0 ## Verifying this change Please make sure both new and modified tests in this PR follow [the conventions for tests defined in our code quality guide](https://flink.apache.org/how-to-contribute/code-style-and-quality-common/#7-testing). - Added ProcessTableFunctionTest#testEmptyFunctionOutputWithPartitionByHasNoPhantomColumn: a set-semantic PTF with empty output (@FunctionHint(output = @DataTypeHint("ROW<>"))) invoked with PARTITION BY now resolves to just the partition-key column, with no phantom EXPR$0. - Verified red/green: the test fails without the fix (resolved schema [name, EXPR$0]) and passes with it ([name]). - Full ProcessTableFunctionTest suite passes (69 tests), confirming no regression to existing PTF type inference. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (no) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no) - The serializers: (don't know) - The runtime per-record code paths (performance sensitive): (dont think so) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (don't know) - The S3 file system connector: (no) ## Documentation - Does this pull request introduce a new feature? (no) - If yes, how is the feature documented? (not applicable) --- ##### Was generative AI tooling used to co-author this PR? <!-- If generative AI tooling has been used in the process of authoring this PR, please change the checkbox below to `[X]` and replace the placeholder in the "Generated-by" line with the tool name and version. Otherwise remove the "Generated-by" line. See the ASF Generative Tooling Guidance for details: https://www.apache.org/legal/generative-tooling.html You are responsible for the quality and correctness of every change in this PR regardless of the tooling used. Low-effort AI-generated PRs will be closed. See AGENTS.md for the full guidance. --> - [X] Yes (please specify the tool below) Generated-by: [Claude Opus 4.8] -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
