MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/dataset/subtree_test.cc:142–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142TEST(Forest, Basic) {
143 ExpectForestIs({}, {});
144
145 ExpectForestIs({FileInfo::File("aa")}, {PT("aa")});
146 ExpectForestIs({FileInfo::Dir("AA")}, {PT("AA", {})});
147 ExpectForestIs({FileInfo::Dir("AA"), FileInfo::File("AA/aa")},
148 {PT("AA", {PT("AA/aa")})});
149 ExpectForestIs({FileInfo::Dir("AA"), FileInfo::Dir("AA/BB"), FileInfo::File("AA/BB/0")},
150 {PT("AA", {PT("AA/BB", {PT("AA/BB/0")})})});
151
152 // Missing parent can still find ancestor.
153 ExpectForestIs({FileInfo::Dir("AA"), FileInfo::File("AA/BB/bb")},
154 {PT("AA", {PT("AA/BB/bb")})});
155
156 // Ancestors should link to parent regardless of ordering.
157 ExpectForestIs({FileInfo::File("AA/aa"), FileInfo::Dir("AA")},
158 {PT("AA", {PT("AA/aa")})});
159
160 // Multiple roots are supported.
161 ExpectForestIs({FileInfo::File("aa"), FileInfo::File("bb")}, {PT("aa"), PT("bb")});
162 ExpectForestIs({FileInfo::File("00"), FileInfo::Dir("AA"), FileInfo::File("AA/aa"),
163 FileInfo::File("BB/bb")},
164 {PT("00"), PT("AA", {PT("AA/aa")}), PT("BB/bb")});
165 ExpectForestIs({FileInfo::Dir("AA"), FileInfo::Dir("AA/BB"), FileInfo::File("AA/BB/0"),
166 FileInfo::Dir("CC"), FileInfo::Dir("CC/BB"), FileInfo::File("CC/BB/0")},
167 {PT("AA", {PT("AA/BB", {PT("AA/BB/0")})}),
168 PT("CC", {PT("CC/BB", {PT("CC/BB/0")})})});
169}
170
171TEST(Forest, HourlyETL) {
172 // This test mimics a scenario where an ETL dumps hourly files in a structure

Callers

nothing calls this directly

Calls 15

ExpectForestIsFunction · 0.85
DirFunction · 0.85
to_stringFunction · 0.85
joinFunction · 0.85
MakeForestFunction · 0.85
equalFunction · 0.85
field_refFunction · 0.85
and_Function · 0.85
or_Function · 0.85
push_backMethod · 0.80
emplace_backMethod · 0.80

Tested by

no test coverage detected