@@ -58,7 +58,7 @@ void missingFilterDeclaration(int hash, int ai);
5858void notBoundTable (const char * tableName);
5959void * extractCCDBPayload (char * payload, size_t size, TClass const * cl, const char * what);
6060
61- static constexpr char asciiToLower (char c);
61+ constexpr char asciiToLower (char c);
6262
6363template <typename ... C>
6464auto createFieldsFromColumns (framework::pack<C...>)
@@ -1254,6 +1254,8 @@ struct ArrowHelpers {
12541254 static o2::soa::ArrowTableRef joinTables (std::vector<o2::soa::ArrowTableRef>&& tables);
12551255 static o2::soa::ArrowTableRef joinTables (std::vector<o2::soa::ArrowTableRef>&& tables, std::span<const char * const > labels);
12561256 static o2::soa::ArrowTableRef joinTables (std::vector<o2::soa::ArrowTableRef>&& tables, std::span<const std::string> labels);
1257+ static o2::soa::ArrowTableRef joinTables (std::vector<std::shared_ptr<arrow::Table>>&& tables, std::span<const char * const > labels);
1258+ static o2::soa::ArrowTableRef joinTables (std::vector<std::shared_ptr<arrow::Table>>&& tables, std::span<const std::string> labels);
12571259 static o2::soa::ArrowTableRef concatTables (std::vector<o2::soa::ArrowTableRef>&& tables);
12581260 static o2::soa::ArrowTableRef concatTables (std::vector<std::shared_ptr<arrow::Table>>&& tables);
12591261};
@@ -1448,7 +1450,7 @@ struct PresliceBase : public Policy {
14481450 {
14491451 if constexpr (OPT ) {
14501452 if (Policy::isMissing ()) {
1451- return nullptr ;
1453+ return { nullptr , { 0 , 0 }} ;
14521454 }
14531455 }
14541456 return Policy::getSliceFor (value, input);
@@ -1522,7 +1524,7 @@ auto doSliceBy(T const* table, o2::framework::PresliceBase<C, Policy, OPT> const
15221524 }
15231525 }
15241526 auto out = container.getSliceFor (value, table->asArrowTableRef ());
1525- auto t = typename T::self_t ({out}, offset );
1527+ auto t = typename T::self_t ({out});
15261528 if (t.tableSize () != 0 ) {
15271529 table->copyIndexBindings (t);
15281530 t.bindInternalIndicesTo (table);
@@ -1608,7 +1610,7 @@ auto doSliceByCached(T const* table, framework::expressions::BindingNode const&
16081610 auto localCache = cache.ptr ->getCacheFor ({" " , originReplacement (cache.ptr ->newOrigin )(o2::soa::getMatcherFromTypeForKey<T>(node.name )),
16091611 node.name });
16101612 auto [offset, count] = localCache.getSliceFor (value);
1611- auto t = typename T::self_t ({table->asArrowTableRef ().slice (static_cast <uint64_t >(offset), count)});
1613+ auto t = typename T::self_t ({table->asArrowTableRef ().slice ({ static_cast <uint64_t >(offset), count} )});
16121614 if (t.tableSize () != 0 ) {
16131615 table->copyIndexBindings (t);
16141616 }
@@ -3342,28 +3344,14 @@ struct Join : Table<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod:
33423344 {};
33433345 using base = Table<o2::aod::Hash<" JOIN" _h>, o2::aod::Hash<" JOIN/0" _h>, o2::aod::Hash<" JOIN" _h>, Ts...>;
33443346
3345- Join (ArrowTableRef table )
3346- : base{table }
3347+ Join (std::vector< ArrowTableRef>&& tables )
3348+ : base{ArrowHelpers::joinTables ( std::move (tables)) }
33473349 {
33483350 if (this ->tableSize () != 0 ) {
33493351 bindInternalIndicesTo (this );
33503352 }
33513353 }
33523354
3353- Join (std::shared_ptr<arrow::Table> table)
3354- : Join{ArrowTableRef{table}}
3355- {
3356- }
3357-
3358- Join (std::vector<ArrowTableRef>&& tables)
3359- : Join{ArrowHelpers::joinTables (std::move (tables))}
3360- {
3361- }
3362-
3363- Join (std::vector<std::shared_ptr<arrow::Table>>&& tables)
3364- : Join{ArrowHelpers::joinTables (std::move (tables), std::span{base::originalLabels})}
3365- {
3366- }
33673355 using base::bindExternalIndices;
33683356 using base::bindInternalIndicesTo;
33693357 static constexpr const uint32_t binding_origin = base::binding_origin;
@@ -3433,12 +3421,12 @@ struct Join : Table<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod:
34333421
34343422 auto rawSlice (uint64_t start, uint64_t end) const
34353423 {
3436- return self_t {{this ->asArrowTable ()-> Slice ( start, end - start + 1 )}, start };
3424+ return self_t {{this ->asArrowTableRef (). slice ({ start, static_cast < int64_t >( end - start + 1 )})} };
34373425 }
34383426
34393427 auto emptySlice () const
34403428 {
3441- return self_t {{this ->asArrowTable ()-> Slice ( 0 , 0 )}, 0 };
3429+ return self_t {{this ->asArrowTableRef (). slice ({ 0 , 0 })} };
34423430 }
34433431
34443432 template <typename T>
@@ -3453,7 +3441,7 @@ struct Join : Table<o2::aod::Hash<"JOIN"_h>, o2::aod::Hash<"JOIN/0"_h>, o2::aod:
34533441template <typename ... Ts>
34543442constexpr auto join (Ts const &... t)
34553443{
3456- return Join<Ts...>(ArrowHelpers::joinTables ({t.asArrowTable ()...}, std::span{Join<Ts...>::base::originalLabels}));
3444+ return Join<Ts...>({ ArrowHelpers::joinTables ({t.asArrowTableRef ()...}, std::span{Join<Ts...>::base::originalLabels})} );
34573445}
34583446
34593447template <typename T>
@@ -3485,10 +3473,10 @@ struct Concat : Table<o2::aod::Hash<"CONC"_h>, o2::aod::Hash<"CONC/0"_h>, o2::ao
34853473 {
34863474 }
34873475
3488- // Concat(Ts const&... t)
3489- // : Concat{ArrowHelpers::concatTables({t.asArrowTableRef()...})}
3490- // {
3491- // }
3476+ Concat (Ts const &... t)
3477+ : Concat{ArrowHelpers::concatTables ({t.asArrowTableRef ()...})}
3478+ {
3479+ }
34923480
34933481 using base::originals;
34943482
@@ -3514,7 +3502,7 @@ constexpr auto concat(Ts const&... t)
35143502}
35153503
35163504template <typename S>
3517- concept is_a_selection = std::same_as<S , gandiva::Selection const & > || std::same_as<S , SelectionVector&& > || std::same_as<S , std::span<int64_t const > const & >;
3505+ concept is_a_selection = std::same_as<std:: decay_t <S> , gandiva::Selection> || std::same_as<std:: decay_t <S> , SelectionVector> || std::same_as<std:: decay_t <S> , std::span<int64_t const >>;
35183506
35193507template <soa::is_table T>
35203508class FilteredBase : public T
@@ -3557,15 +3545,6 @@ class FilteredBase : public T
35573545 mFilteredBegin .bindInternalIndices (this );
35583546 }
35593547
3560- FilteredBase (std::vector<std::shared_ptr<arrow::Table>>&& tables, is_a_selection auto selection)
3561- : FilteredBase([](std::vector<std::shared_ptr<arrow::Table>>&& ts) -> std::vector<ArrowTableRef>{
3562- std::vector<ArrowTableRef> rs;
3563- std::ranges::transform (ts, std::back_inserter (rs), [](auto const & t){ return ArrowTableRef{t}; });
3564- return rs;
3565- }(tables), selection)
3566- {
3567- }
3568-
35693548 iterator begin ()
35703549 {
35713550 return iterator (mFilteredBegin );
@@ -3801,13 +3780,6 @@ class Filtered : public FilteredBase<T>
38013780 Filtered (std::vector<ArrowTableRef>&& tables, is_a_selection auto selection)
38023781 : FilteredBase<T>{std::move (tables), selection} {}
38033782
3804- Filtered (std::vector<std::shared_ptr<arrow::Table>>&& tables, is_a_selection auto selection)
3805- : FilteredBase<T>{[](std::vector<std::shared_ptr<arrow::Table>>&& ts) -> std::vector<ArrowTableRef>{
3806- std::vector<ArrowTableRef> rs;
3807- std::ranges::transform (ts, std::back_inserter (rs), [](auto const & t){ return ArrowTableRef{t}; });
3808- return rs;
3809- }(tables), selection} {}
3810-
38113783 Filtered<T> operator +(is_a_selection auto selection)
38123784 {
38133785 Filtered<T> copy (*this );
0 commit comments