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

Function TEST_F

cpp/src/arrow/compute/kernels/scalar_nested_test.cc:520–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518class TestMapLookupKernel : public ::testing::Test {};
519
520TEST_F(TestMapLookupKernel, BooleanKey) {
521 auto true_scalar = ScalarFromJSON(boolean(), R"(true)");
522 auto map_type = map(boolean(), int32());
523 const char* input = R"(
524 [
525 [
526 [true, 99], [false, 1], [false, 2], [true, null], [false, 5],
527 [true, 8]
528 ],
529 null,
530 [
531 [false, null], [true, 67], [false, 101], [false, 1], [false, null],
532 [false, 9], [true, 80]
533 ],
534 [],
535 [
536 [false, 1], [false, 2], [false, 3], [false, 4]
537 ],
538 [
539 [true, 9], [true, 2], [true, 5], [true, 8]
540 ]
541 ]
542 )";
543 auto map_array = ArrayFromJSON(map_type, input);
544 auto map_array_tweaked = TweakValidityBit(map_array, 5, false);
545
546 auto expected_all = ArrayFromJSON(list(int32()), R"(
547 [[99, null, 8], null, [67, 80], null, null, null ])");
548 auto expected_first = ArrayFromJSON(int32(), "[99, null, 67, null, null, null]");
549 auto expected_last = ArrayFromJSON(int32(), "[8, null, 80, null, null, null]");
550
551 CheckMapLookupWithDifferentOptions(map_array_tweaked, true_scalar, expected_all,
552 expected_first, expected_last);
553}
554
555TEST_F(TestMapLookupKernel, MonthDayNanoIntervalKeys) {
556 auto key_type = month_day_nano_interval();

Callers

nothing calls this directly

Calls 14

ScalarFromJSONFunction · 0.85
mapFunction · 0.85
ArrayFromJSONFunction · 0.85
TweakValidityBitFunction · 0.85
listFunction · 0.85
month_day_nano_intervalFunction · 0.85
fixed_size_binaryFunction · 0.85
MakeScalarFunction · 0.85
struct_Function · 0.85
MakeNullScalarFunction · 0.85
CallFunctionFunction · 0.85

Tested by

no test coverage detected