MCPcopy Create free account
hub / github.com/apache/arrow / Visit

Method Visit

cpp/src/gandiva/expr_validator.cc:69–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69Status ExprValidator::Visit(const FieldNode& node) {
70 auto llvm_type = types_->IRType(node.return_type()->id());
71 ARROW_RETURN_IF(llvm_type == nullptr,
72 Status::ExpressionValidationError("Field ", node.field()->name(),
73 " has unsupported data type ",
74 node.return_type()->name()));
75
76 // Ensure that field is found in schema
77 auto field_in_schema_entry = field_map_.find(node.field()->name());
78 ARROW_RETURN_IF(field_in_schema_entry == field_map_.end(),
79 Status::ExpressionValidationError("Field ", node.field()->name(),
80 " not in schema."));
81
82 // Ensure that the found field matches.
83 FieldPtr field_in_schema = field_in_schema_entry->second;
84 ARROW_RETURN_IF(!field_in_schema->Equals(node.field()),
85 Status::ExpressionValidationError(
86 "Field definition in schema ", field_in_schema->ToString(),
87 " different from field in expression ", node.field()->ToString()));
88
89 return Status::OK();
90}
91
92Status ExprValidator::Visit(const FunctionNode& node) {
93 const auto& desc = node.descriptor();

Callers

nothing calls this directly

Calls 15

ValidateInExpressionFunction · 0.85
LookupSignatureMethod · 0.80
then_nodeMethod · 0.80
else_nodeMethod · 0.80
ToStringFunction · 0.70
decimal128Function · 0.70
OKFunction · 0.50
idMethod · 0.45
return_typeMethod · 0.45
nameMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected