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

Function TEST

cpp/src/arrow/compute/kernels/vector_run_end_encode_test.cc:454–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454TEST(TestRunEndEncodeDecodeNested, VariableSizeList) {
455 auto value_type = list(int32());
456 auto input = ArrayFromJSON(value_type, R"([
457 [9], [1, 2], [1, 2], [], [], null, null, [null], [null], [3], [3], [4], [9]
458 ])");
459 input = input->Slice(1, 11);
460 auto expected_values =
461 ArrayFromJSON(value_type, R"([[1, 2], [], null, [null], [3], [4]])");
462 AssertNestedRunEndEncodeDecode(input, "[2, 4, 6, 8, 10, 11]", expected_values);
463
464 AssertNestedRunEndEncodeDecode(ArrayFromJSON(value_type, "[]"), "[]",
465 ArrayFromJSON(value_type, "[]"));
466
467 auto signed_zeros = ArrayFromJSON(list(float64()), "[[0.0], [-0.0]]");
468 AssertNestedRunEndEncodeDecode(signed_zeros, "[1, 2]", signed_zeros);
469
470 auto null_lists = ArrayFromJSON(list(null()), "[[null], [null], [], [null]]");
471 auto expected_null_lists = ArrayFromJSON(list(null()), "[[null], [], [null]]");
472 AssertNestedRunEndEncodeDecode(null_lists, "[2, 3, 4]", expected_null_lists);
473
474 auto nested_value_type = list(list(int32()));
475 auto nested_lists =
476 ArrayFromJSON(nested_value_type, "[[[1], [2]], [[1], [2]], [], null, [[3, null]]]");
477 auto expected_nested_lists =
478 ArrayFromJSON(nested_value_type, "[[[1], [2]], [], null, [[3, null]]]");
479 AssertNestedRunEndEncodeDecode(nested_lists, "[2, 3, 4, 5]", expected_nested_lists);
480}
481
482TEST(TestRunEndEncodeDecodeNested, LargeList) {
483 auto value_type = large_list(int32());

Callers

nothing calls this directly

Calls 12

listFunction · 0.85
ArrayFromJSONFunction · 0.85
large_listFunction · 0.85
list_viewFunction · 0.85
large_list_viewFunction · 0.85
fixed_size_listFunction · 0.85
mapFunction · 0.85
struct_Function · 0.85
dictionaryFunction · 0.50
fieldFunction · 0.50
SliceMethod · 0.45

Tested by

no test coverage detected