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/04/01 16:45:32 UTC

[GitHub] [arrow] rok opened a new pull request #12774: ARROW-16060: [C++] subtract_checked support for timestamp("s") and date32

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


   This is to resolve [ARROW-16060](https://issues.apache.org/jira/browse/ARROW-16060).


-- 
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 #12774: ARROW-16060: [C++] subtract_checked support for timestamp("s") and date32

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



##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
##########
@@ -1818,11 +1818,13 @@ struct ArithmeticFunction : ScalarFunction {
     // Only promote types for binary functions
     if (values->size() == 2) {
       ReplaceNullWithOtherType(values);
-
-      if (auto type = CommonTemporalResolution(values->data(), values->size())) {
+      auto type = CommonTemporalResolution(values->data(), values->size());
+      if (type) {
+        ReplaceTemporalTypes(type, values);
+      } else if (auto numeric_type = CommonNumeric(*values)) {
+        ReplaceTypes(numeric_type, values);
+      } else if (type == TimeUnit::SECOND) {
         ReplaceTemporalTypes(type, values);

Review comment:
       @pitrou I'm sure I'm missing something trivial 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] github-actions[bot] commented on pull request #12774: ARROW-16060: [C++] subtract_checked support for timestamp("s") and date32

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


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


-- 
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 #12774: ARROW-16060: [C++] subtract_checked support for timestamp("s") and date32

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



##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
##########
@@ -1818,11 +1818,13 @@ struct ArithmeticFunction : ScalarFunction {
     // Only promote types for binary functions
     if (values->size() == 2) {
       ReplaceNullWithOtherType(values);
-
-      if (auto type = CommonTemporalResolution(values->data(), values->size())) {
+      auto type = CommonTemporalResolution(values->data(), values->size());
+      if (type) {
+        ReplaceTemporalTypes(type, values);
+      } else if (auto numeric_type = CommonNumeric(*values)) {
+        ReplaceTypes(numeric_type, values);
+      } else if (type == TimeUnit::SECOND) {
         ReplaceTemporalTypes(type, values);

Review comment:
       Without adding this we get:
   ```
   '_error_or_value11.status()' failed with NotImplemented: Function 'subtract' has no kernel matching input types (array[timestamp[s]], array[date32[day]])
   ```
   This only happens for (timestamp[s], day32) but not for (timestamp[ms,us,ns], day32) combinations. I'm not quite sure why.




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