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

Function TEST_F

cpp/src/arrow/compute/kernels/vector_statistics_test.cc:60–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60TEST_F(TestWinsorize, FloatingPoint) {
61 for (auto type : FloatingPointTypes()) {
62 options_.lower_limit = 0.25;
63 options_.upper_limit = 0.75;
64 CheckWinsorize(type, "[]", "[]");
65 CheckWinsorize(type, "[null, null]", "[null, null]");
66 CheckWinsorize(type, "[1.1, 2.2, 3.3, 44, 55]", "[2.2, 2.2, 3.3, 44, 44]");
67 CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[2.2, 2.2, 44, 44, 3.3]");
68 CheckWinsorize(type, "[2.2, 1.1, null, null, 44, 55, 3.3]",
69 "[2.2, 2.2, null, null, 44, 44, 3.3]");
70 CheckWinsorize(type, "[2.2, 1.1, null, null, NaN, 44, 55, 3.3]",
71 "[2.2, 2.2, null, null, NaN, 44, 44, 3.3]");
72 // Chunked
73 CheckWinsorizeChunked(type, {"[2.2, 1.1, null]", "[]", "[NaN, 44, 55, 3.3]"},
74 {"[2.2, 2.2, null]", "[]", "[NaN, 44, 44, 3.3]"});
75 CheckWinsorizeChunked(type, {"[]", "[]"}, {"[]", "[]"});
76 CheckWinsorize(ChunkedArrayFromJSON(type, {}), ChunkedArrayFromJSON(type, {}));
77
78 options_.lower_limit = 0.05;
79 CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[2.2, 1.1, 44, 44, 3.3]");
80 options_.upper_limit = 0.95;
81 CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[2.2, 1.1, 44, 55, 3.3]");
82 options_.lower_limit = 0;
83 options_.upper_limit = 1;
84 CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[2.2, 1.1, 44, 55, 3.3]");
85 options_.lower_limit = options_.upper_limit = 0.5;
86 CheckWinsorize(type, "[2.2, 1.1, 44, 55, 3.3]", "[3.3, 3.3, 3.3, 3.3, 3.3]");
87 }
88}
89
90TEST_F(TestWinsorize, SlicedInput) {
91 options_.lower_limit = 0.0;

Callers

nothing calls this directly

Calls 8

ChunkedArrayFromJSONFunction · 0.85
ArrayFromJSONFunction · 0.85
decimal32Function · 0.85
decimal64Function · 0.85
decimal256Function · 0.85
CallFunctionFunction · 0.85
decimal128Function · 0.50
SliceMethod · 0.45

Tested by

no test coverage detected