Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discuss][api-draft] SeaTunnel DataType & Java Class & Engine DataType #2024

Closed
3 tasks done
ashulin opened this issue Jun 17, 2022 · 4 comments
Closed
3 tasks done

Comments

@ashulin
Copy link
Member

ashulin commented Jun 17, 2022

Search before asking

  • I had searched in the feature and found no similar feature requirement.

Description

I found that in the current api-draft branch, everyone handles data types differently, which makes the end-to-end test easy to fail, so I expect to be able to determine the data types supported by SeaTunnel, and the corresponding Java Class, Flink data types, Spark data types.

Below is my idea:

The SQL Type of Seatunnel is an enumeration of Data types and may be used as SQL keywords.
Data Type contains specific type information, such as precision.

SeaTunnel Row Java Class SeaTunnel SQL Type SeaTunnel DataType Flink TypeInfo Spark DataType
java.lang.String STRING BasicType.STRING BasicTypeInfo.STRING_TYPE_INFO DataTypes.StringType
java.lang.Boolean BOOLEAN BasicType.BOOLEAN BasicTypeInfo.BOOLEAN_TYPE_INFO DataTypes.BooleanType
java.lang.Byte TINYINT BasicType.BYTE BasicTypeInfo.BYTE_TYPE_INFO DataTypes.ByteType
java.lang.Short SMALLINT BasicType.SHORT BasicTypeInfo.SHORT_TYPE_INFO DataTypes.ShortType
java.lang.Integer INT BasicType.INT BasicTypeInfo.INT_TYPE_INFO DataTypes.IntegerType
java.lang.Long BIGINT BasicType.LONG BasicTypeInfo.LONG_TYPE_INFO DataTypes.LongType
java.lang.Float FLOAT BasicType.FLOAT BasicTypeInfo.FLOAT_TYPE_INFO DataTypes.FloatType
java.lang.Double DOUBLE BasicType.DOUBLE BasicTypeInfo.DOUBLE_TYPE_INFO DataTypes.DoubleType
java.math.BigDecimal DECIMAL BasicType.BIG_DECIMAL BasicTypeInfo.BIG_DEC_TYPE_INFO DecimalType
java.time.LocalDate DATE LocalTimeType.LOCAL_DATE LocalTimeTypeInfo.LOCAL_DATE DataTypes.DateType
java.time.LocalTime TIME LocalTimeType.LOCAL_TIME LocalTimeTypeInfo.LOCAL_TIME DataTypes.TimestampType
java.time.LocalDateTime TIMESTAMP LocalTimeType.LOCAL_DATE_TIME LocalTimeTypeInfo.LOCAL_DATE_TIME DataTypes.TimestampType
byte[] BYTES PrimitiveArrayType.PRIMITIVE_BYTE_ARRAY PrimitiveArrayTypeInfo.BYTE_PRIMITIVE_ARRAY_TYPE_INFO DataTypes.BinaryType
T[] ARRAY ArrayType BasicArrayTypeInfo ArrayType
java.util.Map<K, V> MAP MapType<K, V> MapTypeInfo<K, V> MapType<K,V>

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@ashulin
Copy link
Member Author

ashulin commented Jun 17, 2022

Do we want to support TIMESTAMP WITH TIMEZONE? Or other?
Currently, the DECIMAL type does not contain information such as precision, is there any need for improvement?

@EricJoy2048
Copy link
Member

Do we want to support TIMESTAMP WITH TIMEZONE? Or other?
Currently, the DECIMAL type does not contain information such as precision, is there any need for improvement?

Yes. Decimal is need precision I think.

@hk-lrzy
Copy link
Contributor

hk-lrzy commented Jun 22, 2022

Do we want to support TIMESTAMP WITH TIMEZONE? Or other?
Currently, the DECIMAL type does not contain information such as precision, is there any need for improvement?

Yes. Decimal is need precision I think.

agree, and i think we need alignment source & sink precison value if there have differents.

@Hisoka-X
Copy link
Member

Close by #2052

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants