Skip to content

Commit 80cd8f4

Browse files
committed
fixup! DPL Analysis: remove std::set from analysis task
1 parent fcd7a33 commit 80cd8f4

5 files changed

Lines changed: 16 additions & 8 deletions

File tree

Framework/Core/include/Framework/ASoA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ class Table
17631763
using columns_t = decltype(getColumns<ref, Ts...>());
17641764

17651765
static constexpr auto column_hashes = []<typename... C>(framework::pack<C...>) consteval {
1766-
auto hashes = []<typename... CC>() consteval { return std::array{CC::hash...}; }.template operator()<C...>();
1766+
auto hashes = std::array{C::hash...};
17671767
std::ranges::sort(hashes);
17681768
return hashes;
17691769
}(columns_t{});

Framework/Core/include/Framework/AnalysisHelpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ auto getTableFromFilter(soa::is_not_filtered_table auto const& table, soa::Selec
953953
return std::make_unique<o2::soa::Filtered<std::decay_t<decltype(table)>>>(std::vector{table.asArrowTableRef()}, std::forward<soa::SelectionVector>(selection));
954954
}
955955

956-
void initializePartitionCaches(const std::span<const uint32_t>& hashes, std::shared_ptr<arrow::Schema> const& schema, expressions::Filter const& filter, gandiva::NodePtr& tree, gandiva::FilterPtr& gfilter);
956+
void initializePartitionCaches(std::span<const uint32_t> hashes, std::shared_ptr<arrow::Schema> const& schema, expressions::Filter const& filter, gandiva::NodePtr& tree, gandiva::FilterPtr& gfilter);
957957

958958
/// Partition ties directly to the argument type
959959
/// in a case with several origins in subscriptions it will get the correct input, as the type contains the origin
@@ -975,7 +975,7 @@ struct Partition {
975975
setTable(table);
976976
}
977977

978-
void intializeCaches(std::span<const uint32_t> const& hashes, std::shared_ptr<arrow::Schema> const& schema)
978+
void intializeCaches(std::span<const uint32_t> hashes, std::shared_ptr<arrow::Schema> const& schema)
979979
{
980980
initializePartitionCaches(hashes, schema, filter, tree, gfilter);
981981
}

Framework/Core/include/Framework/Expressions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ using Operations = std::vector<ColumnOperationSpec>;
681681
Operations createOperations(Filter const& expression);
682682

683683
/// Function to check compatibility of a given arrow schema with operation sequence
684-
bool isTableCompatible(const std::span<const uint32_t>& hashes, Operations const& specs);
684+
bool isTableCompatible(std::span<const uint32_t> hashes, Operations const& specs);
685685
/// Function to create gandiva expression tree from operation sequence
686686
gandiva::NodePtr createExpressionTree(Operations const& opSpecs,
687687
gandiva::SchemaPtr const& Schema);

Framework/Core/src/AnalysisHelpers.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ std::shared_ptr<arrow::Table> spawnerHelper(std::shared_ptr<arrow::Table> const&
155155
return arrow::Table::Make(newSchema, arrays);
156156
}
157157

158-
void initializePartitionCaches(std::span<const uint32_t> const& hashes, std::shared_ptr<arrow::Schema> const& schema, expressions::Filter const& filter, gandiva::NodePtr& tree, gandiva::FilterPtr& gfilter)
158+
void initializePartitionCaches(std::span<const uint32_t> hashes, std::shared_ptr<arrow::Schema> const& schema, expressions::Filter const& filter, gandiva::NodePtr& tree, gandiva::FilterPtr& gfilter)
159159
{
160160
if (tree == nullptr) {
161161
expressions::Operations ops = createOperations(filter);

Framework/Core/src/Expressions.cxx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ gandiva::NodePtr createExpressionTree(Operations const& opSpecs,
768768
return tree;
769769
}
770770

771-
bool isTableCompatible(std::span<const uint32_t> const& hashes, Operations const& specs)
771+
bool isTableCompatible(std::span<const uint32_t> hashes, Operations const& specs)
772772
{
773773
std::vector<uint32_t> opHashes;
774774
for (auto const& spec : specs) {
@@ -779,8 +779,16 @@ bool isTableCompatible(std::span<const uint32_t> const& hashes, Operations const
779779
opHashes.emplace_back(spec.right.hash);
780780
}
781781
}
782-
783-
return std::ranges::includes(hashes, opHashes);
782+
std::ranges::sort(opHashes);
783+
auto [ret, last] = std::ranges::unique(opHashes);
784+
opHashes.erase(ret, last);
785+
bool contains = true;
786+
std::ranges::for_each(opHashes, [hashes, &contains](auto const& hash){
787+
contains = contains && std::ranges::any_of(hashes, [hash](auto const& h){
788+
return h == hash;
789+
});
790+
});
791+
return contains;
784792
}
785793

786794
void updateExpressionInfos(expressions::Filter const& filter, std::vector<ExpressionInfo>& eInfos)

0 commit comments

Comments
 (0)