[ https://issues.apache.org/jira/browse/FLINK-33083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17764666#comment-17764666 ]
Yunhong Zheng commented on FLINK-33083: --------------------------------------- It looks like this is a planner bug, and we don't have related tests to cover the situation that connector implement SupportsReadingMetadata and supportsMetadataProjection return false: {code:java} default boolean supportsMetadataProjection() { return false; }{code} > SupportsReadingMetadata is not applied when loading a CompiledPlan > ------------------------------------------------------------------ > > Key: FLINK-33083 > URL: https://issues.apache.org/jira/browse/FLINK-33083 > Project: Flink > Issue Type: Bug > Components: Table SQL / Planner > Affects Versions: 1.16.2, 1.17.1 > Reporter: Dawid Wysakowicz > Priority: Major > > If a few conditions are met, we can not apply ReadingMetadata interface: > # source overwrites: > {code} > @Override > public boolean supportsMetadataProjection() { > return false; > } > {code} > # source does not implement {{SupportsProjectionPushDown}} > # table has metadata columns e.g. > {code} > CREATE TABLE src ( > physical_name STRING, > physical_sum INT, > timestamp TIMESTAMP_LTZ(3) NOT NULL METADATA VIRTUAL > ) > {code} > # we query the table {{SELECT * FROM src}} > It fails with: > {code} > Caused by: java.lang.IllegalArgumentException: Row arity: 1, but serializer > arity: 2 > at > org.apache.flink.table.runtime.typeutils.RowDataSerializer.copy(RowDataSerializer.java:124) > {code} > The reason is {{SupportsReadingMetadataSpec}} is created only in the > {{PushProjectIntoTableSourceScanRule}}, but the rule is not applied when 1 & 2 -- This message was sent by Atlassian Jira (v8.20.10#820010)