amoro icon indicating copy to clipboard operation
amoro copied to clipboard

[Flink] Support create and get timestamp(3) timestamp(0) type in the arctic table

Open YesOrNo828 opened this issue 3 years ago • 1 comments

Scenario: Create an iceberg table that has a timestamp-type column with a precision equal to 0 by Flink SQL.

Using the below DDL to create a watermark definition table like the iceberg table would be failed. create table hadoop_catalog.db.dim (id int, name string, opt timestamp(0), primary key (id) not enforced) ;

create table arctic_dim ( watermark for opt as opt - interval '5' second) like hadoop_catalog.db.dim;

org.apache.flink.table.api.ValidationException: Invalid data type of time field for watermark definition. The field must be of type TIMESTAMP(p) or TIMESTAMP_LTZ(p), the supported precision 'p' is from 0 to 3, but the time field type is TIMESTAMP(6)

The TypeToFlinkType default converts it to flink timestamp type with precision 6.

YesOrNo828 avatar Jul 21 '22 11:07 YesOrNo828

@YesOrNo828, users could case the TIMESTAMP(p)/TIMESTAMP_LTZ(p) to TIMESTAMP(3)/TIMESTAMP_LTZ(3), which has already been verified whether the watermark definition works well. Therefore, this issue could be closed and the watermark definition could provide an example in the document.

SteNicholas avatar Oct 11 '22 08:10 SteNicholas

@YesOrNo828, users could case the TIMESTAMP(p)/TIMESTAMP_LTZ(p) to TIMESTAMP(3)/TIMESTAMP_LTZ(3), which has already been verified whether the watermark definition works well. Therefore, this issue could be closed and the watermark definition could provide an example in the document.

@SteNicholas Thanks for your verification and I will close this issue.

zhoujinsong avatar Nov 15 '22 07:11 zhoujinsong