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

Function TEST_F

cpp/src/parquet/arrow/index_test.cc:224–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222};
223
224TEST_F(ParquetPageIndexRoundTripTest, SimpleRoundTrip) {
225 auto writer_properties = WriterProperties::Builder()
226 .enable_write_page_index()
227 ->max_row_group_length(4)
228 ->build();
229 auto schema = ::arrow::schema({::arrow::field("c0", ::arrow::int64()),
230 ::arrow::field("c1", ::arrow::utf8()),
231 ::arrow::field("c2", ::arrow::list(::arrow::int64()))});
232 WriteFile(writer_properties, ::arrow::TableFromJSON(schema, {R"([
233 [1, "a", [1] ],
234 [2, "b", [1, 2] ],
235 [3, "c", [null] ],
236 [null, "d", [] ],
237 [5, null, [3, 3, 3]],
238 [6, "f", null ]
239 ])"}));
240
241 ReadPageIndexes(/*expect_num_row_groups=*/2, /*expect_num_pages=*/1);
242
243 EXPECT_THAT(
244 column_indexes_,
245 ::testing::ElementsAre(
246 ColumnIndexObject{/*null_pages=*/{false}, /*min_values=*/{encode_int64(1)},
247 /*max_values=*/{encode_int64(3)}, BoundaryOrder::Ascending,
248 /*null_counts=*/{1}},
249 ColumnIndexObject{/*null_pages=*/{false}, /*min_values=*/{"a"},
250 /*max_values=*/{"d"}, BoundaryOrder::Ascending,
251 /*null_counts=*/{0}},
252 ColumnIndexObject{/*null_pages=*/{false}, /*min_values=*/{encode_int64(1)},
253 /*max_values=*/{encode_int64(2)}, BoundaryOrder::Ascending,
254 /*null_counts=*/{2}},
255 ColumnIndexObject{/*null_pages=*/{false}, /*min_values=*/{encode_int64(5)},
256 /*max_values=*/{encode_int64(6)}, BoundaryOrder::Ascending,
257 /*null_counts=*/{0}},
258 ColumnIndexObject{/*null_pages=*/{false}, /*min_values=*/{"f"},
259 /*max_values=*/{"f"}, BoundaryOrder::Ascending,
260 /*null_counts=*/{1}},
261 ColumnIndexObject{/*null_pages=*/{false}, /*min_values=*/{encode_int64(3)},
262 /*max_values=*/{encode_int64(3)}, BoundaryOrder::Ascending,
263 /*null_counts=*/{1}}));
264}
265
266TEST_F(ParquetPageIndexRoundTripTest, SimpleRoundTripWithStatsDisabled) {
267 auto writer_properties = WriterProperties::Builder()

Callers

nothing calls this directly

Calls 15

listFunction · 0.85
TableFromJSONFunction · 0.85
ToParquetSchemaFunction · 0.85
CreateOutputStreamFunction · 0.85
default_memory_poolFunction · 0.85
push_backMethod · 0.80
fieldFunction · 0.70
BuilderFunction · 0.50
schemaFunction · 0.50
MakeFunction · 0.50
dictionaryFunction · 0.50

Tested by

no test coverage detected