@@ -130,6 +130,70 @@ TEST_F(IcebergPartitionIdGeneratorTest, partitionNameWithIdentityTransforms) {
130130  verifyPartitionComponents (partitionName, expectedComponents);
131131}
132132
133+ TEST_F (
134+     IcebergPartitionIdGeneratorTest,
135+     partitionNameWithTimestampIdentitySpecialValues) {
136+   std::vector<Timestamp> timestamps = {
137+       Timestamp (253402300800 , 100000000 ), //  +10000-01-01T00:00:00.1.
138+       Timestamp (-62170000000 , 0 ), //  -0001-11-29T19:33:20.
139+       Timestamp (-62135577748 , 999000000 ), //  0001-01-01T05:17:32.999.
140+       Timestamp (0 , 0 ), //  1970-01-01T00:00.
141+       Timestamp (1609459200 , 999000000 ), //  2021-01-01T00:00.
142+       Timestamp (1640995200 , 500000000 ), //  2022-01-01T00:00:00.5.
143+       Timestamp (1672531200 , 123000000 ), //  2023-01-01T00:00:00.123.
144+       Timestamp (-1 , 999000000 ), //  1969-12-31T23:59:59.999.
145+       Timestamp (1 , 1000000 ), //  1970-01-01T00:00:01.001.
146+       Timestamp (-62167219199 , 0 ), //  0000-01-01T00:00:01.
147+       Timestamp (-377716279140 , 321000000 ), //  -10000-01-01T01:01:00.321.
148+       Timestamp (253402304660 , 321000000 ), //  +10000-01-01T01:01:00.321.
149+       Timestamp (951782400 , 0 ), //  2000-02-29T00:00:00 (leap year).
150+       Timestamp (4107456000 , 0 ), //  2100-02-28T00:00:00 (not leap year).
151+       Timestamp (86400 , 0 ), //  1970-01-02T00:00:00.
152+       Timestamp (-86400 , 0 ), //  1969-12-31T00:00:00.
153+       Timestamp (1672531200 , 456000000 ), //  2023-01-01T00:00:00.456.
154+       Timestamp (1672531200 , 789000000 ), //  2023-01-01T00:00:00.789.
155+   };
156+ 
157+   std::vector<std::string> expectedPartitionNames = {
158+       " c_timestamp=%2B10000-01-01T00%3A00%3A00.1"  ,
159+       " c_timestamp=-0001-11-29T19%3A33%3A20"  ,
160+       " c_timestamp=0001-01-01T05%3A17%3A32.999"  ,
161+       " c_timestamp=1970-01-01T00%3A00"  ,
162+       " c_timestamp=2021-01-01T00%3A00%3A00.999"  ,
163+       " c_timestamp=2022-01-01T00%3A00%3A00.5"  ,
164+       " c_timestamp=2023-01-01T00%3A00%3A00.123"  ,
165+       " c_timestamp=1969-12-31T23%3A59%3A59.999"  ,
166+       " c_timestamp=1970-01-01T00%3A00%3A01.001"  ,
167+       " c_timestamp=0000-01-01T00%3A00%3A01"  ,
168+       " c_timestamp=-10000-08-24T19%3A21%3A00.321"  ,
169+       " c_timestamp=%2B10000-01-01T01%3A04%3A20.321"  ,
170+       " c_timestamp=2000-02-29T00%3A00"  ,
171+       " c_timestamp=2100-02-28T00%3A00"  ,
172+       " c_timestamp=1970-01-02T00%3A00"  ,
173+       " c_timestamp=1969-12-31T00%3A00"  ,
174+       " c_timestamp=2023-01-01T00%3A00%3A00.456"  ,
175+       " c_timestamp=2023-01-01T00%3A00%3A00.789"  ,
176+   };
177+ 
178+   auto  timestampVector = makeFlatVector<Timestamp>(timestamps);
179+   std::vector<std::string> columnNames = {" c_timestamp"  };
180+   std::vector<VectorPtr> columns = {timestampVector};
181+   std::vector<TypePtr> types = {TIMESTAMP ()};
182+   auto  rowVector = createRowVector (columnNames, columns);
183+ 
184+   std::vector<TransformType> transformTypes = {TransformType::kIdentity };
185+   auto  transforms = createColumnTransforms (columnNames, types, transformTypes);
186+   auto  generator = createGenerator (transforms);
187+   raw_vector<uint64_t > partitionIds (timestamps.size ());
188+   generator->run (rowVector, partitionIds);
189+ 
190+   for  (size_t  i = 0 ; i < timestamps.size (); ++i) {
191+     std::string partitionName =
192+         generator->partitionName (partitionIds[i], " null"  );
193+     ASSERT_EQ (partitionName, expectedPartitionNames[i]);
194+   }
195+ }
196+ 
133197TEST_F (IcebergPartitionIdGeneratorTest, partitionNameWithMixedTransforms) {
134198  auto  intVector = makeFlatVector<int32_t >(1 , [](auto ) { return  42 ; });
135199  auto  bigintVector =
0 commit comments