zhjwpku commented on code in PR #238:
URL: https://github.com/apache/iceberg-cpp/pull/238#discussion_r2436471072


##########
src/iceberg/test/transform_test.cc:
##########
@@ -253,23 +262,43 @@ TEST(TransformLiteralTest, BucketTransform) {
 
   const std::vector<Case> cases = {
       {.source_type = iceberg::int32(),
-       .source = Literal::Int(42),
+       .source = Literal::Int(34),
+       .expected = Literal::Int(3)},
+      {.source_type = iceberg::int64(),
+       .source = Literal::Long(34),
+       .expected = Literal::Int(3)},
+      // decimal 14.20
+      {.source_type = iceberg::decimal(4, 2),
+       .source = Literal::MakeDecimal(1420, 4, 2),
        .expected = Literal::Int(3)},
+      // 2017-11-16
       {.source_type = iceberg::date(),
-       .source = Literal::Date(30000),
+       .source = Literal::Date(17486),
        .expected = Literal::Int(2)},
-      {.source_type = iceberg::int64(),
-       .source = Literal::Long(1234567890),
+      // // 22:31:08 in microseconds
+      {.source_type = iceberg::time(),
+       .source = Literal::Time(81068000000),
        .expected = Literal::Int(3)},
+      // // 2017-11-16T22:31:08 in microseconds
       {.source_type = iceberg::timestamp(),
-       .source = Literal::Timestamp(1622547800000000),
-       .expected = Literal::Int(1)},
+       .source = Literal::Timestamp(1510871468000000),
+       .expected = Literal::Int(3)},
+      // // 2017-11-16T22:31:08.000001 in microseconds
       {.source_type = iceberg::timestamp_tz(),
-       .source = Literal::TimestampTz(1622547800000000),
-       .expected = Literal::Int(1)},
+       .source = Literal::TimestampTz(1510871468000001),

Review Comment:
   2017-11-16T22:31:08 is from spec[1], here use it to replace the randomly 
selected timestamp by me.
   
   [1] https://iceberg.apache.org/spec/#appendix-b-32-bit-hash-requirements



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to