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/02/01 14:48:57 UTC

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

rok commented on a change in pull request #12124:
URL: https://github.com/apache/arrow/pull/12124#discussion_r796671714



##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
##########
@@ -1611,6 +1636,23 @@ Result<ValueDescr> ResolveDecimalDivisionOutput(KernelContext*,
       });
 }
 
+Result<ValueDescr> ResolveTemporalOutput(KernelContext*,
+                                         const std::vector<ValueDescr>& args) {
+  auto left_type = checked_cast<const TimestampType*>(args[0].type.get());
+  auto right_type = checked_cast<const TimestampType*>(args[1].type.get());
+  DCHECK_EQ(left_type->id(), right_type->id());
+
+  if ((left_type->timezone() == "" || right_type->timezone() == "") &&
+      left_type->timezone() != right_type->timezone()) {
+    RETURN_NOT_OK(
+        Status::Invalid("Subtraction of zoned and non-zoned times is ambivalent. (",

Review comment:
       Ugh, I mean ambiguous. Thanks! :)




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