Skip to content

Commit 050615f

Browse files
committed
Add nanosecond-precision round-trip test for INT96 stats
Existing tests only used .000 millisecond timestamps, so the comparator's 8-byte unsigned-long nanos-of-day path was never exercised below minute granularity. New test covers same-day timestamps at 1ns, 1us, 1ms, mid-range, and max-of-day (23:59:59.999999999).
1 parent f3e9f7c commit 050615f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

parquet-hadoop/src/test/java/org/apache/parquet/statistics/TestInt96TimestampStatisticsRoundTrip.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,16 @@ public void testIncreasingDayDecreasingTime() throws IOException {
145145
String[] timestamps = {"2020-01-01T12:00:00.000", "2020-02-01T11:00:00.000", "2020-03-01T10:00:00.000"};
146146
runTimestampTest(timestamps);
147147
}
148+
149+
@Test
150+
public void testSameDayNanosecondPrecision() throws IOException {
151+
String[] timestamps = {
152+
"2020-01-01T00:00:00.000000001",
153+
"2020-01-01T00:00:00.000001000",
154+
"2020-01-01T00:00:00.001000000",
155+
"2020-01-01T12:34:56.123456789",
156+
"2020-01-01T23:59:59.999999999"
157+
};
158+
runTimestampTest(timestamps);
159+
}
148160
}

0 commit comments

Comments
 (0)