aboutsummaryrefslogtreecommitdiffstats
path: root/searchcommon
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2020-06-15 12:00:36 +0000
committerGeir Storli <geirst@verizonmedia.com>2020-06-17 13:18:03 +0000
commitbddf1e9ebabf285963a5fea5d56461490b70c732 (patch)
treebd3a7c031c6116969adee9603c066aaf22c3a4dc /searchcommon
parent5566148a0ad253569e44b4e21ada7e8e59241eaf (diff)
Test that attribute writer can handle put in two phases.
Diffstat (limited to 'searchcommon')
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schema.cpp19
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schema.h3
2 files changed, 14 insertions, 8 deletions
diff --git a/searchcommon/src/vespa/searchcommon/common/schema.cpp b/searchcommon/src/vespa/searchcommon/common/schema.cpp
index a21cc43572e..c59edbef22f 100644
--- a/searchcommon/src/vespa/searchcommon/common/schema.cpp
+++ b/searchcommon/src/vespa/searchcommon/common/schema.cpp
@@ -70,16 +70,20 @@ namespace index {
const uint32_t Schema::UNKNOWN_FIELD_ID(std::numeric_limits<uint32_t>::max());
Schema::Field::Field(vespalib::stringref n, DataType dt)
- : _name(n),
- _dataType(dt),
- _collectionType(schema::CollectionType::SINGLE)
+ : Field(n, dt, schema::CollectionType::SINGLE, "")
{
}
Schema::Field::Field(vespalib::stringref n, DataType dt, CollectionType ct)
+ : Field(n, dt, ct, "")
+{
+}
+
+Schema::Field::Field(vespalib::stringref n, DataType dt, CollectionType ct, vespalib::stringref tensor_spec)
: _name(n),
_dataType(dt),
- _collectionType(ct)
+ _collectionType(ct),
+ _tensor_spec(tensor_spec)
{
}
@@ -111,15 +115,14 @@ Schema::Field::operator==(const Field &rhs) const
{
return _name == rhs._name &&
_dataType == rhs._dataType &&
- _collectionType == rhs._collectionType;
+ _collectionType == rhs._collectionType &&
+ _tensor_spec == rhs._tensor_spec;
}
bool
Schema::Field::operator!=(const Field &rhs) const
{
- return _name != rhs._name ||
- _dataType != rhs._dataType ||
- _collectionType != rhs._collectionType;
+ return !((*this) == rhs);
}
Schema::IndexField::IndexField(vespalib::stringref name, DataType dt)
diff --git a/searchcommon/src/vespa/searchcommon/common/schema.h b/searchcommon/src/vespa/searchcommon/common/schema.h
index e17d219d7e8..9003578adaf 100644
--- a/searchcommon/src/vespa/searchcommon/common/schema.h
+++ b/searchcommon/src/vespa/searchcommon/common/schema.h
@@ -35,10 +35,12 @@ public:
vespalib::string _name;
DataType _dataType;
CollectionType _collectionType;
+ vespalib::string _tensor_spec;
public:
Field(vespalib::stringref n, DataType dt);
Field(vespalib::stringref n, DataType dt, CollectionType ct);
+ Field(vespalib::stringref n, DataType dt, CollectionType ct, vespalib::stringref tensor_spec);
/**
* Create this field based on the given config lines.
@@ -58,6 +60,7 @@ public:
const vespalib::string &getName() const { return _name; }
DataType getDataType() const { return _dataType; }
CollectionType getCollectionType() const { return _collectionType; }
+ const vespalib::string& get_tensor_spec() const { return _tensor_spec; }
bool matchingTypes(const Field &rhs) const {
return getDataType() == rhs.getDataType() &&