Skip to content

Commit a167dbc

Browse files
authored
Allow extracting compound tables for spawner/builder/etc. (#5356)
1 parent 277de2d commit a167dbc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Framework/Core/src/AODReaderHelpers.cxx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,20 @@ auto setEOSCallback(InitContext& ic)
6161
});
6262
}
6363

64+
template <typename... Ts>
65+
static inline auto doExtractTypedOriginal(framework::pack<Ts...>, ProcessingContext& pc)
66+
{
67+
if constexpr (sizeof...(Ts) == 1) {
68+
return pc.inputs().get<TableConsumer>(aod::MetadataTrait<framework::pack_element_t<0, framework::pack<Ts...>>>::metadata::tableLabel())->asArrowTable();
69+
} else {
70+
return std::vector{pc.inputs().get<TableConsumer>(aod::MetadataTrait<Ts>::metadata::tableLabel())->asArrowTable()...};
71+
}
72+
}
73+
6474
template <typename O>
6575
static inline auto extractTypedOriginal(ProcessingContext& pc)
6676
{
67-
///FIXME: this should be done in invokeProcess() as some of the originals may be compound tables
68-
return O{pc.inputs().get<TableConsumer>(aod::MetadataTrait<O>::metadata::tableLabel())->asArrowTable()};
77+
return O{doExtractTypedOriginal(soa::make_originals_from_type<O>(), pc)};
6978
}
7079

7180
template <typename... Os>

0 commit comments

Comments
 (0)