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

Function TEST_F

bolt/serializers/tests/CompactRowSerializerTest.cpp:120–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118};
119
120TEST_F(CompactRowSerializerTest, fuzz) {
121 auto rowType = ROW({
122 BOOLEAN(),
123 TINYINT(),
124 SMALLINT(),
125 INTEGER(),
126 BIGINT(),
127 REAL(),
128 DOUBLE(),
129 VARCHAR(),
130 TIMESTAMP(),
131 ROW({VARCHAR(), INTEGER()}),
132 ARRAY(INTEGER()),
133 ARRAY(INTEGER()),
134 MAP(VARCHAR(), INTEGER()),
135 MAP(VARCHAR(), ARRAY(INTEGER())),
136 });
137
138 VectorFuzzer::Options opts;
139 opts.vectorSize = 5;
140 opts.nullRatio = 0.1;
141 opts.dictionaryHasNulls = false;
142 opts.stringVariableLength = true;
143 opts.stringLength = 20;
144 opts.containerVariableLength = false;
145
146 // Spark uses microseconds to store timestamp
147 opts.timestampPrecision =
148 VectorFuzzer::Options::TimestampPrecision::kMicroSeconds;
149 opts.containerLength = 10;
150
151 auto seed = folly::Random::rand32();
152
153 LOG(ERROR) << "Seed: " << seed;
154 SCOPED_TRACE(fmt::format("seed: {}", seed));
155 VectorFuzzer fuzzer(opts, pool_.get(), seed);
156
157 auto data = fuzzer.fuzzInputRow(rowType);
158 testRoundTrip(data);
159}
160
161} // namespace
162} // namespace bytedance::bolt::serializer

Callers

nothing calls this directly

Calls 6

ROWFunction · 0.85
ARRAYFunction · 0.85
MAPFunction · 0.85
testRoundTripFunction · 0.50
getMethod · 0.45
fuzzInputRowMethod · 0.45

Tested by

no test coverage detected