-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Apache Iceberg version
main (development)
Query engine
None
Please describe the bug 🐞
While fetching the initial default values for columns of type nanosecond timestamp, Long is returned instead of the generic types.
The reason being:
| public static Object internalToGeneric(Type type, Object value) { | |
| if (null == value) { | |
| return null; | |
| } | |
| switch (type.typeId()) { | |
| case DATE: | |
| return DateTimeUtil.dateFromDays((Integer) value); | |
| case TIME: | |
| return DateTimeUtil.timeFromMicros((Long) value); | |
| case TIMESTAMP: | |
| if (((Types.TimestampType) type).shouldAdjustToUTC()) { | |
| return DateTimeUtil.timestamptzFromMicros((Long) value); | |
| } else { | |
| return DateTimeUtil.timestampFromMicros((Long) value); | |
| } | |
| case FIXED: | |
| return ByteBuffers.toByteArray((ByteBuffer) value); | |
| } | |
| return value; |
The internalToGeneric method only handles TIMESTAMP not the TIMESTAMP_NANO
Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working