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/01/13 00:31:13 UTC

[GitHub] [arrow] rok opened a new pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

rok opened a new pull request #12137:
URL: https://github.com/apache/arrow/pull/12137


   [ARROW-14095](https://issues.apache.org/jira/browse/ARROW-14095)


-- 
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



[GitHub] [arrow] ursabot edited a comment on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1025777715


   Benchmark runs are scheduled for baseline = d8f8c09622adad19cd054b220665b1313b52c15d and contender = d7473260ba73c2a5bdb68f1505afcdea7884f494. d7473260ba73c2a5bdb68f1505afcdea7884f494 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/8e0a9ef657784de2b9ef9f2221bbf6a1...a7744e7ac02c4137bb5469121645f113/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/efb8911d0d8246b6a51e759646929992...6b4a83b2b6f6448a926ee740f1a1814c/)
   [Finished :arrow_down:0.73% :arrow_up:0.73%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/f269d8e6c8134f0faeea0101e497096d...31d4d24bd55d4eefa12526d1517573b9/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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



[GitHub] [arrow] lidavidm commented on a change in pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
lidavidm commented on a change in pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#discussion_r794554238



##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
##########
@@ -1030,6 +1030,80 @@ TEST_F(ScalarTemporalTest, TestTemporalSubtractDateAndDurationChecked) {
   CheckScalarBinary(op, dates64, durations_us, timestamps_us);
 }
 
+TEST_F(ScalarTemporalTest, TestTemporalSubtractTimestampAndDuration) {
+  std::string op = "subtract";
+  for (auto tz : {"", "UTC", "Pacific/Marquesas"}) {
+    auto timestamp_unit_s = timestamp(TimeUnit::SECOND, tz);
+    auto duration_unit_s = duration(TimeUnit::SECOND);
+    auto timestamp_unit_ms = timestamp(TimeUnit::MILLI, tz);
+    auto duration_unit_ms = duration(TimeUnit::MILLI);
+    auto timestamp_unit_us = timestamp(TimeUnit::MICRO, tz);
+    auto duration_unit_us = duration(TimeUnit::MICRO);
+    auto timestamp_unit_ns = timestamp(TimeUnit::NANO, tz);
+    auto duration_unit_ns = duration(TimeUnit::NANO);
+
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_s, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_s, seconds_between),
+                      ArrayFromJSON(timestamp_unit_s, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ms, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ms, milliseconds_between),
+                      ArrayFromJSON(timestamp_unit_ms, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_us, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_us, microseconds_between),
+                      ArrayFromJSON(timestamp_unit_us, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ns, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ns, nanoseconds_between),
+                      ArrayFromJSON(timestamp_unit_ns, times_seconds_precision));
+  }
+
+  auto seconds_3 = ArrayFromJSON(timestamp(TimeUnit::SECOND), R"([3, null])");
+  auto milliseconds_2k = ArrayFromJSON(duration(TimeUnit::MILLI), R"([2000, null])");
+  auto milliseconds_1k = ArrayFromJSON(timestamp(TimeUnit::MILLI), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);
+
+  auto seconds_3_tz = ArrayFromJSON(timestamp(TimeUnit::SECOND, "UTC"), R"([3, null])");
+  auto milliseconds_1k_tz =

Review comment:
       It seems the _tz variants aren't used here

##########
File path: docs/source/cpp/compute.rst
##########
@@ -450,9 +450,9 @@ Mixed time resolution temporal inputs will be cast to finest input resolution.
 +------------------+--------+----------------------------+----------------------------+-------+
 | sign             | Unary  | Numeric                    | Int8/Float32/Float64       | \(2)  |
 +------------------+--------+----------------------------+----------------------------+-------+
-| subtract         | Binary | Numeric/Date/Duration      | Numeric/Date/Duration      | \(1)  |
+| subtract         | Binary | Numeric/Timestamp/Duration | Numeric/Timestamp/Duration | \(1)  |

Review comment:
       Temporal instead of Timestamp?

##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
##########
@@ -1030,6 +1030,80 @@ TEST_F(ScalarTemporalTest, TestTemporalSubtractDateAndDurationChecked) {
   CheckScalarBinary(op, dates64, durations_us, timestamps_us);
 }
 
