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

Method makeEqualFilter

bolt/expression/ExprToSubfieldFilter.cpp:269–296  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

267
268// static
269std::unique_ptr<common::Filter> ExprToSubfieldFilterParser::makeEqualFilter(
270 const core::TypedExprPtr& valueExpr,
271 core::ExpressionEvaluator* evaluator) {
272 auto value = toConstant(valueExpr, evaluator);
273 if (!value) {
274 return nullptr;
275 }
276 switch (value->typeKind()) {
277 case TypeKind::BOOLEAN:
278 return boolEqual(singleValue<bool>(value));
279 case TypeKind::TINYINT:
280 return equal(singleValue<int8_t>(value));
281 case TypeKind::SMALLINT:
282 return equal(singleValue<int16_t>(value));
283 case TypeKind::INTEGER:
284 return equal(singleValue<int32_t>(value));
285 case TypeKind::BIGINT:
286 return equal(singleValue<int64_t>(value));
287 case TypeKind::HUGEINT:
288 return equalHugeint(singleValue<int128_t>(value));
289 case TypeKind::VARCHAR:
290 return equal(std::string(singleValue<StringView>(value)));
291 case TypeKind::TIMESTAMP:
292 return equal(singleValue<Timestamp>(value));
293 default:
294 return nullptr;
295 }
296}
297
298// static
299std::unique_ptr<common::Filter>

Callers

nothing calls this directly

Calls 5

toConstantFunction · 0.85
boolEqualFunction · 0.85
equalFunction · 0.85
equalHugeintFunction · 0.85
typeKindMethod · 0.45

Tested by

no test coverage detected