MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_P

Function TEST_P

bolt/exec/tests/RowContainerTest.cpp:780–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780TEST_P(RowContainerTest, types) {
781 constexpr int32_t kNumRows = 100;
782 auto batch = makeDataset(
783 ROW(
784 {{"bool_val", BOOLEAN()},
785 {"tiny_val", TINYINT()},
786 {"small_val", SMALLINT()},
787 {"int_val", INTEGER()},
788 {"long_val", BIGINT()},
789 {"float_val", REAL()},
790 {"double_val", DOUBLE()},
791 {"long_decimal_val", DECIMAL(20, 3)},
792 {"short_decimal_val", DECIMAL(10, 2)},
793 {"string_val", VARCHAR()},
794 {"array_val", ARRAY(VARCHAR())},
795 {"struct_val",
796 ROW({{"s_int", INTEGER()}, {"s_array", ARRAY(REAL())}})},
797 {"map_val",
798 MAP(VARCHAR(),
799 MAP(BIGINT(),
800 ROW({{"s2_int", INTEGER()}, {"s2_string", VARCHAR()}})))},
801
802 {"bool_val2", BOOLEAN()},
803 {"tiny_val2", TINYINT()},
804 {"small_val2", SMALLINT()},
805 {"int_val2", INTEGER()},
806 {"long_val2", BIGINT()},
807 {"float_val2", REAL()},
808 {"double_val2", DOUBLE()},
809 {"long_decimal_val2", DECIMAL(20, 3)},
810 {"short_decimal_val2", DECIMAL(10, 2)},
811 {"string_val2", VARCHAR()},
812 {"array_val2", ARRAY(VARCHAR())},
813 {"struct_val2",
814 ROW({{"s_int", INTEGER()}, {"s_array", ARRAY(REAL())}})},
815 {"map_val2",
816 MAP(VARCHAR(),
817 MAP(BIGINT(),
818 ROW({{"s2_int", INTEGER()}, {"s2_string", VARCHAR()}})))}}),
819
820 kNumRows,
821 [](RowVectorPtr rows) {
822 auto strings =
823 rows->childAt(
824 rows->type()->as<TypeKind::ROW>().getChildIdx("string_val"))
825 ->as<FlatVector<StringView>>();
826 for (auto i = 0; i < strings->size(); i += 11) {
827 std::string chars;
828 makeLargeString(i * 10000, chars);
829 strings->set(i, StringView(chars));
830 }
831 });
832 const auto& types = batch->type()->as<TypeKind::ROW>().children();
833 std::vector<TypePtr> keys;
834 // We have the same types twice, once as non-null keys, next as
835 // nullable non-keys.
836 keys.insert(keys.begin(), types.begin(), types.begin() + types.size() / 2);
837 std::vector<TypePtr> dependents;

Callers

nothing calls this directly

Calls 15

ROWFunction · 0.85
DECIMALFunction · 0.85
ARRAYFunction · 0.85
MAPFunction · 0.85
makeLargeStringFunction · 0.85
makeRowContainerFunction · 0.85
makeNonNullFunction · 0.85
signFunction · 0.85
allocateNullsFunction · 0.85
isBitSetFunction · 0.85
childAtMethod · 0.80
getChildIdxMethod · 0.80

Tested by

no test coverage detected