+TEST_F(ScalarTemporalTest, TestTemporalSubtractTimestampAndDuration) {
+  std::string op = "subtract";
+  for (auto tz : {"", "UTC", "Pacific/Marquesas"}) {
+    auto timestamp_unit_s = timestamp(TimeUnit::SECOND, tz);
+    auto duration_unit_s = duration(TimeUnit::SECOND);
+    auto timestamp_unit_ms = timestamp(TimeUnit::MILLI, tz);
+    auto duration_unit_ms = duration(TimeUnit::MILLI);
+    auto timestamp_unit_us = timestamp(TimeUnit::MICRO, tz);
+    auto duration_unit_us = duration(TimeUnit::MICRO);
+    auto timestamp_unit_ns = timestamp(TimeUnit::NANO, tz);
+    auto duration_unit_ns = duration(TimeUnit::NANO);
+
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_s, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_s, seconds_between),
+                      ArrayFromJSON(timestamp_unit_s, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ms, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ms, milliseconds_between),
+                      ArrayFromJSON(timestamp_unit_ms, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_us, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_us, microseconds_between),
+                      ArrayFromJSON(timestamp_unit_us, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ns, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ns, nanoseconds_between),
+                      ArrayFromJSON(timestamp_unit_ns, times_seconds_precision));
+  }
+
+  auto seconds_3 = ArrayFromJSON(timestamp(TimeUnit::SECOND), R"([3, null])");
+  auto milliseconds_2k = ArrayFromJSON(duration(TimeUnit::MILLI), R"([2000, null])");
+  auto milliseconds_1k = ArrayFromJSON(timestamp(TimeUnit::MILLI), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);
+
+  auto seconds_3_tz = ArrayFromJSON(timestamp(TimeUnit::SECOND, "UTC"), R"([3, null])");
+  auto milliseconds_1k_tz =
+      ArrayFromJSON(timestamp(TimeUnit::MILLI, "UTC"), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);
+}
+
+TEST_F(ScalarTemporalTest, TestTemporalSubtractCheckedTimestampAndDuration) {
+  std::string op = "subtract_checked";
+  for (auto tz : {"", "UTC", "Pacific/Marquesas"}) {
+    auto timestamp_unit_s = timestamp(TimeUnit::SECOND, tz);
+    auto duration_unit_s = duration(TimeUnit::SECOND);
+    auto timestamp_unit_ms = timestamp(TimeUnit::MILLI, tz);
+    auto duration_unit_ms = duration(TimeUnit::MILLI);
+    auto timestamp_unit_us = timestamp(TimeUnit::MICRO, tz);
+    auto duration_unit_us = duration(TimeUnit::MICRO);
+    auto timestamp_unit_ns = timestamp(TimeUnit::NANO, tz);
+    auto duration_unit_ns = duration(TimeUnit::NANO);
+
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_s, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_s, seconds_between),
+                      ArrayFromJSON(timestamp_unit_s, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ms, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ms, milliseconds_between),
+                      ArrayFromJSON(timestamp_unit_ms, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_us, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_us, microseconds_between),
+                      ArrayFromJSON(timestamp_unit_us, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ns, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ns, nanoseconds_between),
+                      ArrayFromJSON(timestamp_unit_ns, times_seconds_precision));
+  }
+
+  auto seconds_3 = ArrayFromJSON(timestamp(TimeUnit::SECOND), R"([3, null])");
+  auto milliseconds_2k = ArrayFromJSON(duration(TimeUnit::MILLI), R"([2000, null])");
+  auto milliseconds_1k = ArrayFromJSON(timestamp(TimeUnit::MILLI), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);
+
+  auto seconds_3_tz = ArrayFromJSON(timestamp(TimeUnit::SECOND, "UTC"), R"([3, null])");
+  auto milliseconds_1k_tz =
+      ArrayFromJSON(timestamp(TimeUnit::MILLI, "UTC"), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);

Review comment:
       nor here




-- 
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



[GitHub] [arrow] lidavidm closed pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
lidavidm closed pull request #12137:
URL: https://github.com/apache/arrow/pull/12137


   


-- 
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



[GitHub] [arrow] rok commented on a change in pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
rok commented on a change in pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#discussion_r794575186



