MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getExpressionVal

Method getExpressionVal

src/binder/expression/expression_util.cpp:476–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474
475template<typename T>
476T ExpressionUtil::getExpressionVal(const Expression& expr, const Value& value,
477 const LogicalType& targetType, validate_param_func<T> validateParamFunc) {
478 if (value.getDataType() != targetType) {
479 throw RuntimeException{std::format("Parameter: {} must be a {} literal.", expr.getAlias(),
480 targetType.toString())};
481 }
482 T val = value.getValue<T>();
483 if (validateParamFunc != nullptr) {
484 validateParamFunc(val);
485 }
486 return val;
487}
488
489template<typename T>
490T ExpressionUtil::evaluateLiteral(main::ClientContext* context,

Callers

nothing calls this directly

Calls 3

getDataTypeMethod · 0.80
getAliasMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected