wank125 commented on PR #1312: URL: https://github.com/apache/flink-agents/pull/1312#issuecomment-6342820926
Thanks for the direction @wenjin272 — addressed in f6fbe45b on top of fe8d66e7. Key selection now follows the same three rules in both languages: - An explicit selector always wins, even over the key of an already-keyed input (this also fixes Python silently ignoring an explicit selector on keyed input). - Otherwise a `KeyedStream` input keeps its existing key. - If neither is available, the pipeline fails with a clear error (`IllegalArgumentException` in Java, `RuntimeError` in Python) instead of silently keying by the whole record. Coverage: all four input/selector combinations in both languages — `RemoteExecutionEnvironmentTest` in Java (including a job-level regression test asserting shared short-term memory per session key and isolation across sessions) and `test_key_selection_combinations` in Python. All affected Java examples now pass an explicit selector, and `integrate_with_flink.md` plus the `fromDataStream`/`from_datastream` docs state the rules. Compatibility note: an unkeyed input without a selector changes from silent whole-record keying to a clear error, as requested. One judgement call to confirm: Java's `fromTable(input)` documents a "without keying" mode and converts the table to an unkeyed `DataStream`, so I kept identity keying for that path only (`allowIdentityKeyFallback`) — Python's `from_table` already requires a selector. Happy to extend the same error to the table path if you prefer full alignment. Full `runtime` + `examples` suites pass locally after rebasing onto the latest main (efd7b8f3). -- 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]
