gustavodemorais commented on code in PR #28199:
URL: https://github.com/apache/flink/pull/28199#discussion_r3267740607
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/ptf/ToChangelogFunction.java:
##########
@@ -77,6 +82,11 @@ public ToChangelogFunction(final SpecializedContext context)
{
final Map<String, String> opMapping =
callContext.getArgumentValue(2, Map.class).orElse(null);
this.rawOpMap = buildOpMap(opMapping);
+ if (opMapping != null) {
+ // Only user-supplied mappings are validated. The default mapping
covers all kinds by
+ // design and is harmless for insert-only or upsert inputs.
+ validateAgainstInputChangelogMode(this.rawOpMap, tableSemantics);
+ }
Review Comment:
This is a nice validation that doesn't allow users to try to map codes which
can't be produced by the source. So if you add "UPDATE_AFTER -> u" mapping but
you're reading from an INSERT only source, you'll never see that and you get a
validation error telling you to only add events that can happen
--
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]