| 49 | } // namespace |
| 50 | |
| 51 | Status ExprValidator::Validate(const ExpressionPtr& expr) { |
| 52 | ARROW_RETURN_IF(expr == nullptr, |
| 53 | Status::ExpressionValidationError("Expression cannot be null")); |
| 54 | |
| 55 | Node& root = *expr->root(); |
| 56 | ARROW_RETURN_NOT_OK(root.Accept(*this)); |
| 57 | |
| 58 | // Ensure root's return type match the expression return type. Type |
| 59 | // support validation is not required because root type is already supported. |
| 60 | ARROW_RETURN_IF(!root.return_type()->Equals(*expr->result()->type()), |
| 61 | Status::ExpressionValidationError("Return type of root node ", |
| 62 | root.return_type()->ToString(), |
| 63 | " does not match that of expression ", |
| 64 | expr->result()->type()->ToString())); |
| 65 | |
| 66 | return Status::OK(); |
| 67 | } |
| 68 | |
| 69 | Status ExprValidator::Visit(const FieldNode& node) { |
| 70 | auto llvm_type = types_->IRType(node.return_type()->id()); |
no test coverage detected