@@ -2165,61 +2165,14 @@ void emptyColumnLabel();
21652165
21662166namespace row_helpers
21672167{
2168- template <soa::is_persistent_column... Cs>
2169- std::array<arrow::ChunkedArray*, sizeof ...(Cs)> getArrowColumns (arrow::Table* table, framework::pack<Cs...>)
2170- {
2171- return std::array<arrow::ChunkedArray*, sizeof ...(Cs)>{o2::soa::getIndexFromLabel (table, Cs::columnLabel ())...};
2172- }
2173-
2174- template <soa::is_persistent_column... Cs>
2175- std::array<std::shared_ptr<arrow::Array>, sizeof ...(Cs)> getChunks (arrow::Table* table, framework::pack<Cs...>, uint64_t ci)
2176- {
2177- return std::array<std::shared_ptr<arrow::Array>, sizeof ...(Cs)>{o2::soa::getIndexFromLabel (table, Cs::columnLabel ())->chunk (ci)...};
2178- }
2179-
2180- template <typename T, soa::is_persistent_column C>
2181- typename C::type getSingleRowData (arrow::Table* table, T& rowIterator, uint64_t ci = std::numeric_limits<uint64_t >::max(), uint64_t ai = std::numeric_limits<uint64_t>::max(), uint64_t globalIndex = std::numeric_limits<uint64_t>::max())
2182- {
2183- if (ci == std::numeric_limits<uint64_t >::max () || ai == std::numeric_limits<uint64_t >::max ()) {
2184- auto colIterator = static_cast <C>(rowIterator).getIterator ();
2185- ci = colIterator.mCurrentChunk ;
2186- ai = *(colIterator.mCurrentPos ) - colIterator.mFirstIndex ;
2187- }
2188- return std::static_pointer_cast<o2::soa::arrow_array_for_t <typename C::type>>(o2::soa::getIndexFromLabel (table, C::columnLabel ())->chunk (ci))->raw_values ()[ai];
2189- }
2190-
2191- template <typename T, soa::is_dynamic_column C>
2192- typename C::type getSingleRowData (arrow::Table*, T& rowIterator, uint64_t ci = std::numeric_limits<uint64_t >::max(), uint64_t ai = std::numeric_limits<uint64_t>::max(), uint64_t globalIndex = std::numeric_limits<uint64_t>::max())
2193- {
2194- if (globalIndex != std::numeric_limits<uint64_t >::max () && globalIndex != *std::get<0 >(rowIterator.getIndices ())) {
2195- rowIterator.setCursor (globalIndex);
2196- }
2197- return rowIterator.template getDynamicColumn <C>();
2198- }
2199-
2200- template <typename T, soa::is_index_column C>
2201- typename C::type getSingleRowData (arrow::Table*, T& rowIterator, uint64_t ci = std::numeric_limits<uint64_t >::max(), uint64_t ai = std::numeric_limits<uint64_t>::max(), uint64_t globalIndex = std::numeric_limits<uint64_t>::max())
2202- {
2203- if (globalIndex != std::numeric_limits<uint64_t >::max () && globalIndex != *std::get<0 >(rowIterator.getIndices ())) {
2204- rowIterator.setCursor (globalIndex);
2205- }
2206- return rowIterator.template getId <C>();
2207- }
2208-
2209- template <typename T, typename ... Cs>
2210- std::tuple<typename Cs::type...> getRowData (arrow::Table* table, T rowIterator, uint64_t ci = std::numeric_limits<uint64_t >::max(), uint64_t ai = std::numeric_limits<uint64_t>::max(), uint64_t globalIndex = std::numeric_limits<uint64_t>::max())
2211- {
2212- return std::make_tuple (getSingleRowData<T, Cs>(table, rowIterator, ci, ai, globalIndex)...);
2213- }
2214-
2215- namespace
2216- {
22172168template <typename R, typename T, typename C>
22182169R getColumnValue (const T& rowIterator)
22192170{
22202171 return static_cast <R>(static_cast <C>(rowIterator).get ());
22212172}
22222173
2174+ namespace
2175+ {
22232176template <typename R, typename T>
22242177using ColumnGetterFunction = R (*)(const T&);
22252178
0 commit comments