@@ -2157,61 +2157,14 @@ void emptyColumnLabel();
21572157
21582158namespace row_helpers
21592159{
2160- template <soa::is_persistent_column... Cs>
2161- std::array<arrow::ChunkedArray*, sizeof ...(Cs)> getArrowColumns (arrow::Table* table, framework::pack<Cs...>)
2162- {
2163- return std::array<arrow::ChunkedArray*, sizeof ...(Cs)>{o2::soa::getIndexFromLabel (table, Cs::columnLabel ())...};
2164- }
2165-
2166- template <soa::is_persistent_column... Cs>
2167- std::array<std::shared_ptr<arrow::Array>, sizeof ...(Cs)> getChunks (arrow::Table* table, framework::pack<Cs...>, uint64_t ci)
2168- {
2169- return std::array<std::shared_ptr<arrow::Array>, sizeof ...(Cs)>{o2::soa::getIndexFromLabel (table, Cs::columnLabel ())->chunk (ci)...};
2170- }
2171-
2172- template <typename T, soa::is_persistent_column C>
2173- 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())
2174- {
2175- if (ci == std::numeric_limits<uint64_t >::max () || ai == std::numeric_limits<uint64_t >::max ()) {
2176- auto colIterator = static_cast <C>(rowIterator).getIterator ();
2177- ci = colIterator.mCurrentChunk ;
2178- ai = *(colIterator.mCurrentPos ) - colIterator.mFirstIndex ;
2179- }
2180- 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];
2181- }
2182-
2183- template <typename T, soa::is_dynamic_column C>
2184- 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())
2185- {
2186- if (globalIndex != std::numeric_limits<uint64_t >::max () && globalIndex != *std::get<0 >(rowIterator.getIndices ())) {
2187- rowIterator.setCursor (globalIndex);
2188- }
2189- return rowIterator.template getDynamicColumn <C>();
2190- }
2191-
2192- template <typename T, soa::is_index_column C>
2193- 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())
2194- {
2195- if (globalIndex != std::numeric_limits<uint64_t >::max () && globalIndex != *std::get<0 >(rowIterator.getIndices ())) {
2196- rowIterator.setCursor (globalIndex);
2197- }
2198- return rowIterator.template getId <C>();
2199- }
2200-
2201- template <typename T, typename ... Cs>
2202- 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())
2203- {
2204- return std::make_tuple (getSingleRowData<T, Cs>(table, rowIterator, ci, ai, globalIndex)...);
2205- }
2206-
2207- namespace
2208- {
22092160template <typename R, typename T, typename C>
22102161R getColumnValue (const T& rowIterator)
22112162{
22122163 return static_cast <R>(static_cast <C>(rowIterator).get ());
22132164}
22142165
2166+ namespace
2167+ {
22152168template <typename R, typename T>
22162169using ColumnGetterFunction = R (*)(const T&);
22172170
0 commit comments