aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/features/attributefeature.cpp
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2019-04-10 09:50:06 +0000
committerHåvard Pettersen <havardpe@oath.com>2019-04-25 12:24:03 +0000
commit974a0f2d3c588e35165177ac556e08cfdcc0e26f (patch)
tree46551c364a6cd1ee3cf88292f30537870f2956b4 /searchlib/src/vespa/searchlib/features/attributefeature.cpp
parentb186ca34ab5df612a463334772788752e1deec3c (diff)
avoid abstract value types
remove basic value type ANY remove concept of tensors with unknown dimensions disallow value types with unbound indexed dimensions remove predicates talking about abstract types type of unknown values are now ERROR (was ANY) require that overlapping indexed dimensions are of equal size type unification now requires types to be equal ('if' expressions) creating a tensor type without dimensions now gives a double type make rank feature setup fail on invalid types (query/attribute)
Diffstat (limited to 'searchlib/src/vespa/searchlib/features/attributefeature.cpp')
-rw-r--r--searchlib/src/vespa/searchlib/features/attributefeature.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/searchlib/src/vespa/searchlib/features/attributefeature.cpp b/searchlib/src/vespa/searchlib/features/attributefeature.cpp
index b3ebd0f3822..56d02ce6d4e 100644
--- a/searchlib/src/vespa/searchlib/features/attributefeature.cpp
+++ b/searchlib/src/vespa/searchlib/features/attributefeature.cpp
@@ -295,10 +295,13 @@ AttributeBlueprint::setup(const search::fef::IIndexEnvironment & env,
vespalib::string attrType = type::Attribute::lookup(env.getProperties(), _attrName);
if (!attrType.empty()) {
_tensorType = ValueType::from_spec(attrType);
+ if (_tensorType.is_error()) {
+ LOG(error, "%s: invalid type: '%s'", getName().c_str(), attrType.c_str());
+ }
}
- FeatureType output_type = _tensorType.is_tensor()
- ? FeatureType::object(_tensorType)
- : FeatureType::number();
+ FeatureType output_type = _tensorType.is_double()
+ ? FeatureType::number()
+ : FeatureType::object(_tensorType);
describeOutput("value", "The value of a single value attribute, "
"the value at the given index of an array attribute, "
"the given key of a weighted set attribute, or"
@@ -309,7 +312,7 @@ AttributeBlueprint::setup(const search::fef::IIndexEnvironment & env,
describeOutput("count", "Returns the number of elements in this array or weighted set attribute.");
}
env.hintAttributeAccess(_attrName);
- return true;
+ return !_tensorType.is_error();
}
search::fef::Blueprint::UP