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

Function TEST_F

cpp/src/parquet/arrow/path_internal_test.cc:117–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115};
116
117TEST_F(MultipathLevelBuilderTest, NonNullableSingleListNonNullableEntries) {
118 auto entries = field("Entries", ::arrow::int64(), /*nullable=*/false);
119 auto list_type = large_list(entries);
120 // Translates to parquet schema:
121 // required group bag {
122 // repeated group [unseen] (List) {
123 // required int64 Entries;
124 // }
125 // }
126 // So:
127 // def level 0: an empty list
128 // def level 1: a non-null entry
129 auto array = ::arrow::ArrayFromJSON(list_type, R"([[1], [2, 3], [4, 5, 6]])");
130
131 ASSERT_OK(
132 MultipathLevelBuilder::Write(*array, /*nullable=*/false, &context_, callback_));
133
134 ASSERT_THAT(results_, SizeIs(1));
135 const CapturedResult& result = results_[0];
136
137 result.CheckLevels(/*def_levels=*/std::vector<int16_t>(/*count=*/6, 1),
138 /*rep_levels=*/{0, 0, 1, 0, 1, 1});
139
140 ASSERT_THAT(result.post_list_elements, SizeIs(1));
141 EXPECT_THAT(result.post_list_elements[0].start, Eq(0));
142 EXPECT_THAT(result.post_list_elements[0].end, Eq(6));
143}
144
145TEST_F(MultipathLevelBuilderTest, NullableSingleListWithAllNullsLists) {
146 auto entries = field("Entries", ::arrow::int64(), /*nullable=*/false);

Callers

nothing calls this directly

Calls 10

large_listFunction · 0.85
ArrayFromJSONFunction · 0.85
WriteFunction · 0.85
listFunction · 0.85
struct_Function · 0.85
fixed_size_listFunction · 0.85
mapFunction · 0.85
CheckLevelsMethod · 0.80
fieldFunction · 0.70

Tested by

no test coverage detected