You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pitrou (via GitHub)" <gi...@apache.org> on 2023/06/26 08:40:32 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #36256: GH-36255: [C++] Add benchmarks for "if_else" kernel on lists

pitrou commented on code in PR #36256:
URL: https://github.com/apache/arrow/pull/36256#discussion_r1241832493


##########
cpp/src/arrow/compute/kernels/scalar_if_else_benchmark.cc:
##########
@@ -57,9 +57,45 @@ struct GetBytesProcessed<Type, enable_if_base_binary<Type>> {
   }
 };
 
+template <typename DataType>
+struct GetBytesProcessed<DataType, enable_if_list_like<DataType>> {
+  static int64_t Get(const std::shared_ptr<Array>& arr) {
+    using OffsetType = typename TypeTraits<DataType>::OffsetType::c_type;
+
+    int64_t total_bytes = 0;
+    if constexpr (DataType::type_id == Type::LIST ||
+                  DataType::type_id == Type::LARGE_LIST) {
+      total_bytes += (arr->length() + 1) * sizeof(OffsetType);
+    } else {
+      ADD_FAILURE() << "GetBytesProcessed dispatching not implemented for "

Review Comment:
   One alternative is (you need to include `arrow/util/logging.h` if not already done):
   ```suggestion
         ARROW_LOG(FATAL) << "GetBytesProcessed dispatching not implemented for "
   ```



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