summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/aggregation/group.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attribute_header.cpp18
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attribute_header.h2
-rw-r--r--searchlib/src/vespa/searchlib/expression/aggregationrefnode.h6
4 files changed, 24 insertions, 4 deletions
diff --git a/searchlib/src/vespa/searchlib/aggregation/group.cpp b/searchlib/src/vespa/searchlib/aggregation/group.cpp
index cc8e362b05b..10bef66ea5b 100644
--- a/searchlib/src/vespa/searchlib/aggregation/group.cpp
+++ b/searchlib/src/vespa/searchlib/aggregation/group.cpp
@@ -575,13 +575,13 @@ Group::Value::deserialize(Deserializer & is) {
_aggregationResults[i] = tmpAggregationResults[i];
}
delete [] tmpAggregationResults;
- setupAggregationReferences();
assert(exprSize < 16);
setExprSize(exprSize);
for (uint32_t i(aggrSize); i < aggrSize + exprSize; i++) {
is >> _aggregationResults[i];
}
+ setupAggregationReferences();
is >> count;
destruct(_children, getAllChildrenSize());
_childInfo._allChildren = 0;
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_header.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_header.cpp
index 84f0720b140..f2c73229f4c 100644
--- a/searchlib/src/vespa/searchlib/attribute/attribute_header.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attribute_header.cpp
@@ -11,6 +11,8 @@ namespace {
const vespalib::string versionTag = "version";
const vespalib::string dataTypeTag = "datatype";
const vespalib::string collectionTypeTag = "collectiontype";
+const vespalib::string createIfNonExistentTag = "collectiontype.createIfNonExistent";
+const vespalib::string removeIfZeroTag = "collectiontype.removeIfZero";
const vespalib::string createSerialNumTag = "createSerialNum";
const vespalib::string tensorTypeTag = "tensortype";
const vespalib::string predicateArityTag = "predicate.arity";
@@ -25,6 +27,7 @@ AttributeHeader::AttributeHeader()
_collectionType(attribute::CollectionType::Type::SINGLE),
_tensorType(vespalib::eval::ValueType::error_type()),
_enumerated(false),
+ _collectionTypeParamsSet(false),
_predicateParamsSet(false),
_predicateParams(),
_numDocs(0),
@@ -53,6 +56,7 @@ AttributeHeader::AttributeHeader(const vespalib::string &fileName,
_collectionType(collectionType),
_tensorType(tensorType),
_enumerated(enumerated),
+ _collectionTypeParamsSet(false),
_predicateParamsSet(false),
_predicateParams(predicateParams),
_numDocs(numDocs),
@@ -80,6 +84,16 @@ AttributeHeader::internalExtractTags(const vespalib::GenericHeader &header)
if (header.hasTag(collectionTypeTag)) {
_collectionType = CollectionType(header.getTag(collectionTypeTag).asString());
}
+ if (_collectionType.type() == attribute::CollectionType::WSET) {
+ if (header.hasTag(createIfNonExistentTag)) {
+ assert(header.hasTag(removeIfZeroTag));
+ _collectionTypeParamsSet = true;
+ _collectionType.createIfNonExistant(header.getTag(createIfNonExistentTag).asBool());
+ _collectionType.removeIfZero(header.getTag(removeIfZeroTag).asBool());
+ } else {
+ assert(!header.hasTag(removeIfZeroTag));
+ }
+ }
if (_basicType.type() == BasicType::Type::TENSOR) {
assert(header.hasTag(tensorTypeTag));
_tensorType = vespalib::eval::ValueType::from_spec(header.getTag(tensorTypeTag).asString());
@@ -115,6 +129,10 @@ AttributeHeader::addTags(vespalib::GenericHeader &header) const
using Tag = vespalib::GenericHeader::Tag;
header.putTag(Tag(dataTypeTag, _basicType.asString()));
header.putTag(Tag(collectionTypeTag, _collectionType.asString()));
+ if (_collectionType.type() == attribute::CollectionType::WSET) {
+ header.putTag(Tag(createIfNonExistentTag, _collectionType.createIfNonExistant()));
+ header.putTag(Tag(removeIfZeroTag, _collectionType.removeIfZero()));
+ }
header.putTag(Tag("uniqueValueCount", _uniqueValueCount));
header.putTag(Tag("totalValueCount", _totalValueCount));
header.putTag(Tag("docIdLimit", _numDocs));
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_header.h b/searchlib/src/vespa/searchlib/attribute/attribute_header.h
index 7e9ef78dafb..e761122d28f 100644
--- a/searchlib/src/vespa/searchlib/attribute/attribute_header.h
+++ b/searchlib/src/vespa/searchlib/attribute/attribute_header.h
@@ -24,6 +24,7 @@ private:
CollectionType _collectionType;
vespalib::eval::ValueType _tensorType;
bool _enumerated;
+ bool _collectionTypeParamsSet;
bool _predicateParamsSet;
PersistentPredicateParams _predicateParams;
uint32_t _numDocs;
@@ -65,6 +66,7 @@ public:
uint32_t getVersion() const { return _version; }
const PersistentPredicateParams &getPredicateParams() const { return _predicateParams; }
bool getPredicateParamsSet() const { return _predicateParamsSet; }
+ bool getCollectionTypeParamsSet() const { return _collectionTypeParamsSet; }
static AttributeHeader extractTags(const vespalib::GenericHeader &header);
void addTags(vespalib::GenericHeader &header) const;
};
diff --git a/searchlib/src/vespa/searchlib/expression/aggregationrefnode.h b/searchlib/src/vespa/searchlib/expression/aggregationrefnode.h
index 03ee085c647..7029b3ff1c5 100644
--- a/searchlib/src/vespa/searchlib/expression/aggregationrefnode.h
+++ b/searchlib/src/vespa/searchlib/expression/aggregationrefnode.h
@@ -18,11 +18,11 @@ public:
public:
Configure(ExpressionNodeArray & exprVec) : _exprVec(exprVec) { }
private:
- virtual void execute(vespalib::Identifiable &obj) override { static_cast<AggregationRefNode&>(obj).locateExpression(_exprVec); }
- virtual bool check(const vespalib::Identifiable &obj) const override { return obj.inherits(AggregationRefNode::classId); }
+ void execute(vespalib::Identifiable &obj) override { static_cast<AggregationRefNode&>(obj).locateExpression(_exprVec); }
+ bool check(const vespalib::Identifiable &obj) const override { return obj.inherits(AggregationRefNode::classId); }
ExpressionNodeArray & _exprVec;
};
- virtual void visitMembers(vespalib::ObjectVisitor &visitor) const;
+ void visitMembers(vespalib::ObjectVisitor &visitor) const override;
DECLARE_EXPRESSIONNODE(AggregationRefNode);
AggregationRefNode() : _index(0), _expressionNode(NULL) { }