pitrou commented on code in PR #12528:
URL: https://github.com/apache/arrow/pull/12528#discussion_r873708485
##########
cpp/src/arrow/compute/kernels/scalar_temporal_test.cc:
##########
@@ -2611,6 +2611,309 @@ TEST_F(ScalarTemporalTest, TestRoundTemporal) {
CheckScalarUnary(op, unit, times, unit, round_15_years, &round_to_15_years);
}
+TEST_F(ScalarTemporalTest, TestCeilFloorRoundTemporalAmbiguous1) {
+ // Asia/Tehran switches from UTC+4:30 to UTC+3:30 on 2022-09-22 00:00:00
UTC+4:30.
+ // This causes an hour long ambiguous period in local time.
+ auto unit = timestamp(TimeUnit::MILLI, "Asia/Tehran");
+ auto options = RoundTemporalOptions(25, CalendarUnit::MINUTE);
+ const char* times = R"([
+ "2022-09-21 18:09:00", "2022-09-21 18:10:00", "2022-09-21 18:11:00",
+ "2022-09-21 18:19:00", "2022-09-21 18:20:00", "2022-09-21 18:21:00",
+ "2022-09-21 18:44:00", "2022-09-21 18:45:00", "2022-09-21 18:46:00",
+ "2022-09-21 19:09:00", "2022-09-21 19:10:00", "2022-09-21 19:11:00",
+ "2022-09-21 19:24:00", "2022-09-21 19:25:00", "2022-09-21 19:26:00",
+ "2022-09-21 19:34:00", "2022-09-21 19:35:00", "2022-09-21 19:36:00",
+ "2022-09-21 19:59:00", "2022-09-21 20:00:00", "2022-09-21 20:01:00",
+ "2022-09-21 20:24:00", "2022-09-21 20:25:00", "2022-09-21 20:26:00",
+ "2022-09-21 20:49:00", "2022-09-21 20:50:00", "2022-09-21 20:51:00"])";
+ const char* times_ceil = R"([
+ "2022-09-21 18:10:00", "2022-09-21 18:10:00", "2022-09-21 18:20:00",
+ "2022-09-21 18:20:00", "2022-09-21 18:20:00", "2022-09-21 18:45:00",
+ "2022-09-21 18:45:00", "2022-09-21 18:45:00", "2022-09-21 19:10:00",
+ "2022-09-21 19:10:00", "2022-09-21 19:10:00", "2022-09-21 19:35:00",
+ "2022-09-21 19:35:00", "2022-09-21 19:35:00", "2022-09-21 19:35:00",
+ "2022-09-21 19:35:00", "2022-09-21 19:35:00", "2022-09-21 20:00:00",
+ "2022-09-21 20:00:00", "2022-09-21 20:00:00", "2022-09-21 20:25:00",
+ "2022-09-21 20:25:00", "2022-09-21 20:25:00", "2022-09-21 20:50:00",
+ "2022-09-21 20:50:00", "2022-09-21 20:50:00", "2022-09-21 21:15:00"])";
+ const char* times_floor = R"([
+ "2022-09-21 17:45:00", "2022-09-21 18:10:00", "2022-09-21 18:10:00",
+ "2022-09-21 18:10:00", "2022-09-21 18:10:00", "2022-09-21 18:10:00",
+ "2022-09-21 18:20:00", "2022-09-21 18:45:00", "2022-09-21 18:45:00",
+ "2022-09-21 18:45:00", "2022-09-21 19:10:00", "2022-09-21 19:10:00",
+ "2022-09-21 19:10:00", "2022-09-21 19:10:00", "2022-09-21 19:10:00",
+ "2022-09-21 19:10:00", "2022-09-21 19:35:00", "2022-09-21 19:35:00",
+ "2022-09-21 19:35:00", "2022-09-21 20:00:00", "2022-09-21 20:00:00",
+ "2022-09-21 20:00:00", "2022-09-21 20:25:00", "2022-09-21 20:25:00",
+ "2022-09-21 20:25:00", "2022-09-21 20:50:00", "2022-09-21 20:50:00"])";
+ const char* times_round = R"([
+ "2022-09-21 18:10:00", "2022-09-21 18:10:00", "2022-09-21 18:10:00",
+ "2022-09-21 18:20:00", "2022-09-21 18:20:00", "2022-09-21 18:10:00",
+ "2022-09-21 18:45:00", "2022-09-21 18:45:00", "2022-09-21 18:45:00",
+ "2022-09-21 19:10:00", "2022-09-21 19:10:00", "2022-09-21 19:10:00",
+ "2022-09-21 19:35:00", "2022-09-21 19:35:00", "2022-09-21 19:35:00",
+ "2022-09-21 19:35:00", "2022-09-21 19:35:00", "2022-09-21 19:35:00",
+ "2022-09-21 20:00:00", "2022-09-21 20:00:00", "2022-09-21 20:00:00",
+ "2022-09-21 20:25:00", "2022-09-21 20:25:00", "2022-09-21 20:25:00",
+ "2022-09-21 20:50:00", "2022-09-21 20:50:00", "2022-09-21 20:50: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, TestCeilFloorRoundTemporalAmbiguous2) {
+ // Europe/Brussels switches from UTC+2:00 to UTC+1:00 on 2018-10-28 03:00:00
UTC+2:00
+ // This causes an hour long ambiguous period in local time.
+ auto unit = timestamp(TimeUnit::NANO, "Europe/Brussels");
+ auto options = RoundTemporalOptions(25, CalendarUnit::MINUTE);
+ const char* complete_times = R"([
+ "2018-10-27 23:05:00", "2018-10-27 23:06:00", "2018-10-27 23:07:00",
"2018-10-27 23:08:00",
+ "2018-10-27 23:09:00", "2018-10-27 23:10:00", "2018-10-27 23:11:00",
"2018-10-27 23:12:00",
+ "2018-10-27 23:13:00", "2018-10-27 23:14:00", "2018-10-27 23:15:00",
"2018-10-27 23:16:00",
+ "2018-10-27 23:17:00", "2018-10-27 23:18:00", "2018-10-27 23:19:00",
"2018-10-27 23:20:00",
+ "2018-10-27 23:21:00", "2018-10-27 23:22:00", "2018-10-27 23:23:00",
"2018-10-27 23:24:00",
+ "2018-10-27 23:25:00", "2018-10-27 23:26:00", "2018-10-27 23:27:00",
"2018-10-27 23:28:00",
+ "2018-10-27 23:29:00", "2018-10-27 23:30:00", "2018-10-27 23:31:00",
"2018-10-27 23:32:00",
+ "2018-10-27 23:33:00", "2018-10-27 23:34:00", "2018-10-27 23:35:00",
"2018-10-27 23:36:00",
+ "2018-10-27 23:37:00", "2018-10-27 23:38:00", "2018-10-27 23:39:00",
"2018-10-27 23:40:00",
+ "2018-10-27 23:41:00", "2018-10-27 23:42:00", "2018-10-27 23:43:00",
"2018-10-27 23:44:00",
+ "2018-10-27 23:45:00", "2018-10-27 23:46:00", "2018-10-27 23:47:00",
"2018-10-27 23:48:00",
+ "2018-10-27 23:49:00", "2018-10-27 23:50:00", "2018-10-27 23:51:00",
"2018-10-27 23:52:00",
+ "2018-10-27 23:53:00", "2018-10-27 23:54:00", "2018-10-27 23:55:00",
"2018-10-27 23:56:00",
+ "2018-10-27 23:57:00", "2018-10-27 23:58:00", "2018-10-27 23:59:00",
"2018-10-28 00:00:00",
+ "2018-10-28 00:01:00", "2018-10-28 00:02:00", "2018-10-28 00:03:00",
"2018-10-28 00:04:00",
+ "2018-10-28 00:05:00", "2018-10-28 00:06:00", "2018-10-28 00:07:00",
"2018-10-28 00:08:00",
+ "2018-10-28 00:09:00", "2018-10-28 00:10:00", "2018-10-28 00:11:00",
"2018-10-28 00:12:00",
+ "2018-10-28 00:13:00", "2018-10-28 00:14:00", "2018-10-28 00:15:00",
"2018-10-28 00:16:00",
+ "2018-10-28 00:17:00", "2018-10-28 00:18:00", "2018-10-28 00:19:00",
"2018-10-28 00:20:00",
+ "2018-10-28 00:21:00", "2018-10-28 00:22:00", "2018-10-28 00:23:00",
"2018-10-28 00:24:00",
+ "2018-10-28 00:25:00", "2018-10-28 00:26:00", "2018-10-28 00:27:00",
"2018-10-28 00:28:00",
+ "2018-10-28 00:29:00", "2018-10-28 00:30:00", "2018-10-28 00:31:00",
"2018-10-28 00:32:00",
+ "2018-10-28 00:33:00", "2018-10-28 00:34:00", "2018-10-28 00:35:00",
"2018-10-28 00:36:00",
+ "2018-10-28 00:37:00", "2018-10-28 00:38:00", "2018-10-28 00:39:00",
"2018-10-28 00:40:00",
+ "2018-10-28 00:41:00", "2018-10-28 00:42:00", "2018-10-28 00:43:00",
"2018-10-28 00:44:00",
+ "2018-10-28 00:45:00", "2018-10-28 00:46:00", "2018-10-28 00:47:00",
"2018-10-28 00:48:00",
+ "2018-10-28 00:49:00", "2018-10-28 00:50:00", "2018-10-28 00:51:00",
"2018-10-28 00:52:00",
+ "2018-10-28 00:53:00", "2018-10-28 00:54:00", "2018-10-28 00:55:00",
"2018-10-28 00:56:00",
+ "2018-10-28 00:57:00", "2018-10-28 00:58:00", "2018-10-28 00:59:00",
"2018-10-28 01:00:00",
+ "2018-10-28 01:01:00", "2018-10-28 01:02:00", "2018-10-28 01:03:00",
"2018-10-28 01:04:00",
+ "2018-10-28 01:05:00", "2018-10-28 01:06:00", "2018-10-28 01:07:00",
"2018-10-28 01:08:00",
+ "2018-10-28 01:09:00", "2018-10-28 01:10:00", "2018-10-28 01:11:00",
"2018-10-28 01:12:00",
+ "2018-10-28 01:13:00", "2018-10-28 01:14:00", "2018-10-28 01:15:00",
"2018-10-28 01:16:00",
+ "2018-10-28 01:17:00", "2018-10-28 01:18:00", "2018-10-28 01:19:00",
"2018-10-28 01:20:00",
+ "2018-10-28 01:21:00", "2018-10-28 01:22:00", "2018-10-28 01:23:00",
"2018-10-28 01:24:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:26:00", "2018-10-28 01:27:00",
"2018-10-28 01:28:00",
+ "2018-10-28 01:29:00", "2018-10-28 01:30:00", "2018-10-28 01:31:00",
"2018-10-28 01:32:00",
+ "2018-10-28 01:33:00", "2018-10-28 01:34:00", "2018-10-28 01:35:00",
"2018-10-28 01:36:00",
+ "2018-10-28 01:37:00", "2018-10-28 01:38:00", "2018-10-28 01:39:00",
"2018-10-28 01:40:00",
+ "2018-10-28 01:41:00", "2018-10-28 01:42:00", "2018-10-28 01:43:00",
"2018-10-28 01:44:00",
+ "2018-10-28 01:45:00", "2018-10-28 01:46:00", "2018-10-28 01:47:00",
"2018-10-28 01:48:00",
+ "2018-10-28 01:49:00", "2018-10-28 01:50:00", "2018-10-28 01:51:00",
"2018-10-28 01:52:00",
+ "2018-10-28 01:53:00", "2018-10-28 01:54:00", "2018-10-28 01:55:00",
"2018-10-28 01:56:00",
+ "2018-10-28 01:57:00", "2018-10-28 01:58:00", "2018-10-28 01:59:00",
"2018-10-28 02:00:00",
+ "2018-10-28 02:01:00", "2018-10-28 02:02:00", "2018-10-28 02:03:00",
"2018-10-28 02:04:00",
+ "2018-10-28 02:05:00", "2018-10-28 02:06:00", "2018-10-28 02:07:00",
"2018-10-28 02:08:00",
+ "2018-10-28 02:09:00", "2018-10-28 02:10:00", "2018-10-28 02:11:00",
"2018-10-28 02:12:00",
+ "2018-10-28 02:13:00", "2018-10-28 02:14:00", "2018-10-28 02:15:00",
"2018-10-28 02:16:00"])";
+
+ const char* complete_times_floor = R"([
+ "2018-10-27 22:45:00", "2018-10-27 22:45:00", "2018-10-27 22:45:00",
"2018-10-27 22:45:00",
+ "2018-10-27 22:45:00", "2018-10-27 23:10:00", "2018-10-27 23:10:00",
"2018-10-27 23:10:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:10:00", "2018-10-27 23:10:00",
"2018-10-27 23:10:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:10:00", "2018-10-27 23:10:00",
"2018-10-27 23:10:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:10:00", "2018-10-27 23:10:00",
"2018-10-27 23:10:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:10:00", "2018-10-27 23:10:00",
"2018-10-27 23:10:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:10:00", "2018-10-27 23:10:00",
"2018-10-27 23:10:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:10:00", "2018-10-27 23:35:00",
"2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
"2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
"2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
"2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
"2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
"2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
"2018-10-27 23:45:00",
+ "2018-10-27 23:45:00", "2018-10-27 23:45:00", "2018-10-27 23:45:00",
"2018-10-27 23:45:00",
+ "2018-10-27 23:45:00", "2018-10-27 23:45:00", "2018-10-27 23:45:00",
"2018-10-27 23:45:00",
+ "2018-10-27 23:45:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
"2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
"2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
"2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
"2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
"2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
"2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:35:00",
"2018-10-28 00:35:00",
+ "2018-10-28 00:35:00", "2018-10-28 00:35:00", "2018-10-28 00:35:00",
"2018-10-28 00:35:00",
+ "2018-10-28 00:35:00", "2018-10-28 00:35:00", "2018-10-28 00:35:00",
"2018-10-28 00:35:00",
+ "2018-10-28 00:35:00", "2018-10-28 00:35:00", "2018-10-28 00:35:00",
"2018-10-28 00:35:00",
+ "2018-10-28 00:35:00", "2018-10-28 00:35:00", "2018-10-28 00:35:00",
"2018-10-28 00:35:00",
+ "2018-10-28 00:35:00", "2018-10-28 00:35:00", "2018-10-28 00:35:00",
"2018-10-28 00:35:00",
+ "2018-10-28 00:35:00", "2018-10-28 00:35:00", "2018-10-28 00:35:00",
"2018-10-28 01:00:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:00:00", "2018-10-28 01:00:00",
"2018-10-28 01:00:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:00:00", "2018-10-28 01:00:00",
"2018-10-28 01:00:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:00:00", "2018-10-28 01:00:00",
"2018-10-28 01:00:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:00:00", "2018-10-28 01:00:00",
"2018-10-28 01:00:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:00:00", "2018-10-28 01:00:00",
"2018-10-28 01:00:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:00:00", "2018-10-28 01:00:00",
"2018-10-28 01:00:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:25:00", "2018-10-28 01:25:00",
"2018-10-28 01:25:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:25:00", "2018-10-28 01:25:00",
"2018-10-28 01:25:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:25:00", "2018-10-28 01:25:00",
"2018-10-28 01:25:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:25:00", "2018-10-28 01:25:00",
"2018-10-28 01:25:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:25:00", "2018-10-28 01:25:00",
"2018-10-28 01:25:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:25:00", "2018-10-28 01:25:00",
"2018-10-28 01:25:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:50:00", "2018-10-28 01:50:00",
"2018-10-28 01:50:00",
+ "2018-10-28 01:50:00", "2018-10-28 01:50:00", "2018-10-28 01:50:00",
"2018-10-28 01:50:00",
+ "2018-10-28 01:50:00", "2018-10-28 01:50:00", "2018-10-28 01:50:00",
"2018-10-28 01:50:00",
+ "2018-10-28 01:50:00", "2018-10-28 01:50:00", "2018-10-28 01:50:00",
"2018-10-28 01:50:00",
+ "2018-10-28 01:50:00", "2018-10-28 01:50:00", "2018-10-28 01:50:00",
"2018-10-28 01:50:00",
+ "2018-10-28 01:50:00", "2018-10-28 01:50:00", "2018-10-28 01:50:00",
"2018-10-28 01:50:00",
+ "2018-10-28 01:50:00", "2018-10-28 01:50:00", "2018-10-28 02:15:00",
"2018-10-28 02:15:00"])";
+
+ const char* times = R"([
+ "2018-10-27 22:44:00", "2018-10-27 22:45:00", "2018-10-27 22:46:00",
+ "2018-10-27 23:09:00", "2018-10-27 23:10:00", "2018-10-27 23:11:00",
+ "2018-10-27 23:34:00", "2018-10-27 23:35:00", "2018-10-27 23:36:00",
+ "2018-10-27 23:44:00", "2018-10-27 23:45:00", "2018-10-27 23:46:00",
+ "2018-10-27 23:46:00", "2018-10-28 00:00:00", "2018-10-28 00:09:00",
+ "2018-10-28 00:09:00", "2018-10-28 00:10:00", "2018-10-28 00:11:00",
+ "2018-10-28 00:34:00", "2018-10-28 00:35:00", "2018-10-28 00:36:00",
+ "2018-10-28 00:59:00", "2018-10-28 01:00:00", "2018-10-28 01:01:00",
+ "2018-10-28 01:24:00", "2018-10-28 01:25:00", "2018-10-28 01:26:00",
+ "2018-10-28 01:49:00", "2018-10-28 01:50:00", "2018-10-28 01:51:00",
+ "2018-10-28 02:14:00", "2018-10-28 02:15:00", "2018-10-28 02:16:00"])";
+ const char* times_ceil = R"([
+ "2018-10-27 22:45:00", "2018-10-27 22:45:00", "2018-10-27 23:10:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:10:00", "2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:45:00",
+ "2018-10-27 23:45:00", "2018-10-27 23:45:00", "2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:35:00",
+ "2018-10-28 00:35:00", "2018-10-28 00:35:00", "2018-10-28 01:00:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:00:00", "2018-10-28 01:25:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:25:00", "2018-10-28 01:50:00",
+ "2018-10-28 01:50:00", "2018-10-28 01:50:00", "2018-10-28 02:15:00",
+ "2018-10-28 02:15:00", "2018-10-28 02:15:00", "2018-10-28 02:40:00"])";
+ const char* times_floor = R"([
+ "2018-10-27 22:20:00", "2018-10-27 22:45:00", "2018-10-27 22:45:00",
+ "2018-10-27 22:45:00", "2018-10-27 23:10:00", "2018-10-27 23:10:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:45:00", "2018-10-27 23:45:00",
+ "2018-10-27 23:45:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:35:00", "2018-10-28 00:35:00",
+ "2018-10-28 00:35:00", "2018-10-28 01:00:00", "2018-10-28 01:00:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:25:00", "2018-10-28 01:25:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:50:00", "2018-10-28 01:50:00",
+ "2018-10-28 01:50:00", "2018-10-28 02:15:00", "2018-10-28 02:15:00"])";
+ const char* times_round = R"([
+ "2018-10-27 22:45:00", "2018-10-27 22:45:00", "2018-10-27 22:45:00",
+ "2018-10-27 23:10:00", "2018-10-27 23:10:00", "2018-10-27 23:10:00",
+ "2018-10-27 23:35:00", "2018-10-27 23:35:00", "2018-10-27 23:35:00",
+ "2018-10-27 23:45:00", "2018-10-27 23:45:00", "2018-10-27 23:35:00",
+ "2018-10-27 23:35:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
+ "2018-10-28 00:10:00", "2018-10-28 00:10:00", "2018-10-28 00:10:00",
+ "2018-10-28 00:35:00", "2018-10-28 00:35:00", "2018-10-28 00:35:00",
+ "2018-10-28 01:00:00", "2018-10-28 01:00:00", "2018-10-28 01:00:00",
+ "2018-10-28 01:25:00", "2018-10-28 01:25:00", "2018-10-28 01:25:00",
+ "2018-10-28 01:50:00", "2018-10-28 01:50:00", "2018-10-28 01:50:00",
+ "2018-10-28 02:15:00", "2018-10-28 02:15:00", "2018-10-28 02:15:00"])";
+
+ CheckScalarUnary("floor_temporal", unit, complete_times, unit,
complete_times_floor,
+ &options);
+ 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, TestCeilFloorRoundTemporalNonexistent1) {
+ // Asia/Tehran switches from UTC+3:30 to UTC+4:30 on 2022-03-22 00:00:00
UTC+3:30
+ // This causes an hour long non-existing period in local time.
+ auto unit = timestamp(TimeUnit::SECOND, "Asia/Tehran");
+ auto options = RoundTemporalOptions(16, CalendarUnit::MINUTE);
+ const char* times = R"([
+ "2022-03-21 19:30:00", "2022-03-21 20:00:00", "2022-03-21 20:30:00"])";
+ const char* times_ceil = R"([
+ "2022-03-21 19:42:00", "2022-03-21 20:14:00", "2022-03-21 20:34:00"])";
+ const char* times_floor = R"([
+ "2022-03-21 19:26:00", "2022-03-21 19:58:00", "2022-03-21 20:18:00"])";
Review Comment:
This still doesn't work: there are 20 minutes of local time between
`2022-03-21 19:58:00` and `2022-03-21 20:18:00`, which is not a multiple of 16,
so the two timestamps cannot be _both_ multiples of 16.
--
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]