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


##########
cpp/src/arrow/compute/exec/asof_join_node.cc:
##########
@@ -184,18 +280,51 @@ class InputState {
     return queue_.UnsyncFront();
   }
 
+#define LATEST_VAL_CASE(id, val)                            \
+  case Type::id: {                                          \
+    using T = typename TypeIdTraits<Type::id>::Type;        \
+    using CType = typename TypeTraits<T>::CType;            \
+    return val(data->GetValues<CType>(1)[latest_ref_row_]); \
+  }
+
   KeyType GetLatestKey() const {
-    return queue_.UnsyncFront()
-        ->column_data(key_col_index_)
-        ->GetValues<KeyType>(1)[latest_ref_row_];
+    if (key_hasher_ != NULLPTR) {
+      return 
key_hasher_->HashesFor(queue_.UnsyncFront().get())[latest_ref_row_];

Review Comment:
   I feel I am misreading this but it looks like this is hashing the batch for 
every `GetLatestKey` call?



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