| 415 | } |
| 416 | |
| 417 | bool ExpressionUtil::canCastStatically(const Expression& expr, const LogicalType& targetType) { |
| 418 | switch (expr.expressionType) { |
| 419 | case ExpressionType::LITERAL: { |
| 420 | auto value = expr.constPtrCast<LiteralExpression>()->getValue(); |
| 421 | return compatible(value, targetType); |
| 422 | } |
| 423 | case ExpressionType::PARAMETER: { |
| 424 | auto value = expr.constPtrCast<ParameterExpression>()->getValue(); |
| 425 | return compatible(value, targetType); |
| 426 | } |
| 427 | default: |
| 428 | return compatible(expr.getDataType(), targetType); |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | bool ExpressionUtil::canEvaluateAsLiteral(const Expression& expr) { |
| 433 | switch (expr.expressionType) { |
nothing calls this directly
no test coverage detected