@@ -1245,7 +1245,7 @@ struct TableIterator : IP, C... {
12451245};
12461246
12471247struct ArrowHelpers {
1248- static std::shared_ptr<arrow::Table> joinTables (std::vector<std::shared_ptr<arrow::Table>>&& tables);
1248+ static std::shared_ptr<arrow::Table> joinTables (std::vector<std::shared_ptr<arrow::Table>>&& tables, std::span< const char * const > labels );
12491249 static std::shared_ptr<arrow::Table> concatTables (std::vector<std::shared_ptr<arrow::Table>>&& tables);
12501250};
12511251
@@ -1683,6 +1683,7 @@ class Table
16831683 using table_t = self_t ;
16841684
16851685 static constexpr const auto originals = computeOriginals<ref, Ts...>();
1686+ static constexpr const auto originalLabels = []<size_t N, std::array<TableRef, N> refs, size_t ... Is>(std::index_sequence<Is...>) { return std::array<const char *, N>{o2::aod::label<refs[Is]>()...}; }.template operator ()<originals.size(), originals>(std::make_index_sequence<originals.size()>());
16861687
16871688 template <size_t N, std::array<TableRef, N> bindings>
16881689 requires (ref.origin_hash == " CONC" _h)
@@ -1931,7 +1932,7 @@ class Table
19311932
19321933 Table (std::vector<std::shared_ptr<arrow::Table>>&& tables, uint64_t offset = 0 )
19331934 requires (ref.origin_hash != " CONC" _h)
1934- : Table(ArrowHelpers::joinTables(std::move(tables)), offset)
1935+ : Table(ArrowHelpers::joinTables(std::move(tables), std::span{originalLabels} ), offset)
19351936 {
19361937 }
19371938
@@ -3213,7 +3214,7 @@ struct JoinFull : Table<o2::aod::Hash<"JOIN"_h>, D, o2::aod::Hash<"JOIN"_h>, Ts.
32133214 bindInternalIndicesTo (this );
32143215 }
32153216 JoinFull (std::vector<std::shared_ptr<arrow::Table>>&& tables, uint64_t offset = 0 )
3216- : base{ArrowHelpers::joinTables (std::move (tables)), offset}
3217+ : base{ArrowHelpers::joinTables (std::move (tables), std::span{base::originalLabels} ), offset}
32173218 {
32183219 bindInternalIndicesTo (this );
32193220 }
@@ -3223,6 +3224,7 @@ struct JoinFull : Table<o2::aod::Hash<"JOIN"_h>, D, o2::aod::Hash<"JOIN"_h>, Ts.
32233224 using self_t = JoinFull<D, Ts...>;
32243225 using table_t = base;
32253226 static constexpr const auto originals = base::originals;
3227+ static constexpr const auto originalLabels = base::originalLabels;
32263228 using columns_t = typename table_t ::columns_t ;
32273229 using persistent_columns_t = typename table_t ::persistent_columns_t ;
32283230 using iterator = table_t ::template iterator_template<DefaultIndexPolicy, self_t , Ts...>;
@@ -3293,7 +3295,7 @@ using Join = JoinFull<o2::aod::Hash<"JOIN/0"_h>, Ts...>;
32933295template <typename ... Ts>
32943296constexpr auto join (Ts const &... t)
32953297{
3296- return Join<Ts...>(ArrowHelpers::joinTables ({t.asArrowTable ()...}));
3298+ return Join<Ts...>(ArrowHelpers::joinTables ({t.asArrowTable ()...}, std::span{Join<Ts...>::base::originalLabels} ));
32973299}
32983300
32993301template <typename T>
0 commit comments