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

Method BaseAndTargetFromRandomFilter

cpp/src/arrow/array/diff_test.cc:118–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116 }
117
118 void BaseAndTargetFromRandomFilter(std::shared_ptr<Array> values,
119 double filter_probability) {
120 std::shared_ptr<Array> base_filter, target_filter;
121 do {
122 base_filter = this->rng_.Boolean(values->length(), filter_probability, 0.0);
123 target_filter = this->rng_.Boolean(values->length(), filter_probability, 0.0);
124 } while (base_filter->Equals(target_filter));
125
126 ASSERT_OK_AND_ASSIGN(Datum out_datum, compute::Filter(values, base_filter));
127 base_ = out_datum.make_array();
128
129 ASSERT_OK_AND_ASSIGN(out_datum, compute::Filter(values, target_filter));
130 target_ = out_datum.make_array();
131 }
132
133 void TestBasicsWithUnions(UnionMode::type mode) {
134 ASSERT_OK_AND_ASSIGN(

Callers 1

TEST_FFunction · 0.80

Calls 6

FilterFunction · 0.85
make_arrayMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
BooleanMethod · 0.45
lengthMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected