[ 
https://issues.apache.org/jira/browse/FLINK-24399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17421412#comment-17421412
 ] 

Ingo Bürk commented on FLINK-24399:
-----------------------------------

* DynamicTableFactory.Context#getPhysicalRowDataType(): DataType
 ** Definitely +1 to having such a method as a shortcut. I wonder if we can 
give it a name that makes it more obvious what it should be used for rather 
than going for technical descriptiveness?
 * DataType#getFieldDataTypes: List<DataType>
 ** Total nit and I'm OK with it either way, but wondering whether we could 
just shorten that to getFieldTypes. We're already in the DataType domain.
 * The projection methods seem slightly misnamed to me since the name suggests 
that a collection of something is returned. How about DataType#projectFields?

Overall big +1 to making life easier here and exposing things developers will 
inevitably need more directly instead of requiring them to find the correct 
util somewhere.

> 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
>            Priority: Major
>
> {{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[]}}
> - {{DataType#getFieldNames: List<String>}} (empty for atomics)
> - {{DataType#getFieldDataTypes: List<DataType>}} as a synonym for 
> {{getChildren}} (empty for atomics)
> - {{DataType#getFieldCount: int}} (0 for atomics)
> - {{DataType#getProjectedFields(int[][]): DataType}} (like 
> {{DataTypeUtils#projectRow}})
> - {{DataType#getProjectedFields(int[]): DataType}} (like 
> {{DataTypeUtils#projectRow}})
> This should simplify implementations and avoid needs for internal utilities.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to