##########
File path: docs/source/cpp/compute.rst
##########
@@ -450,9 +450,9 @@ Mixed time resolution temporal inputs will be cast to finest input resolution.
 +------------------+--------+----------------------------+----------------------------+-------+
 | sign             | Unary  | Numeric                    | Int8/Float32/Float64       | \(2)  |
 +------------------+--------+----------------------------+----------------------------+-------+
-| subtract         | Binary | Numeric/Date/Duration      | Numeric/Date/Duration      | \(1)  |
+| subtract         | Binary | Numeric/Timestamp/Duration | Numeric/Timestamp/Duration | \(1)  |

Review comment:
       Changed `Numeric/Timestamp/Duration` -> ` Numeric/Temporal`




-- 
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



[GitHub] [arrow] rok edited a comment on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
rok edited a comment on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1011585650


   @lidavidm similar question about units as in #12124 - should we only cover matching time units (e.g. `subtract(timestamp[s], duration[s]) -> timestamp[s]`) or allow non-matching units too (e.g. `subtract(timestamp[s], duration[ms]) -> timestamp[s]`)?


-- 
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



[GitHub] [arrow] rok commented on a change in pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
rok commented on a change in pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#discussion_r794575325



##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
##########
@@ -1030,6 +1030,80 @@ TEST_F(ScalarTemporalTest, TestTemporalSubtractDateAndDurationChecked) {
   CheckScalarBinary(op, dates64, durations_us, timestamps_us);
 }
 
+TEST_F(ScalarTemporalTest, TestTemporalSubtractTimestampAndDuration) {
+  std::string op = "subtract";
+  for (auto tz : {"", "UTC", "Pacific/Marquesas"}) {
+    auto timestamp_unit_s = timestamp(TimeUnit::SECOND, tz);
+    auto duration_unit_s = duration(TimeUnit::SECOND);
+    auto timestamp_unit_ms = timestamp(TimeUnit::MILLI, tz);
+    auto duration_unit_ms = duration(TimeUnit::MILLI);
+    auto timestamp_unit_us = timestamp(TimeUnit::MICRO, tz);
+    auto duration_unit_us = duration(TimeUnit::MICRO);
+    auto timestamp_unit_ns = timestamp(TimeUnit::NANO, tz);
+    auto duration_unit_ns = duration(TimeUnit::NANO);
+
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_s, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_s, seconds_between),
+                      ArrayFromJSON(timestamp_unit_s, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ms, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ms, milliseconds_between),
+                      ArrayFromJSON(timestamp_unit_ms, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_us, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_us, microseconds_between),
+                      ArrayFromJSON(timestamp_unit_us, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ns, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ns, nanoseconds_between),
+                      ArrayFromJSON(timestamp_unit_ns, times_seconds_precision));
+  }
+
+  auto seconds_3 = ArrayFromJSON(timestamp(TimeUnit::SECOND), R"([3, null])");
+  auto milliseconds_2k = ArrayFromJSON(duration(TimeUnit::MILLI), R"([2000, null])");
+  auto milliseconds_1k = ArrayFromJSON(timestamp(TimeUnit::MILLI), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);
+
+  auto seconds_3_tz = ArrayFromJSON(timestamp(TimeUnit::SECOND, "UTC"), R"([3, null])");
+  auto milliseconds_1k_tz =

Review comment:
       Nice catch! Fixed.

##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
##########
@@ -1030,6 +1030,80 @@ TEST_F(ScalarTemporalTest, TestTemporalSubtractDateAndDurationChecked) {
   CheckScalarBinary(op, dates64, durations_us, timestamps_us);
 }
 
