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

Method testComputeValueIds

bolt/exec/tests/VectorHasherTest.cpp:62–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61 template <typename T>
62 void testComputeValueIds(bool withNulls) {
63 vector_size_t size = 1'111;
64 auto isNullAt = withNulls ? test::VectorMaker::nullEvery(5) : nullptr;
65
66 // values in the middle of the range
67 auto vector = makeFlatVector<T>(
68 size, [](vector_size_t row) { return row % 17; }, isNullAt);
69 auto outOfRangeVector = makeFlatVector<T>(
70 size, [](vector_size_t row) { return row % 19; }, isNullAt);
71 testComputeValueIds(vector, outOfRangeVector);
72 testComputeValueIds(vector, outOfRangeVector, 27);
73
74 // values at the lower end of the range
75 vector = makeFlatVector<T>(
76 size,
77 [](vector_size_t row) {
78 return std::numeric_limits<T>::min() + row % 17;
79 },
80 isNullAt);
81 testComputeValueIds(vector);
82
83 // values at the upper end of the range
84 vector = makeFlatVector<T>(
85 size,
86 [](vector_size_t row) {
87 return std::numeric_limits<T>::max() - 16 + row % 17;
88 },
89 isNullAt);
90 testComputeValueIds(vector);
91 }
92
93 void testComputeValueIds(
94 const VectorPtr& vector,

Callers

nothing calls this directly

Calls 14

memsetFunction · 0.85
enableValueRangeMethod · 0.80
minFunction · 0.50
maxFunction · 0.50
createFunction · 0.50
sizeMethod · 0.45
typeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
decodeMethod · 0.45
computeValueIdsMethod · 0.45
cardinalityMethod · 0.45

Tested by

no test coverage detected