[ https://issues.apache.org/jira/browse/FLINK-24843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17441143#comment-17441143 ]
Wenlong Lyu commented on FLINK-24843: ------------------------------------- hi, I'm afraid that return index may not friendly at api, because people need to understand which schema the index refers to, the PhysicalSchema from source or the ResolvedSchema from flink catalog? the case can be worse when the fields order at flink ddl is different from what it is at the external storage. Regarding primary key, we also use names currently, see UniqueConstraint > DynamicTableFactory.Context.getCatalogTable().getPartitionKeys() should > return indexes > -------------------------------------------------------------------------------------- > > Key: FLINK-24843 > URL: https://issues.apache.org/jira/browse/FLINK-24843 > Project: Flink > Issue Type: Sub-task > Components: Table SQL / Planner > Reporter: Francesco Guardiani > Priority: Minor > > Right now invoking {{context.getCatalogTable().getPartitionKeys()}} returns > field names. We should encourage users to use indexes, by having a new > method in context or by adding a new method to CatalogTable that returns > {{int[]}} and can be used in conjunction with {{DataType.excludeFields}} -- This message was sent by Atlassian Jira (v8.20.1#820001)