68 auto w1 = b1.
cursor<Points>();
70 auto w2 = b2.
cursor<Distances>();
72 auto w3 = b3.
cursor<Flags>();
74 auto w4 = b4.
cursor<Categorys>();
76 for (
auto i = 0;
i < 10; ++
i) {
77 w1(0,
i * 2.,
i * 3.,
i * 4.);
80 std::array<int, 7> d{0, 1, 2, 4, 7, 8, 9};
81 std::array<int, 5>
f{0, 1, 2, 5, 8};
82 std::array<int, 7>
c{0, 1, 2, 3, 5, 7, 8};
89 w3(0,
i,
static_cast<bool>(
i % 2));
98 auto t2 = b2.finalize();
100 auto t3 = b3.finalize();
102 auto t4 = b4.finalize();
107 std::vector<o2::framework::IndexColumnBuilder> builders1;
110 REQUIRE(t5->num_rows() == 4);
112 idxt.bindExternalIndices(&st1, &st2, &st3, &st4);
113 for (
auto&
row : idxt) {
114 REQUIRE(
row.distance().pointId() ==
row.pointId());
115 REQUIRE(
row.flag().pointId() ==
row.pointId());
116 REQUIRE(
row.category().pointId() ==
row.pointId());
121 std::vector<o2::framework::IndexColumnBuilder> builders2;
123 REQUIRE(t6->num_rows() == st2.size());
125 std::array<int, 7> fs{0, 1, 2, -1, -1, 4, -1};
126 std::array<int, 7> cs{0, 1, 2, -1, 5, 6, -1};
127 idxs.bindExternalIndices(&st1, &st2, &st3, &st4);
129 for (
auto const&
row : idxs) {
130 REQUIRE(
row.has_distance());
131 REQUIRE(
row.has_point());
132 if (
row.has_flag()) {
133 REQUIRE(
row.flag().pointId() ==
row.pointId());
135 if (
row.has_category()) {
136 REQUIRE(
row.category().pointId() ==
row.pointId());
138 REQUIRE(
row.flagId() == fs[
i]);
139 REQUIRE(
row.categoryId() == cs[
i]);
167 auto w1 = b1.
cursor<Points>();
168 for (
auto i = 0;
i < 10; ++
i) {
169 w1(0,
i * 2.,
i * 3.,
i * 4.);
175 auto w2 = b2.
cursor<BinnedPoints>();
176 std::array<int, 3> skipPoints = {2, 6, 9};
177 std::array<int, 10>
sizes = {5, 3, 0, 12, 4, 1, 0, 8, 2, 0};
179 for (
auto i = 0;
i < 10; ++
i) {
180 if (
i == skipPoints[
count]) {
189 BinnedPoints st2{t2};
192 auto w3 = b3.
cursor<ColoredPoints>();
193 std::array<int, 20> pointIds1 = {19, 2, 10, 5, 7, 17, 1, 3, 9, 12, 17, 6, 4, 13, 8, 5, 16, 15, 18, 0};
194 std::array<int, 20> pointIds2 = {3, 19, 2, 6, 4, 13, 11, 5, 7, 11, 1, 9, 12, 17, 8, 14, 16, 2, 18, 0};
195 std::array<int, 20> pointIds3 = {19, 2, 9, 15, 1, 3, 9, 12, 17, 18, 0, 10, 5, 7, 11, 6, 4, 13, 9, 14};
196 for (
int i = 0;
i < 20; ++
i) {
197 w3(0,
i, pointIds1[
i]);
199 for (
int i = 0;
i < 20; ++
i) {
200 w3(0,
i + 20, pointIds2[
i]);
202 for (
int i = 0;
i < 20; ++
i) {
203 w3(0,
i + 40, pointIds3[
i]);
206 ColoredPoints st3{tc};
208 std::array<int, 10> colorsizes = {3, 3, 4, 3, 3, 4, 3, 3, 2, 5};
209 std::array<std::vector<int>, 10> colorvalues = {{{19, 39, 50},
218 {8, 31, 42, 46, 58}}};
222 std::vector<o2::framework::IndexColumnBuilder> builders3;
224 REQUIRE(t3->num_rows() == st1.size());
226 idxs.bindExternalIndices(&st1, &st2, &st3);
228 for (
auto const&
row : idxs) {
229 REQUIRE(
row.has_point());
230 if (
row.has_binsSlice()) {
231 auto slice =
row.binsSlice();
233 for (
auto const& bin : slice) {
234 REQUIRE(bin.pointId() ==
row.pointId());
237 auto colors =
row.colorsList();
238 REQUIRE(colors.size() == (
size_t)colorsizes[
count]);
239 for (
auto j = 0U;
j < colors.size(); ++
j) {
static std::shared_ptr< arrow::Table > materialize(std::vector< framework::IndexColumnBuilder > &builders, std::vector< std::shared_ptr< arrow::Table > > &&tables, std::vector< soa::IndexRecord > const &records, std::shared_ptr< arrow::Schema > const &schema, bool exclusive)