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

Function MakeNestedDataset

cpp/src/arrow/dataset/scanner_test.cc:2396–2431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2394}
2395
2396DatasetAndBatches MakeNestedDataset() {
2397 const auto dataset_schema = ::arrow::schema({
2398 field("a", int32()),
2399 field("b", boolean()),
2400 field("c", struct_({
2401 field("d", int64()),
2402 field("e", int64()),
2403 })),
2404 });
2405 const auto physical_schema = ::arrow::schema({
2406 field("a", int32()),
2407 field("b", boolean()),
2408 field("c", struct_({
2409 field("e", int64()),
2410 })),
2411 });
2412
2413 return DatasetAndBatchesFromJSON(dataset_schema, physical_schema,
2414 {
2415 {
2416 R"([{"a": 1, "b": null, "c": {"e": 0}},
2417 {"a": 2, "b": true, "c": {"e": 1}}])",
2418 R"([{"a": null, "b": true, "c": {"e": 2}},
2419 {"a": 3, "b": false, "c": {"e": null}}])",
2420 R"([{"a": null, "b": null, "c": null}])",
2421 },
2422 {
2423 R"([{"a": null, "b": true, "c": {"e": 4}},
2424 {"a": 4, "b": false, "c": null}])",
2425 R"([{"a": 5, "b": null, "c": {"e": 6}},
2426 {"a": 6, "b": false, "c": {"e": 7}},
2427 {"a": 7, "b": false, "c": {"e": null}}])",
2428 },
2429 },
2430 /*guarantees=*/{});
2431}
2432
2433compute::Expression Materialize(std::vector<std::string> names,
2434 bool include_aug_fields = false) {

Callers 1

TESTFunction · 0.85

Calls 3

struct_Function · 0.85
schemaFunction · 0.50
fieldFunction · 0.50

Tested by

no test coverage detected