Airblader commented on a change in pull request #16984: URL: https://github.com/apache/flink/pull/16984#discussion_r695731838
########## File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/connector/source/abilities/SupportsReadingMetadata.java ########## @@ -128,4 +128,19 @@ * @see DecodingFormat#applyReadableMetadata(List) */ void applyReadableMetadata(List<String> metadataKeys, DataType producedDataType); + + /** + * Defines whether projections can be applied to metadata columns. + * + * <p>This method is only called if the source does <em>not</em> implement {@link + * SupportsProjectionPushDown}. In this case, by default the planner will apply all metadata + * declared in a table's schema. By returning {@code true} instead the source can inform the + * planner that it should only apply metadata columns which have actually been selected. + * + * <p>If the source implements {@link SupportsProjectionPushDown}, projections of metadata + * columns are always considered before calling {@link #applyReadableMetadata(List, DataType)}. + */ + default boolean supportsMetadataProjection() { + return false; Review comment: Should we consider defaulting to `true` and setting it to `false` in the (upsert-)kafka connector? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org