Reputation: 163
Flink Table/SQL has a lot of packages about DataType system, including:
I'm rather confusing about the relation ship among the packages, can anyone give me some tips to understanding the idea of Flink developers? Thanks a lot!
Upvotes: 0
Views: 507
Reputation: 2654
org.apache.flink.table.api.Types
: Contains the old type system that was not very well aligned with SQL types. Don't use it anymore. It will be removed soon.
org.apache.flink.table.api.DataTypes
: The main API class for expressing a DataType
. It contains a full list of all available data types, builders, and good documentation.
org.apache.flink.table.types.DataType
: Container classes that are produced by the API org.apache.flink.table.api.DataTypes
.
org.apache.flink.table.data
: Structures for storing the actual payload. Data types are describing the metadata (input and output types etc.). This package contains the internal structures that are used by the runtime and Flink-provided connectors. It requires some advanced knowledge to use those classes, which is why Row
is the default representation in the Java Table API and not RowData
for representing a table's row. As a user this package is mostly not relevant for you. The internal data structures work on binary data. As a user you can express row's with Row
and they will be converted to RowData
by Flink.
Upvotes: 1