-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[core] Support timestamp type in Iceberg compatibility #4318
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
Conversation
| | `TIMESTAMP`* | `timestamp` | | ||
| | `TIMESTAMP_LTZ`* | `timestamptz` | | ||
|
|
||
| *: `TIMESTAMP` and `TIMESTAMP_LTZ` type only support precision from 4 to 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from 4 to 6.
| + " v_varbinary VARBINARY(20),\n" | ||
| + " v_date DATE\n" | ||
| + " v_date DATE,\n" | ||
| // it seems that Iceberg Flink connector has some bug when filtering a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the bug link?
| case TIMESTAMP_WITHOUT_TIME_ZONE: | ||
| case TIMESTAMP_WITH_LOCAL_TIME_ZONE: | ||
| int timestampPrecision = ((TimestampType) type).getPrecision(); | ||
| long timestampLong = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the order of these two statements, for example:
Preconditions.checkArgument(
timestampPrecision > 3 && timestampPrecision <= 6,
"Paimon Iceberg compatibility only support timestamp type with precision from 4 to 6.");
long timestampLong =
ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getLong();
| "decimal(%d, %d)", decimalType.getPrecision(), decimalType.getScale()); | ||
| case TIMESTAMP_WITHOUT_TIME_ZONE: | ||
| int timestampPrecision = ((TimestampType) dataType).getPrecision(); | ||
| Preconditions.checkArgument( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are four place check this precision.
Should we extract this to reduce common code?
JingsongLi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Purpose
TIMESTAMPis a widely used data type. This PR supportsTIMESTAMPandTIMESTAMP_LTZtype in Iceberg compatibility.Tests
Unit tests and IT cases.
API and Format
No format changes.
Documentation
Document is also added.