+TEST_F(ScalarTemporalTest, TestTemporalSubtractTimestampAndDuration) {
+  std::string op = "subtract";
+  for (auto tz : {"", "UTC", "Pacific/Marquesas"}) {
+    auto timestamp_unit_s = timestamp(TimeUnit::SECOND, tz);
+    auto duration_unit_s = duration(TimeUnit::SECOND);
+    auto timestamp_unit_ms = timestamp(TimeUnit::MILLI, tz);
+    auto duration_unit_ms = duration(TimeUnit::MILLI);
+    auto timestamp_unit_us = timestamp(TimeUnit::MICRO, tz);
+    auto duration_unit_us = duration(TimeUnit::MICRO);
+    auto timestamp_unit_ns = timestamp(TimeUnit::NANO, tz);
+    auto duration_unit_ns = duration(TimeUnit::NANO);
+
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_s, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_s, seconds_between),
+                      ArrayFromJSON(timestamp_unit_s, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ms, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ms, milliseconds_between),
+                      ArrayFromJSON(timestamp_unit_ms, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_us, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_us, microseconds_between),
+                      ArrayFromJSON(timestamp_unit_us, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ns, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ns, nanoseconds_between),
+                      ArrayFromJSON(timestamp_unit_ns, times_seconds_precision));
+  }
+
+  auto seconds_3 = ArrayFromJSON(timestamp(TimeUnit::SECOND), R"([3, null])");
+  auto milliseconds_2k = ArrayFromJSON(duration(TimeUnit::MILLI), R"([2000, null])");
+  auto milliseconds_1k = ArrayFromJSON(timestamp(TimeUnit::MILLI), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);
+
+  auto seconds_3_tz = ArrayFromJSON(timestamp(TimeUnit::SECOND, "UTC"), R"([3, null])");
+  auto milliseconds_1k_tz =
+      ArrayFromJSON(timestamp(TimeUnit::MILLI, "UTC"), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);
+}
+
+TEST_F(ScalarTemporalTest, TestTemporalSubtractCheckedTimestampAndDuration) {
+  std::string op = "subtract_checked";
+  for (auto tz : {"", "UTC", "Pacific/Marquesas"}) {
+    auto timestamp_unit_s = timestamp(TimeUnit::SECOND, tz);
+    auto duration_unit_s = duration(TimeUnit::SECOND);
+    auto timestamp_unit_ms = timestamp(TimeUnit::MILLI, tz);
+    auto duration_unit_ms = duration(TimeUnit::MILLI);
+    auto timestamp_unit_us = timestamp(TimeUnit::MICRO, tz);
+    auto duration_unit_us = duration(TimeUnit::MICRO);
+    auto timestamp_unit_ns = timestamp(TimeUnit::NANO, tz);
+    auto duration_unit_ns = duration(TimeUnit::NANO);
+
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_s, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_s, seconds_between),
+                      ArrayFromJSON(timestamp_unit_s, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ms, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ms, milliseconds_between),
+                      ArrayFromJSON(timestamp_unit_ms, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_us, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_us, microseconds_between),
+                      ArrayFromJSON(timestamp_unit_us, times_seconds_precision));
+    CheckScalarBinary(op, ArrayFromJSON(timestamp_unit_ns, times_seconds_precision2),
+                      ArrayFromJSON(duration_unit_ns, nanoseconds_between),
+                      ArrayFromJSON(timestamp_unit_ns, times_seconds_precision));
+  }
+
+  auto seconds_3 = ArrayFromJSON(timestamp(TimeUnit::SECOND), R"([3, null])");
+  auto milliseconds_2k = ArrayFromJSON(duration(TimeUnit::MILLI), R"([2000, null])");
+  auto milliseconds_1k = ArrayFromJSON(timestamp(TimeUnit::MILLI), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);
+
+  auto seconds_3_tz = ArrayFromJSON(timestamp(TimeUnit::SECOND, "UTC"), R"([3, null])");
+  auto milliseconds_1k_tz =
+      ArrayFromJSON(timestamp(TimeUnit::MILLI, "UTC"), R"([1000, null])");
+  CheckScalarBinary(op, seconds_3, milliseconds_2k, milliseconds_1k);

Review comment:
       Done.




-- 
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



[GitHub] [arrow] ursabot commented on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
ursabot commented on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1025777715


   Benchmark runs are scheduled for baseline = d8f8c09622adad19cd054b220665b1313b52c15d and contender = d7473260ba73c2a5bdb68f1505afcdea7884f494. d7473260ba73c2a5bdb68f1505afcdea7884f494 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Scheduled] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/8e0a9ef657784de2b9ef9f2221bbf6a1...a7744e7ac02c4137bb5469121645f113/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/efb8911d0d8246b6a51e759646929992...6b4a83b2b6f6448a926ee740f1a1814c/)
   [Scheduled] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/f269d8e6c8134f0faeea0101e497096d...31d4d24bd55d4eefa12526d1517573b9/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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



