@@ -93,6 +93,48 @@ void fillSorted(arrow::ChunkedArray* column, std::vector<int64_t>& offsets, std:
9393}
9494} // namespace
9595
96+ InputSpec inputForEntry (Entry const & entry, bool sorted)
97+ {
98+ // the slice info table inherits the sliced table binding and origin, while using hash
99+ // of original description and normalized column name as a new description
100+ auto & [origin, description, version] = entry.matcher ;
101+ auto newdescription = std::string{description.str } + " /" + entry.key ;
102+ auto hash = runtime_hash (newdescription.c_str ());
103+ auto d = header::DataDescription{" initial" };
104+ d.runtimeInit (std::to_string (hash).c_str ());
105+ InputSpec result{entry.binding + " _Slice" , origin, d, version};
106+ // add metadata to retrieve the original table
107+ result.metadata .emplace_back (
108+ o2::framework::ConfigParamSpec{fmt::format (" slice-source:{}" , entry.binding ),
109+ framework::VariantType::String,
110+ fmt::format (" {}/{}/{}/{}" , entry.binding , origin.as <std::string>(), description.as <std::string>(), version),
111+ {" \"\" " }}
112+ );
113+ result.metadata .emplace_back (
114+ o2::framework::ConfigParamSpec{" slice-key" , framework::VariantType::String, entry.key , {" \"\" " }}
115+ );
116+ result.metadata .emplace_back (
117+ o2::framework::ConfigParamSpec{" sorted" , framework::VariantType::Bool, sorted, {" \"\" " }}
118+ );
119+
120+ return result;
121+ }
122+
123+ ConcreteDataMatcher matcherForEntry (Entry const & entry)
124+ {
125+ return matcherForMatcherAndKey (entry.matcher , entry.key );
126+ }
127+
128+ ConcreteDataMatcher matcherForMatcherAndKey (ConcreteDataMatcher const & matcher, std::string const & key)
129+ {
130+ auto & [origin, description, version] = matcher;
131+ auto newdescription = std::string{description.str } + " /" + key;
132+ auto hash = runtime_hash (newdescription.c_str ());
133+ auto d = header::DataDescription{" initial" };
134+ d.runtimeInit (std::to_string (hash).c_str ());
135+ return {origin, d, version};
136+ }
137+
96138void updatePairList (Cache& list, Entry& entry)
97139{
98140 auto locate = std::find (list.begin (), list.end (), entry);
0 commit comments