yaqi-zhao commented on code in PR #14585:
URL: https://github.com/apache/arrow/pull/14585#discussion_r1045349408


##########
cpp/src/arrow/util/rle_encoding.h:
##########
@@ -598,6 +605,83 @@ inline int RleDecoder::GetBatchWithDict(const T* 
dictionary, int32_t dictionary_
   return values_read;
 }
 
+#ifdef ARROW_WITH_QPL
+template <typename T, typename V>
+inline void CopyValues(const T* dictionary, std::vector<uint8_t>* destination, 
T* values,
+                       int batch_size) {
+  auto* out = values;
+  auto* indices = reinterpret_cast<V*>(destination->data());
+  for (int j = 0; j < batch_size; j++) {
+    auto idx = indices[j];
+    T val = dictionary[idx];
+    std::fill(out, out + 1, val);
+    out++;
+  }
+  return;
+}
+
+template <typename T>
+inline int RleDecoder::GetBatchWithDictIAA(const T* dictionary, int32_t 
dictionary_length,
+                                           T* values, int batch_size) {
+  if (batch_size <= 0) {
+    return batch_size;
+  }
+  if (!::arrow::util::internal::QplJobHWPool::GetInstance().job_ready() ||
+      bit_width_ <= 1) {
+    return GetBatchWithDict(dictionary, dictionary_length, values, batch_size);
+  }
+  uint32_t job_id = 0;
+  qpl_job* job = 
::arrow::util::internal::QplJobHWPool::GetInstance().AcquireJob(job_id);
+  if (job == NULL) {
+    return -1;

Review Comment:
   I was thinking that if the QPL Job was not ready, it would not affect the 
final RLE-Decoding



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