[GitHub] [arrow] github-actions[bot] commented on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1011578880


   https://issues.apache.org/jira/browse/ARROW-14095


-- 
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



[GitHub] [arrow] rok commented on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
rok commented on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1023357606


   @jorisvandenbossche It would appear test + doc only yes. [ARROW-14095](https://github.com/apache/arrow/pull/12136/files#diff-3eafd7246f6a8c699f10d46e3276852fe44b6853b5517ef10396e561730c09f4) added the `subtract(timestamp, duration)` kernel and dispatch best path to get from `subtract(date, duration)` -> `subtract(timestamp, duration)`.


-- 
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



[GitHub] [arrow] rok commented on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
rok commented on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1016584764


   @jorisvandenbossche heterogeneous time resolutions are now supported.


-- 
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



[GitHub] [arrow] jorisvandenbossche commented on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
jorisvandenbossche commented on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1011995754


   I would expect that for non-matching resolution in the input, we cast to the most detailed resolution. But, this doesn't necessarily need to have kernels for all combinations of resolutions. I think the casting step before calling the kernel should take care of that (like `add(int64, int32) -> int64` is not a registered kernel (only `add(int64, int64)` is), but still works).
   
   The same is true for `subtract(timestamp, timestamp) -> duration`, which is for now only implemented for matching resolutions, and also the automatic casting doesn't seem to work yet for timestamps.


-- 
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



[GitHub] [arrow] rok commented on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
rok commented on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1011585650


   @lidavidm similar question about units as in #12124 - should we only cover matching time units (e.g. `subtract(timestamp[s], duration[s]) -> timestamp[s]`) or allow non-matching units too (e.g. `subtract(timestamp[s], duration[ms]) -> timestamp[s]`).


-- 
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



[GitHub] [arrow] jorisvandenbossche commented on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
jorisvandenbossche commented on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1023324209


   This is now a test only change?


-- 
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



[GitHub] [arrow] ursabot edited a comment on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1025777715


   Benchmark runs are scheduled for baseline = d8f8c09622adad19cd054b220665b1313b52c15d and contender = d7473260ba73c2a5bdb68f1505afcdea7884f494. d7473260ba73c2a5bdb68f1505afcdea7884f494 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/8e0a9ef657784de2b9ef9f2221bbf6a1...a7744e7ac02c4137bb5469121645f113/)
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/efb8911d0d8246b6a51e759646929992...6b4a83b2b6f6448a926ee740f1a1814c/)
   [Finished :arrow_down:0.73% :arrow_up:0.73%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/f269d8e6c8134f0faeea0101e497096d...31d4d24bd55d4eefa12526d1517573b9/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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



[GitHub] [arrow] ursabot edited a comment on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1025777715


   Benchmark runs are scheduled for baseline = d8f8c09622adad19cd054b220665b1313b52c15d and contender = d7473260ba73c2a5bdb68f1505afcdea7884f494. d7473260ba73c2a5bdb68f1505afcdea7884f494 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/8e0a9ef657784de2b9ef9f2221bbf6a1...a7744e7ac02c4137bb5469121645f113/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/efb8911d0d8246b6a51e759646929992...6b4a83b2b6f6448a926ee740f1a1814c/)
   [Scheduled] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/f269d8e6c8134f0faeea0101e497096d...31d4d24bd55d4eefa12526d1517573b9/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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



[GitHub] [arrow] jorisvandenbossche edited a comment on pull request #12137: ARROW-14095: [C++] subtract(timestamp, duration) -> timestamp kernel

Posted by GitBox <gi...@apache.org>.
jorisvandenbossche edited a comment on pull request #12137:
URL: https://github.com/apache/arrow/pull/12137#issuecomment-1011995754


   I would expect that for non-matching resolution in the input, we cast to the most detailed resolution. But, this doesn't necessarily need to have kernels for all combinations of resolutions. I think the casting step before calling the kernel ("DispatchBest") should take care of that (like `add(int64, int32) -> int64` is not a registered kernel (only `add(int64, int64)` is), but still works).
   
   The same is true for `subtract(timestamp, timestamp) -> duration`, which is for now only implemented for matching resolutions, and also the automatic casting doesn't seem to work yet for timestamps.


-- 
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