You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/18 14:04:34 UTC

[GitHub] [arrow] jorisvandenbossche commented on a diff in pull request #12528: ARROW-15251: [C++] Temporal floor/ceil/round handle ambiguous/nonexistent local time

jorisvandenbossche commented on code in PR #12528:
URL: https://github.com/apache/arrow/pull/12528#discussion_r875939346


##########
cpp/src/arrow/compute/kernels/scalar_temporal_test.cc:
##########
@@ -2854,17 +2854,66 @@ TEST_F(ScalarTemporalTest, TestCeilFloorRoundTemporalNonexistent2) {
       R"(["2015-03-29 00:52:00", "2015-03-29 01:12:00", "2015-03-29 01:12:00",
           "2015-03-29 01:12:00", "2015-03-29 01:12:00", "2015-03-29 01:12:00"])";
   const char* times_floor =
-      R"(["2015-03-29 00:52:00", "2015-03-29 00:52:00", "2015-03-29 00:52:00",
-          "2015-03-29 00:52:00", "2015-03-29 00:52:00", "2015-03-29 01:12:00"])";
+      R"(["2015-03-29 00:52:00", "2015-03-29 00:56:00", "2015-03-29 00:56:00",
+          "2015-03-29 00:56:00", "2015-03-29 00:56:00", "2015-03-29 01:12:00"])";
   const char* times_round =
-      R"(["2015-03-29 00:52:00", "2015-03-29 01:08:00", "2015-03-29 01:12:00",
+      R"(["2015-03-29 00:52:00", "2015-03-29 00:56:00", "2015-03-29 01:12:00",
           "2015-03-29 01:12:00", "2015-03-29 01:12:00", "2015-03-29 01:12:00"])";
 
   CheckScalarUnary("ceil_temporal", unit, times, unit, times_ceil, &options);
   CheckScalarUnary("floor_temporal", unit, times, unit, times_floor, &options);
   CheckScalarUnary("round_temporal", unit, times, unit, times_round, &options);
 }
 
+TEST_F(ScalarTemporalTest, TestCeilFloorRoundTemporalDSTJump) {
+  // Europe/Brussels switches from UTC+2:00 to UTC+1:00 on 2015-10-29 03:00:00 UTC+2:00
+  // This causes an hour long ambiguous period in local time.
+  // Europe/Brussels switches from UTC+1:00 to UTC+2:00 on 2018-03-28 02:00:00 UTC+1:00
+  // This causes an hour long non-existing period in local time.

Review Comment:
   ```suggestion
     // Europe/Brussels switches from UTC+2:00 to UTC+1:00 on 2018-10-29 03:00:00 UTC+2:00
     // This causes an hour long ambiguous period in local time.
     // Europe/Brussels switches from UTC+1:00 to UTC+2:00 on 2015-03-28 02:00:00 UTC+1:00
     // This causes an hour long non-existing period in local time.
   ```
   
   ? (in any case it doesn't match with what is in the test below)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org