[FLINK-40015] Introduce getRuntimeOutput in PTF Test Harness#28657
Open
autophagy wants to merge 1 commit into
Open
[FLINK-40015] Introduce getRuntimeOutput in PTF Test Harness#28657autophagy wants to merge 1 commit into
autophagy wants to merge 1 commit into
Conversation
davidradl
reviewed
Jul 6, 2026
Collaborator
twalthr
reviewed
Jul 7, 2026
| harness.processElement(Row.of("B", 20)); | ||
|
|
||
| List<Row> output = harness.getOutput(); | ||
| List<Row> output = harness.getRuntimeOutput(); |
Contributor
There was a problem hiding this comment.
How about we call this getFullOutput()?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
When testing the PTF Test Harness against the
ProcessTableFunctionTestPrograms, I found a bug that occurs when trying to use a PTF that emits a non-row type in a mode where the harness adds extra columns (rowtimewithon_time, partition columns, etc). This exposed a bit of a behaviour gap which this PR hopes to fill.This PR redfines
getOutputso that it returns only the emitted output from the PTF itself, either the Pojo, atomic type, Row (without extra columns), etc. It also introduces agetRuntimeOutputwhich always returns aRowand is more like what the runtime would actually emit. The reason for this was that a user is more likely to want to test the actual produced output of their PTF in particular, than what the runtime also emits. There could be cases where the user would like to test this, to see what partition keys are emitted for example, sogetRuntimeOutputwould aim to cover this case.I also fixed a bug that surfaced when implementing this, where it was resetting the row kind of Rows to
INSERTwhen appending the rowtime column.Brief change log
getOutputinProcessTableFunctionTestHarnessto only return the emitted object from the PTF based on the PTF's declared return type, without extra columns.getRuntimeOutputinProcessTableFunctionTestHarnessto provide users a way to examine what the runtime might actually emit, with passthrough columns, partition columns, rowtime, etc.Verifying this change
This change added tests and can be verified by running
ProcessTableFunctionTestHarnessTest.Does this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation
Was generative AI tooling used to co-author this PR?