diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-12-16 23:26:15 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-12-16 23:26:15 +0000 |
commit | 2bb53166a7e3e221b6a475fa553360e5c902b922 (patch) | |
tree | 90628961eb05791d475fee135d2101877602cdc3 /searchcommon | |
parent | 60d3c83657adbeeb6b3c072d9e3d0f017eeb7709 (diff) |
UINT1 -> BOOL
Diffstat (limited to 'searchcommon')
6 files changed, 10 insertions, 8 deletions
diff --git a/searchcommon/src/vespa/searchcommon/attribute/basictype.cpp b/searchcommon/src/vespa/searchcommon/attribute/basictype.cpp index 67093c686b5..b3137181ce1 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/basictype.cpp +++ b/searchcommon/src/vespa/searchcommon/attribute/basictype.cpp @@ -8,7 +8,7 @@ namespace search::attribute { const BasicType::TypeInfo BasicType::_typeTable[BasicType::MAX_TYPE] = { { BasicType::NONE, 0, "none" }, { BasicType::STRING, 0, "string" }, - { BasicType::UINT1, sizeof(int8_t), "uint1" }, + { BasicType::BOOL, sizeof(int8_t), "bool" }, { BasicType::UINT2, sizeof(int8_t), "uint2" }, { BasicType::UINT4, sizeof(int8_t), "uint4" }, { BasicType::INT8, sizeof(int8_t), "int8" }, @@ -18,7 +18,7 @@ const BasicType::TypeInfo BasicType::_typeTable[BasicType::MAX_TYPE] = { { BasicType::FLOAT, sizeof(float), "float" }, { BasicType::DOUBLE, sizeof(double), "double" }, { BasicType::PREDICATE, 0, "predicate" }, - { BasicType::TENSOR, 0, "tensor" }, + { BasicType::TENSOR, 0, "tensor" }, { BasicType::REFERENCE, 12, "reference" } }; diff --git a/searchcommon/src/vespa/searchcommon/attribute/basictype.h b/searchcommon/src/vespa/searchcommon/attribute/basictype.h index 5bc51cdbea8..9be26b0816b 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/basictype.h +++ b/searchcommon/src/vespa/searchcommon/attribute/basictype.h @@ -12,7 +12,7 @@ class BasicType enum Type { NONE = 0, STRING = 1, - UINT1 = 2, + BOOL = 2, UINT2 = 3, UINT4 = 4, INT8 = 5, @@ -36,6 +36,7 @@ class BasicType const char * asString() const { return asString(_type); } bool isUnsigned() const { return isUnsigned(_type); } size_t fixedSize() const { return fixedSize(_type); } + static BasicType fromType(bool) { return BOOL; } static BasicType fromType(int8_t) { return INT8; } static BasicType fromType(int16_t) { return INT16; } static BasicType fromType(int32_t) { return INT32; } diff --git a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h index 0d3e58331c6..7ac2e701717 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h +++ b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h @@ -322,7 +322,7 @@ public: **/ virtual bool isIntegerType() const { BasicType::Type t = getBasicType(); - return t == BasicType::UINT1 || + return t == BasicType::BOOL || t == BasicType::UINT2 || t == BasicType::UINT4 || t == BasicType::INT8 || diff --git a/searchcommon/src/vespa/searchcommon/common/datatype.cpp b/searchcommon/src/vespa/searchcommon/common/datatype.cpp index f3b2099294e..be4ed5c3715 100644 --- a/searchcommon/src/vespa/searchcommon/common/datatype.cpp +++ b/searchcommon/src/vespa/searchcommon/common/datatype.cpp @@ -11,7 +11,7 @@ using config::InvalidConfigException; DataType dataTypeFromName(vespalib::stringref name) { - if (name == "UINT1") { return DataType::UINT1; } + if (name == "BOOL") { return DataType::BOOL; } else if (name == "UINT2") { return DataType::UINT2; } else if (name == "UINT4") { return DataType::UINT4; } else if (name == "INT8") { return DataType::INT8; } @@ -30,7 +30,7 @@ dataTypeFromName(vespalib::stringref name) { } } -const char *datatype_str[] = { "UINT1", +const char *datatype_str[] = { "BOOL", "UINT2", "UINT4", "INT8", diff --git a/searchcommon/src/vespa/searchcommon/common/datatype.h b/searchcommon/src/vespa/searchcommon/common/datatype.h index f21b6b9d5e9..35f885aee53 100644 --- a/searchcommon/src/vespa/searchcommon/common/datatype.h +++ b/searchcommon/src/vespa/searchcommon/common/datatype.h @@ -9,7 +9,8 @@ namespace search::index::schema { /** * Basic data type for a field. **/ -enum class DataType { UINT1 = 0, +enum class DataType { + BOOL = 0, UINT2 = 1, UINT4 = 2, INT8 = 3, diff --git a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp index e7f103f0ebb..401003cb74b 100644 --- a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp +++ b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp @@ -61,7 +61,7 @@ convertDataType(const ConfigType &type) case ConfigType::STRING: return DataType::STRING; case ConfigType::BOOL: - return DataType::UINT1; + return DataType::BOOL; case ConfigType::UINT2: return DataType::UINT2; case ConfigType::UINT4: |