| 474 | |
| 475 | template<typename T> |
| 476 | T 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 | |
| 489 | template<typename T> |
| 490 | T ExpressionUtil::evaluateLiteral(main::ClientContext* context, |
nothing calls this directly
no test coverage detected