From 927cde48427cb973b0c587350bb1e9883d8914ab Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:25:50 +0100 Subject: [PATCH 1/2] Avoid calculating indexing columns --- Framework/Core/include/Framework/ASoA.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 7b0b69ec8941f..6c4df74c0e303 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -1024,6 +1024,9 @@ concept can_bind = requires(T&& t) { { t.B::mColumnIterator }; }; +template +concept WithIndexColumns = (is_indexing_column || ...); + template struct TableIterator : IP, C... { public: @@ -1031,8 +1034,6 @@ struct TableIterator : IP, C... { using policy_t = IP; using all_columns = framework::pack; using persistent_columns_t = framework::selected_pack; - using indexing_columns_t = framework::selected_pack; - constexpr inline static bool has_index_v = framework::pack_size(indexing_columns_t{}) > 0; using external_index_columns_t = framework::selected_pack; using internal_index_columns_t = framework::selected_pack; using bindings_pack_t = decltype([](framework::pack) -> framework::pack {}(external_index_columns_t{})); // decltype(extractBindings(external_index_columns_t{})); @@ -1040,15 +1041,20 @@ struct TableIterator : IP, C... { TableIterator(arrow::ChunkedArray* columnData[sizeof...(C)], IP&& policy) : IP{policy}, C(columnData[framework::has_type_at_v(all_columns{})])... + { + bind(); + } + + TableIterator(arrow::ChunkedArray* columnData[sizeof...(C)], IP&& policy) requires (WithIndexColumns) + : IP{policy}, + C(columnData[framework::has_type_at_v(all_columns{})])... { bind(); // In case we have an index column might need to constrain the actual // number of rows in the view to the range provided by the index. // FIXME: we should really understand what happens to an index when we // have a RowViewFiltered. - if constexpr (has_index_v) { - this->limitRange(this->rangeStart(), this->rangeEnd()); - } + this->limitRange(this->rangeStart(), this->rangeEnd()); } TableIterator() = default; @@ -1192,7 +1198,7 @@ struct TableIterator : IP, C... { [this](T*) -> void {}, }; (f(static_cast(nullptr)), ...); - if constexpr (has_index_v) { + if constexpr (WithIndexColumns) { this->setIndices(this->getIndices()); this->setOffsets(this->getOffsets()); } From ec2c1926a8f9432095c680e2b40d1ac874333eb9 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 21 Jan 2025 09:47:46 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- Framework/Core/include/Framework/ASoA.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Framework/Core/include/Framework/ASoA.h b/Framework/Core/include/Framework/ASoA.h index 6c4df74c0e303..c6fabe78c6310 100644 --- a/Framework/Core/include/Framework/ASoA.h +++ b/Framework/Core/include/Framework/ASoA.h @@ -1045,7 +1045,8 @@ struct TableIterator : IP, C... { bind(); } - TableIterator(arrow::ChunkedArray* columnData[sizeof...(C)], IP&& policy) requires (WithIndexColumns) + TableIterator(arrow::ChunkedArray* columnData[sizeof...(C)], IP&& policy) + requires(WithIndexColumns) : IP{policy}, C(columnData[framework::has_type_at_v(all_columns{})])... {