You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (Jira)" <ji...@apache.org> on 2021/10/04 15:42:00 UTC

[jira] [Closed] (FLINK-24399) Make handling of DataType less verbose

     [ https://issues.apache.org/jira/browse/FLINK-24399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Walther closed FLINK-24399.
--------------------------------
    Fix Version/s: 1.15.0
       Resolution: Fixed

Fixed in master:

commit ac203a7a26d78fe270bd9941bb721be53a893040
[table-common] Add DynamicTableFactory.Context#getPrimaryKeyIndexes and DynamicTableFactory.Context#getPhysicalRowDataType

commit 946a41c2fe8016b39c9737b1f926bed0d7a23e95
[table-common] Add DynamicTableSource.Context#createTypeInformation(LogicalType) and DynamicTableSink.Context#createTypeInformation(LogicalType)

commit 094bf1ead5ba0a02b6b4f711f991638da8076841
[table-common] Fix DataTypeUtils#flattenToNames javadoc

commit 3681e850ad01b973e0f2fbc3db70afd96bdfbec6
[table-common] Refactor ResolvedSchema#to[...]RowDataType() methods and add new ResolvedSchema#getPrimaryKeyIndexes

commit 66bd2ed652dce9c9eb3d03bc31ab89600b2c708d
[table-common] Improved DataType#getChildren javadoc

commit 083e4d41afa5b6d960a578b1d91ba0d3a817e1b1
[table-common] Add DataType methods to improve ergonomics when accessing row data type instances

commit b43e64bb71c234a815ff603c11a7cc76210e3c71
[table-common] Add DataType#toInternal

commit 826b10f935585641afba9b9273bbdb31a6b04ce9
[table-common] Add DataTypes#of(LogicalType)

> 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
>             Fix For: 1.15.0
>
>
> {{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)