[
https://issues.apache.org/jira/browse/FLINK-24399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17422160#comment-17422160
]
Francesco Guardiani commented on FLINK-24399:
---------------------------------------------
Updated the description to include {{DataType#getFields():
List<DataTypes.Field>}}
> Make handling of DataType less verbose
> --------------------------------------
>
> Key: FLINK-24399
> URL: https://issues.apache.org/jira/browse/FLINK-24399
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / API
> Reporter: Timo Walther
> Assignee: Francesco Guardiani
> Priority: Major
> Labels: pull-request-available
>
> {{DataType}} is the API abstraction for declaring types and always includes
> the {{LogicalType}} as well. In order to ease the handling of this class, we
> should do the following additions:
> - {{DynamicTableFactory.Context#getPhysicalRowDataType(): DataType}}
> - {{DynamicTableFactory.Context#getPrimaryKeyFields(): int[]}}
> - static method {{DataType#getFieldNames: List<String>}} (empty for atomics)
> - static method {{DataType#getFieldTypes: List<DataType>}} as a synonym for
> {{getChildren}} (empty for atomics)
> - static method {{DataType#getFieldCount: int}} (0 for atomics)
> - static method {{DataType#projectFields(int[][]): DataType}} (like
> {{DataTypeUtils#projectRow}})
> - static method {{DataType#projectFields(int[]): DataType}} (like
> {{DataTypeUtils#projectRow}})
> - static method {{DataType#getFields(): List<DataTypes.Field>}} to simplify
> extraction of fields and allow connectors to filter out/manipulate fields
> based on connector specific logic
> - {{DataType#toInternal()}}
> - {{DataTypes#of(LogicalType)}}
> - {{DynamicTableSource.Context#createTypeInformation(LogicalType)}} in case a
> connector wants to work on logical types only
> - {{DynamicTableSink.Context#createTypeInformation(LogicalType)}} in case a
> connector wants to work on logical types only
> This should simplify implementations and avoid needs for internal utilities.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)