Skip to content

Commit 6ebb533

Browse files
author
Q8Webmaster
committed
revert: remove IcebergConversions changes from parquet PR (will go in separate PR)
1 parent b9618ac commit 6ebb533

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

paimon-core/src/main/java/org/apache/paimon/iceberg/manifest/IcebergConversions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private static Timestamp timestampFromBytes(byte[] bytes, int precision) {
131131
precision >= 3 && precision <= 6,
132132
"Paimon Iceberg compatibility only support timestamp type with precision from 3 to 6.");
133133
long encoded = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getLong();
134-
return Timestamp.fromMicros(encoded);
134+
return precision == 3 ? Timestamp.fromEpochMillis(encoded) : Timestamp.fromMicros(encoded);
135135
}
136136

137137
private static ByteBuffer timeToByteBuffer(int millisOfDay, int precision) {

paimon-core/src/test/java/org/apache/paimon/iceberg/manifest/IcebergConversionsTimestampTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ void testToPaimonObjectForTimestamp(int precision, long serializedMicros, String
101101

102102
private static Stream<Arguments> provideTimestampToPaimonCases() {
103103
return Stream.of(
104-
Arguments.of(3, -1356022717123000L, "1927-01-12T07:01:22.877"),
105-
Arguments.of(3, 1713790983524000L, "2024-04-22T13:03:03.524"),
104+
// Provide binary in micros; p=3..6 should all parse as micros
105+
Arguments.of(3, -1356022717123L, "1927-01-12T07:01:22.877"),
106+
Arguments.of(3, 1713790983524L, "2024-04-22T13:03:03.524"),
106107
Arguments.of(6, 1640690931207203L, "2021-12-28T11:28:51.207203"));
107108
}
108109

0 commit comments

Comments
 (0)