icexelloss commented on code in PR #13644:
URL: https://github.com/apache/arrow/pull/13644#discussion_r924719592


##########
cpp/src/arrow/compute/exec/asof_join_node.cc:
##########
@@ -630,24 +650,28 @@ class AsofJoinNode : public ExecNode {
       for (int i = 0; i < input_schema->num_fields(); ++i) {
         const auto field = input_schema->field(i);
         if (field->name() == on_field_name) {
-          if (kSupportedOnTypes_.find(field->type()) == 
kSupportedOnTypes_.end()) {
-            return Status::Invalid("Unsupported type for on key: ", 
field->name());
+          // Equals must be used when checking for timestamp types.
+          if (!field->type()->Equals(TimestampType(TimeUnit::NANO, "UTC")) &&
+              kSupportedOnTypes_.find(field->type()) == 
kSupportedOnTypes_.end()) {
+            return Status::Invalid("Unsupported type for on key: ",
+                                   field->type()->name());
           }
           // Only add on field from the left table
           if (j == 0) {
             fields.push_back(field);
           }
         } else if (field->name() == by_field_name) {
           if (kSupportedByTypes_.find(field->type()) == 
kSupportedByTypes_.end()) {
-            return Status::Invalid("Unsupported type for by key: ", 
field->name());
+            return Status::Invalid("Unsupported type for by key: ",
+                                   field->type()->name());

Review Comment:
   Good catch. 



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

Reply via email to