Support array datatype (#26369)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2023-09-19 14:23:23 +08:00 committed by GitHub
parent 10116b85ac
commit a362bb1457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
64 changed files with 7331 additions and 2391 deletions

2
.gitignore vendored
View File

@ -5,11 +5,13 @@
# proxy/cmake-build-debug/
# a/b/c/cmake-build-debug/
**/cmake-build-debug/*
**/cmake-build-debug-coverage/*
**/cmake-build-release/*
**/cmake_build_release/*
**/cmake_build/*
**/CmakeFiles/*
.cache
coverage_report/
internal/core/output/*
internal/core/build/*

View File

@ -0,0 +1,646 @@
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <utility>
#include <vector>
#include <arrow/array.h>
#include <arrow/array/builder_primitive.h>
#include <fmt/core.h>
#include "FieldMeta.h"
#include "Types.h"
namespace milvus {
class Array {
public:
Array() = default;
~Array() {
delete[] data_;
}
explicit Array(const ScalarArray& field_data) {
switch (field_data.data_case()) {
case ScalarArray::kBoolData: {
element_type_ = DataType::BOOL;
length_ = field_data.bool_data().data().size();
auto data = new bool[length_];
size_ = length_;
offsets_.reserve(length_);
for (int i = 0; i < length_; ++i) {
data[i] = field_data.bool_data().data(i);
offsets_.push_back(sizeof(bool) * i);
}
data_ = reinterpret_cast<char*>(data);
break;
}
case ScalarArray::kIntData: {
element_type_ = DataType::INT32;
length_ = field_data.int_data().data().size();
size_ = length_ * sizeof(int32_t);
data_ = new char[size_];
offsets_.reserve(length_);
for (int i = 0; i < length_; ++i) {
reinterpret_cast<int*>(data_)[i] =
field_data.int_data().data(i);
offsets_.push_back(sizeof(int32_t) * i);
}
break;
}
case ScalarArray::kLongData: {
element_type_ = DataType::INT64;
length_ = field_data.long_data().data().size();
size_ = length_ * sizeof(int64_t);
data_ = new char[size_];
offsets_.reserve(length_);
for (int i = 0; i < length_; ++i) {
reinterpret_cast<int64_t*>(data_)[i] =
field_data.long_data().data(i);
offsets_.push_back(sizeof(int64_t) * i);
}
break;
}
case ScalarArray::kFloatData: {
element_type_ = DataType::FLOAT;
length_ = field_data.float_data().data().size();
size_ = length_ * sizeof(float);
data_ = new char[size_];
offsets_.reserve(length_);
for (int i = 0; i < length_; ++i) {
reinterpret_cast<float*>(data_)[i] =
field_data.float_data().data(i);
offsets_.push_back(sizeof(float) * i);
}
break;
}
case ScalarArray::kDoubleData: {
element_type_ = DataType::DOUBLE;
length_ = field_data.double_data().data().size();
size_ = length_ * sizeof(double);
data_ = new char[size_];
offsets_.reserve(length_);
for (int i = 0; i < length_; ++i) {
reinterpret_cast<double*>(data_)[i] =
field_data.double_data().data(i);
offsets_.push_back(sizeof(double) * i);
}
break;
}
case ScalarArray::kStringData: {
element_type_ = DataType::STRING;
length_ = field_data.string_data().data().size();
offsets_.reserve(length_);
for (int i = 0; i < length_; ++i) {
offsets_.push_back(size_);
size_ += field_data.string_data().data(i).size();
}
data_ = new char[size_];
for (int i = 0; i < length_; ++i) {
std::copy_n(field_data.string_data().data(i).data(),
field_data.string_data().data(i).size(),
data_ + offsets_[i]);
}
break;
}
default: {
// empty array
}
}
}
Array(char* data,
size_t size,
DataType element_type,
std::vector<uint64_t>&& element_offsets)
: size_(size),
element_type_(element_type),
offsets_(std::move(element_offsets)),
length_(element_offsets.size()) {
delete[] data_;
data_ = new char[size];
std::copy(data, data + size, data_);
}
Array(const Array& array) noexcept
: length_{array.length_},
size_{array.size_},
element_type_{array.element_type_} {
delete[] data_;
data_ = new char[array.size_];
std::copy(array.data_, array.data_ + array.size_, data_);
offsets_ = array.offsets_;
}
Array&
operator=(const Array& array) {
delete[] data_;
data_ = new char[array.size_];
std::copy(array.data_, array.data_ + array.size_, data_);
length_ = array.length_;
size_ = array.size_;
offsets_ = array.offsets_;
element_type_ = array.element_type_;
return *this;
}
bool
operator==(const Array& arr) const {
if (element_type_ != arr.element_type_) {
return false;
}
if (length_ != arr.length_) {
return false;
}
if (length_ == 0) {
return true;
}
switch (element_type_) {
case DataType::INT64: {
for (int i = 0; i < length_; ++i) {
if (get_data<int64_t>(i) != arr.get_data<int64_t>(i)) {
return false;
}
}
return true;
}
case DataType::BOOL: {
for (int i = 0; i < length_; ++i) {
if (get_data<bool>(i) != arr.get_data<bool>(i)) {
return false;
}
}
return true;
}
case DataType::DOUBLE: {
for (int i = 0; i < length_; ++i) {
if (get_data<double>(i) != arr.get_data<double>(i)) {
return false;
}
}
return true;
}
case DataType::FLOAT: {
for (int i = 0; i < length_; ++i) {
if (get_data<float>(i) != arr.get_data<float>(i)) {
return false;
}
}
return true;
}
case DataType::INT32:
case DataType::INT16:
case DataType::INT8: {
for (int i = 0; i < length_; ++i) {
if (get_data<int>(i) != arr.get_data<int>(i)) {
return false;
}
}
return true;
}
case DataType::STRING:
case DataType::VARCHAR: {
for (int i = 0; i < length_; ++i) {
if (get_data<std::string_view>(i) !=
arr.get_data<std::string_view>(i)) {
return false;
}
}
return true;
}
default:
PanicCodeInfo(Unsupported,
"unsupported element type for array");
}
}
template <typename T>
T
get_data(const int index) const {
AssertInfo(
index >= 0 && index < length_,
fmt::format(
"index out of range, index={}, length={}", index, length_));
size_t element_length = (index == length_ - 1)
? size_ - offsets_.back()
: offsets_[index + 1] - offsets_[index];
if constexpr (std::is_same_v<T, std::string> ||
std::is_same_v<T, std::string_view>) {
return T(data_ + offsets_[index], element_length);
}
if constexpr (std::is_same_v<T, int> || std::is_same_v<T, int64_t> ||
std::is_same_v<T, float> || std::is_same_v<T, double>) {
switch (element_type_) {
case DataType::INT8:
case DataType::INT16:
case DataType::INT32:
return static_cast<T>(
reinterpret_cast<int32_t*>(data_)[index]);
case DataType::INT64:
return static_cast<T>(
reinterpret_cast<int64_t*>(data_)[index]);
case DataType::FLOAT:
return static_cast<T>(
reinterpret_cast<float*>(data_)[index]);
case DataType::DOUBLE:
return static_cast<T>(
reinterpret_cast<double*>(data_)[index]);
default:
PanicCodeInfo(Unsupported,
"unsupported element type for array");
}
}
return reinterpret_cast<T*>(data_)[index];
}
const std::vector<uint64_t>&
get_offsets() const {
return offsets_;
}
ScalarArray
output_data() const {
ScalarArray data_array;
switch (element_type_) {
case DataType::BOOL: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<bool>(j);
data_array.mutable_bool_data()->add_data(element);
}
break;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<int>(j);
data_array.mutable_int_data()->add_data(element);
}
break;
}
case DataType::INT64: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<int64_t>(j);
data_array.mutable_long_data()->add_data(element);
}
break;
}
case DataType::STRING:
case DataType::VARCHAR: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<std::string>(j);
data_array.mutable_string_data()->add_data(element);
}
break;
}
case DataType::FLOAT: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<float>(j);
data_array.mutable_float_data()->add_data(element);
}
break;
}
case DataType::DOUBLE: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<double>(j);
data_array.mutable_double_data()->add_data(element);
}
break;
}
default: {
// empty array
}
}
return data_array;
}
int
length() const {
return length_;
}
size_t
byte_size() const {
return size_;
}
DataType
get_element_type() const {
return element_type_;
}
const char*
data() const {
return data_;
}
bool
is_same_array(const proto::plan::Array& arr2) const {
if (arr2.array_size() != length_) {
return false;
}
if (length_ == 0) {
return true;
}
if (!arr2.same_type()) {
return false;
}
switch (element_type_) {
case DataType::BOOL: {
for (int i = 0; i < length_; i++) {
auto val = get_data<bool>(i);
if (val != arr2.array(i).bool_val()) {
return false;
}
}
return true;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
for (int i = 0; i < length_; i++) {
auto val = get_data<int>(i);
if (val != arr2.array(i).int64_val()) {
return false;
}
}
return true;
}
case DataType::INT64: {
for (int i = 0; i < length_; i++) {
auto val = get_data<int64_t>(i);
if (val != arr2.array(i).int64_val()) {
return false;
}
}
return true;
}
case DataType::FLOAT: {
for (int i = 0; i < length_; i++) {
auto val = get_data<float>(i);
if (val != arr2.array(i).float_val()) {
return false;
}
}
return true;
}
case DataType::DOUBLE: {
for (int i = 0; i < length_; i++) {
auto val = get_data<double>(i);
if (val != arr2.array(i).float_val()) {
return false;
}
}
return true;
}
case DataType::VARCHAR:
case DataType::STRING: {
for (int i = 0; i < length_; i++) {
auto val = get_data<std::string>(i);
if (val != arr2.array(i).string_val()) {
return false;
}
}
return true;
}
default:
return false;
}
}
private:
char* data_{nullptr};
int length_ = 0;
int size_ = 0;
std::vector<uint64_t> offsets_{};
DataType element_type_ = DataType::NONE;
};
class ArrayView {
public:
ArrayView() = default;
ArrayView(char* data,
size_t size,
DataType element_type,
std::vector<uint64_t>&& element_offsets)
: size_(size),
element_type_(element_type),
offsets_(std::move(element_offsets)),
length_(element_offsets.size()) {
data_ = data;
}
template <typename T>
T
get_data(const int index) const {
AssertInfo(
index >= 0 && index < length_,
fmt::format(
"index out of range, index={}, length={}", index, length_));
size_t element_length = (index == length_ - 1)
? size_ - offsets_.back()
: offsets_[index + 1] - offsets_[index];
if constexpr (std::is_same_v<T, std::string> ||
std::is_same_v<T, std::string_view>) {
return T(data_ + offsets_[index], element_length);
}
if constexpr (std::is_same_v<T, int> || std::is_same_v<T, int64_t> ||
std::is_same_v<T, float> || std::is_same_v<T, double>) {
switch (element_type_) {
case DataType::INT8:
case DataType::INT16:
case DataType::INT32:
return static_cast<T>(
reinterpret_cast<int32_t*>(data_)[index]);
case DataType::INT64:
return static_cast<T>(
reinterpret_cast<int64_t*>(data_)[index]);
case DataType::FLOAT:
return static_cast<T>(
reinterpret_cast<float*>(data_)[index]);
case DataType::DOUBLE:
return static_cast<T>(
reinterpret_cast<double*>(data_)[index]);
default:
PanicCodeInfo(Unsupported,
"unsupported element type for array");
}
}
return reinterpret_cast<T*>(data_)[index];
}
ScalarArray
output_data() const {
ScalarArray data_array;
switch (element_type_) {
case DataType::BOOL: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<bool>(j);
data_array.mutable_bool_data()->add_data(element);
}
break;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<int>(j);
data_array.mutable_int_data()->add_data(element);
}
break;
}
case DataType::INT64: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<int64_t>(j);
data_array.mutable_long_data()->add_data(element);
}
break;
}
case DataType::STRING:
case DataType::VARCHAR: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<std::string>(j);
data_array.mutable_string_data()->add_data(element);
}
break;
}
case DataType::FLOAT: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<float>(j);
data_array.mutable_float_data()->add_data(element);
}
break;
}
case DataType::DOUBLE: {
for (int j = 0; j < length_; ++j) {
auto element = get_data<double>(j);
data_array.mutable_double_data()->add_data(element);
}
break;
}
default: {
// empty array
}
}
return data_array;
}
int
length() const {
return length_;
}
size_t
byte_size() const {
return size_;
}
DataType
get_element_type() const {
return element_type_;
}
const void*
data() const {
return data_;
}
bool
is_same_array(const proto::plan::Array& arr2) const {
if (arr2.array_size() != length_) {
return false;
}
if (!arr2.same_type()) {
return false;
}
switch (element_type_) {
case DataType::BOOL: {
for (int i = 0; i < length_; i++) {
auto val = get_data<bool>(i);
if (val != arr2.array(i).bool_val()) {
return false;
}
}
return true;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
for (int i = 0; i < length_; i++) {
auto val = get_data<int>(i);
if (val != arr2.array(i).int64_val()) {
return false;
}
}
return true;
}
case DataType::INT64: {
for (int i = 0; i < length_; i++) {
auto val = get_data<int64_t>(i);
if (val != arr2.array(i).int64_val()) {
return false;
}
}
return true;
}
case DataType::FLOAT: {
for (int i = 0; i < length_; i++) {
auto val = get_data<float>(i);
if (val != arr2.array(i).float_val()) {
return false;
}
}
return true;
}
case DataType::DOUBLE: {
for (int i = 0; i < length_; i++) {
auto val = get_data<double>(i);
if (val != arr2.array(i).float_val()) {
return false;
}
}
return true;
}
case DataType::VARCHAR:
case DataType::STRING: {
for (int i = 0; i < length_; i++) {
auto val = get_data<std::string>(i);
if (val != arr2.array(i).string_val()) {
return false;
}
}
return true;
}
default:
return length_ == 0;
}
}
private:
char* data_{nullptr};
int length_ = 0;
int size_ = 0;
std::vector<uint64_t> offsets_{};
DataType element_type_ = DataType::NONE;
};
} // namespace milvus

View File

@ -62,6 +62,8 @@ datatype_sizeof(DataType data_type, int dim = 1) {
inline std::string
datatype_name(DataType data_type) {
switch (data_type) {
case DataType::NONE:
return "none";
case DataType::BOOL:
return "bool";
case DataType::INT8:
@ -76,6 +78,8 @@ datatype_name(DataType data_type) {
return "float";
case DataType::DOUBLE:
return "double";
case DataType::STRING:
return "string";
case DataType::VARCHAR:
return "varChar";
case DataType::ARRAY:
@ -127,6 +131,16 @@ datatype_is_binary(DataType datatype) {
}
}
inline bool
datatype_is_json(DataType datatype) {
return datatype == DataType::JSON;
}
inline bool
datatype_is_array(DataType datatype) {
return datatype == DataType::ARRAY;
}
inline bool
datatype_is_variable(DataType datatype) {
switch (datatype) {
@ -190,6 +204,14 @@ class FieldMeta {
Assert(datatype_is_string(type_));
}
FieldMeta(const FieldName& name,
FieldId id,
DataType type,
DataType element_type)
: name_(name), id_(id), type_(type), element_type_(element_type) {
Assert(datatype_is_array(type_));
}
FieldMeta(const FieldName& name,
FieldId id,
DataType type,
@ -238,6 +260,11 @@ class FieldMeta {
return type_;
}
DataType
get_element_type() const {
return element_type_;
}
bool
is_vector() const {
return datatype_is_vector(type_);
@ -274,6 +301,7 @@ class FieldMeta {
FieldName name_;
FieldId id_;
DataType type_ = DataType::NONE;
DataType element_type_ = DataType::NONE;
std::optional<VectorInfo> vector_info_;
std::optional<StringInfo> string_info_;
};

View File

@ -69,6 +69,9 @@ Schema::ParseFrom(const milvus::proto::schema::CollectionSchema& schema_proto) {
auto max_len =
boost::lexical_cast<int64_t>(type_map.at(MAX_LENGTH));
schema->AddField(name, field_id, data_type, max_len);
} else if (datatype_is_array(data_type)) {
schema->AddField(
name, field_id, data_type, DataType(child.element_type()));
} else {
schema->AddField(name, field_id, data_type);
}

View File

@ -41,6 +41,16 @@ class Schema {
return field_id;
}
FieldId
AddDebugField(const std::string& name,
DataType data_type,
DataType element_type) {
auto field_id = FieldId(debug_id);
debug_id++;
this->AddField(FieldName(name), field_id, data_type, element_type);
return field_id;
}
// auto gen field_id for convenience
FieldId
AddDebugField(const std::string& name,
@ -62,6 +72,16 @@ class Schema {
this->AddField(std::move(field_meta));
}
// array type
void
AddField(const FieldName& name,
const FieldId id,
DataType data_type,
DataType element_type) {
auto field_meta = FieldMeta(name, id, data_type, element_type);
this->AddField(std::move(field_meta));
}
// string type
void
AddField(const FieldName& name,

View File

@ -18,6 +18,7 @@
#include "Types.h"
#include <string>
#include <type_traits>
#include "Array.h"
namespace milvus {
@ -60,7 +61,9 @@ constexpr bool IsVector = std::is_base_of_v<VectorTrait, T>;
template <typename T>
constexpr bool IsScalar =
std::is_fundamental_v<T> || std::is_same_v<T, std::string> ||
std::is_same_v<T, Json> || std::is_same_v<T, std::string_view>;
std::is_same_v<T, Json> || std::is_same_v<T, std::string_view> ||
std::is_same_v<T, Array> || std::is_same_v<T, ArrayView> ||
std::is_same_v<T, proto::plan::Array>;
template <typename T, typename Enabled = void>
struct EmbeddedTypeImpl;

View File

@ -29,6 +29,7 @@
#include "log/Log.h"
#include "mmap/Utils.h"
#include "storage/FieldData.h"
#include "common/Array.h"
namespace milvus {
@ -328,4 +329,90 @@ class VariableColumn : public ColumnBase {
// Compatible with current Span type
std::vector<ViewType> views_{};
};
class ArrayColumn : public ColumnBase {
public:
// memory mode ctor
ArrayColumn(size_t num_rows, const FieldMeta& field_meta)
: ColumnBase(num_rows, field_meta),
element_type_(field_meta.get_element_type()) {
}
// mmap mode ctor
ArrayColumn(const File& file, size_t size, const FieldMeta& field_meta)
: ColumnBase(file, size, field_meta),
element_type_(field_meta.get_element_type()) {
}
ArrayColumn(ArrayColumn&& column) noexcept
: ColumnBase(std::move(column)),
indices_(std::move(column.indices_)),
views_(std::move(column.views_)),
element_type_(column.element_type_) {
}
~ArrayColumn() override = default;
SpanBase
Span() const override {
return SpanBase(views_.data(), views_.size(), sizeof(ArrayView));
}
[[nodiscard]] const std::vector<ArrayView>&
Views() const {
return views_;
}
ArrayView
operator[](const int i) const {
return views_[i];
}
ScalarArray
RawAt(const int i) const {
return views_[i].output_data();
}
void
Append(const Array& array) {
indices_.emplace_back(size_);
element_indices_.emplace_back(array.get_offsets());
ColumnBase::Append(static_cast<const char*>(array.data()),
array.byte_size());
}
void
Seal(std::vector<uint64_t>&& indices = {},
std::vector<std::vector<uint64_t>>&& element_indices = {}) {
if (!indices.empty()) {
indices_ = std::move(indices);
element_indices_ = std::move(element_indices);
}
ConstructViews();
}
protected:
void
ConstructViews() {
views_.reserve(indices_.size());
for (size_t i = 0; i < indices_.size() - 1; i++) {
views_.emplace_back(data_ + indices_[i],
indices_[i + 1] - indices_[i],
element_type_,
std::move(element_indices_[i]));
}
views_.emplace_back(data_ + indices_.back(),
size_ - indices_.back(),
element_type_,
std::move(element_indices_[indices_.size() - 1]));
element_indices_.clear();
}
private:
std::vector<uint64_t> indices_{};
std::vector<std::vector<uint64_t>> element_indices_{};
// Compatible with current Span type
std::vector<ArrayView> views_{};
DataType element_type_;
};
} // namespace milvus

View File

@ -80,7 +80,8 @@ FillField(DataType data_type, const storage::FieldDataPtr data, void* dst) {
inline size_t
WriteFieldData(File& file,
DataType data_type,
const storage::FieldDataPtr& data) {
const storage::FieldDataPtr& data,
std::vector<std::vector<uint64_t>>& element_indices) {
size_t total_written{0};
if (datatype_is_variable(data_type)) {
switch (data_type) {
@ -110,6 +111,19 @@ WriteFieldData(File& file,
}
break;
}
case DataType::ARRAY: {
for (size_t i = 0; i < data->get_num_rows(); ++i) {
auto array = static_cast<const Array*>(data->RawValue(i));
ssize_t written =
file.Write(array->data(), array->byte_size());
if (written < array->byte_size()) {
break;
}
element_indices.emplace_back(array->get_offsets());
total_written += written;
}
break;
}
default:
PanicInfo(fmt::format("not supported data type {}",
datatype_name(data_type)));

View File

@ -41,6 +41,7 @@ PROTOBUF_CONSTEXPR Array::Array(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.array_)*/{}
, /*decltype(_impl_.same_type_)*/false
, /*decltype(_impl_.element_type_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct ArrayDefaultTypeInternal {
PROTOBUF_CONSTEXPR ArrayDefaultTypeInternal()
@ -75,6 +76,7 @@ PROTOBUF_CONSTEXPR ColumnInfo::ColumnInfo(
, /*decltype(_impl_.is_primary_key_)*/false
, /*decltype(_impl_.is_autoid_)*/false
, /*decltype(_impl_.is_partition_key_)*/false
, /*decltype(_impl_.element_type_)*/0
, /*decltype(_impl_._cached_size_)*/{}} {}
struct ColumnInfoDefaultTypeInternal {
PROTOBUF_CONSTEXPR ColumnInfoDefaultTypeInternal()
@ -379,6 +381,7 @@ const uint32_t TableStruct_plan_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(pro
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::Array, _impl_.array_),
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::Array, _impl_.same_type_),
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::Array, _impl_.element_type_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::QueryInfo, _internal_metadata_),
~0u, // no _extensions_
@ -401,6 +404,7 @@ const uint32_t TableStruct_plan_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(pro
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::ColumnInfo, _impl_.is_autoid_),
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::ColumnInfo, _impl_.nested_path_),
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::ColumnInfo, _impl_.is_partition_key_),
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::ColumnInfo, _impl_.element_type_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::milvus::proto::plan::ColumnExpr, _internal_metadata_),
~0u, // no _extensions_
@ -577,26 +581,26 @@ const uint32_t TableStruct_plan_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(pro
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::milvus::proto::plan::GenericValue)},
{ 12, -1, -1, sizeof(::milvus::proto::plan::Array)},
{ 20, -1, -1, sizeof(::milvus::proto::plan::QueryInfo)},
{ 30, -1, -1, sizeof(::milvus::proto::plan::ColumnInfo)},
{ 42, -1, -1, sizeof(::milvus::proto::plan::ColumnExpr)},
{ 49, -1, -1, sizeof(::milvus::proto::plan::ExistsExpr)},
{ 56, -1, -1, sizeof(::milvus::proto::plan::ValueExpr)},
{ 63, -1, -1, sizeof(::milvus::proto::plan::UnaryRangeExpr)},
{ 72, -1, -1, sizeof(::milvus::proto::plan::BinaryRangeExpr)},
{ 83, -1, -1, sizeof(::milvus::proto::plan::CompareExpr)},
{ 92, -1, -1, sizeof(::milvus::proto::plan::TermExpr)},
{ 101, -1, -1, sizeof(::milvus::proto::plan::JSONContainsExpr)},
{ 111, -1, -1, sizeof(::milvus::proto::plan::UnaryExpr)},
{ 119, -1, -1, sizeof(::milvus::proto::plan::BinaryExpr)},
{ 128, -1, -1, sizeof(::milvus::proto::plan::BinaryArithOp)},
{ 137, -1, -1, sizeof(::milvus::proto::plan::BinaryArithExpr)},
{ 146, -1, -1, sizeof(::milvus::proto::plan::BinaryArithOpEvalRangeExpr)},
{ 157, -1, -1, sizeof(::milvus::proto::plan::AlwaysTrueExpr)},
{ 163, -1, -1, sizeof(::milvus::proto::plan::Expr)},
{ 183, -1, -1, sizeof(::milvus::proto::plan::VectorANNS)},
{ 194, -1, -1, sizeof(::milvus::proto::plan::QueryPlanNode)},
{ 203, -1, -1, sizeof(::milvus::proto::plan::PlanNode)},
{ 21, -1, -1, sizeof(::milvus::proto::plan::QueryInfo)},
{ 31, -1, -1, sizeof(::milvus::proto::plan::ColumnInfo)},
{ 44, -1, -1, sizeof(::milvus::proto::plan::ColumnExpr)},
{ 51, -1, -1, sizeof(::milvus::proto::plan::ExistsExpr)},
{ 58, -1, -1, sizeof(::milvus::proto::plan::ValueExpr)},
{ 65, -1, -1, sizeof(::milvus::proto::plan::UnaryRangeExpr)},
{ 74, -1, -1, sizeof(::milvus::proto::plan::BinaryRangeExpr)},
{ 85, -1, -1, sizeof(::milvus::proto::plan::CompareExpr)},
{ 94, -1, -1, sizeof(::milvus::proto::plan::TermExpr)},
{ 103, -1, -1, sizeof(::milvus::proto::plan::JSONContainsExpr)},
{ 113, -1, -1, sizeof(::milvus::proto::plan::UnaryExpr)},
{ 121, -1, -1, sizeof(::milvus::proto::plan::BinaryExpr)},
{ 130, -1, -1, sizeof(::milvus::proto::plan::BinaryArithOp)},
{ 139, -1, -1, sizeof(::milvus::proto::plan::BinaryArithExpr)},
{ 148, -1, -1, sizeof(::milvus::proto::plan::BinaryArithOpEvalRangeExpr)},
{ 159, -1, -1, sizeof(::milvus::proto::plan::AlwaysTrueExpr)},
{ 165, -1, -1, sizeof(::milvus::proto::plan::Expr)},
{ 185, -1, -1, sizeof(::milvus::proto::plan::VectorANNS)},
{ 196, -1, -1, sizeof(::milvus::proto::plan::QueryPlanNode)},
{ 205, -1, -1, sizeof(::milvus::proto::plan::PlanNode)},
};
static const ::_pb::Message* const file_default_instances[] = {
@ -630,117 +634,120 @@ const char descriptor_table_protodef_plan_2eproto[] PROTOBUF_SECTION_VARIABLE(pr
"H\000\022\023\n\tint64_val\030\002 \001(\003H\000\022\023\n\tfloat_val\030\003 \001"
"(\001H\000\022\024\n\nstring_val\030\004 \001(\tH\000\022-\n\tarray_val\030"
"\005 \001(\0132\030.milvus.proto.plan.ArrayH\000B\005\n\003val"
"\"J\n\005Array\022.\n\005array\030\001 \003(\0132\037.milvus.proto."
"plan.GenericValue\022\021\n\tsame_type\030\002 \001(\010\"\\\n\t"
"QueryInfo\022\014\n\004topk\030\001 \001(\003\022\023\n\013metric_type\030\003"
" \001(\t\022\025\n\rsearch_params\030\004 \001(\t\022\025\n\rround_dec"
"imal\030\005 \001(\003\"\252\001\n\nColumnInfo\022\020\n\010field_id\030\001 "
"\001(\003\0220\n\tdata_type\030\002 \001(\0162\035.milvus.proto.sc"
"hema.DataType\022\026\n\016is_primary_key\030\003 \001(\010\022\021\n"
"\tis_autoID\030\004 \001(\010\022\023\n\013nested_path\030\005 \003(\t\022\030\n"
"\020is_partition_key\030\006 \001(\010\"9\n\nColumnExpr\022+\n"
"\004info\030\001 \001(\0132\035.milvus.proto.plan.ColumnIn"
"fo\"9\n\nExistsExpr\022+\n\004info\030\001 \001(\0132\035.milvus."
"proto.plan.ColumnInfo\";\n\tValueExpr\022.\n\005va"
"lue\030\001 \001(\0132\037.milvus.proto.plan.GenericVal"
"ue\"\233\001\n\016UnaryRangeExpr\0222\n\013column_info\030\001 \001"
"(\0132\035.milvus.proto.plan.ColumnInfo\022%\n\002op\030"
"\002 \001(\0162\031.milvus.proto.plan.OpType\022.\n\005valu"
"e\030\003 \001(\0132\037.milvus.proto.plan.GenericValue"
"\"\343\001\n\017BinaryRangeExpr\0222\n\013column_info\030\001 \001("
"\0132\035.milvus.proto.plan.ColumnInfo\022\027\n\017lowe"
"r_inclusive\030\002 \001(\010\022\027\n\017upper_inclusive\030\003 \001"
"(\010\0224\n\013lower_value\030\004 \001(\0132\037.milvus.proto.p"
"lan.GenericValue\0224\n\013upper_value\030\005 \001(\0132\037."
"milvus.proto.plan.GenericValue\"\247\001\n\013Compa"
"reExpr\0227\n\020left_column_info\030\001 \001(\0132\035.milvu"
"s.proto.plan.ColumnInfo\0228\n\021right_column_"
"info\030\002 \001(\0132\035.milvus.proto.plan.ColumnInf"
"o\022%\n\002op\030\003 \001(\0162\031.milvus.proto.plan.OpType"
"\"\204\001\n\010TermExpr\0222\n\013column_info\030\001 \001(\0132\035.mil"
"vus.proto.plan.ColumnInfo\022/\n\006values\030\002 \003("
"\0132\037.milvus.proto.plan.GenericValue\022\023\n\013is"
"_in_field\030\003 \001(\010\"\224\002\n\020JSONContainsExpr\0222\n\013"
"column_info\030\001 \001(\0132\035.milvus.proto.plan.Co"
"lumnInfo\0221\n\010elements\030\002 \003(\0132\037.milvus.prot"
"o.plan.GenericValue\0226\n\002op\030\003 \001(\0162*.milvus"
".proto.plan.JSONContainsExpr.JSONOp\022\032\n\022e"
"lements_same_type\030\004 \001(\010\"E\n\006JSONOp\022\013\n\007Inv"
"alid\020\000\022\014\n\010Contains\020\001\022\017\n\013ContainsAll\020\002\022\017\n"
"\013ContainsAny\020\003\"\206\001\n\tUnaryExpr\0220\n\002op\030\001 \001(\016"
"2$.milvus.proto.plan.UnaryExpr.UnaryOp\022&"
"\n\005child\030\002 \001(\0132\027.milvus.proto.plan.Expr\"\037"
"\n\007UnaryOp\022\013\n\007Invalid\020\000\022\007\n\003Not\020\001\"\307\001\n\nBina"
"ryExpr\0222\n\002op\030\001 \001(\0162&.milvus.proto.plan.B"
"inaryExpr.BinaryOp\022%\n\004left\030\002 \001(\0132\027.milvu"
"s.proto.plan.Expr\022&\n\005right\030\003 \001(\0132\027.milvu"
"s.proto.plan.Expr\"6\n\010BinaryOp\022\013\n\007Invalid"
"\020\000\022\016\n\nLogicalAnd\020\001\022\r\n\tLogicalOr\020\002\"\255\001\n\rBi"
"naryArithOp\0222\n\013column_info\030\001 \001(\0132\035.milvu"
"s.proto.plan.ColumnInfo\0220\n\010arith_op\030\002 \001("
"\0162\036.milvus.proto.plan.ArithOpType\0226\n\rrig"
"ht_operand\030\003 \001(\0132\037.milvus.proto.plan.Gen"
"ericValue\"\214\001\n\017BinaryArithExpr\022%\n\004left\030\001 "
"\001(\0132\027.milvus.proto.plan.Expr\022&\n\005right\030\002 "
"\001(\0132\027.milvus.proto.plan.Expr\022*\n\002op\030\003 \001(\016"
"2\036.milvus.proto.plan.ArithOpType\"\221\002\n\032Bin"
"aryArithOpEvalRangeExpr\0222\n\013column_info\030\001"
" \001(\0132\035.milvus.proto.plan.ColumnInfo\0220\n\010a"
"rith_op\030\002 \001(\0162\036.milvus.proto.plan.ArithO"
"pType\0226\n\rright_operand\030\003 \001(\0132\037.milvus.pr"
"oto.plan.GenericValue\022%\n\002op\030\004 \001(\0162\031.milv"
"us.proto.plan.OpType\022.\n\005value\030\005 \001(\0132\037.mi"
"lvus.proto.plan.GenericValue\"\020\n\016AlwaysTr"
"ueExpr\"\237\006\n\004Expr\0220\n\tterm_expr\030\001 \001(\0132\033.mil"
"vus.proto.plan.TermExprH\000\0222\n\nunary_expr\030"
"\002 \001(\0132\034.milvus.proto.plan.UnaryExprH\000\0224\n"
"\013binary_expr\030\003 \001(\0132\035.milvus.proto.plan.B"
"inaryExprH\000\0226\n\014compare_expr\030\004 \001(\0132\036.milv"
"us.proto.plan.CompareExprH\000\022=\n\020unary_ran"
"ge_expr\030\005 \001(\0132!.milvus.proto.plan.UnaryR"
"angeExprH\000\022\?\n\021binary_range_expr\030\006 \001(\0132\"."
"milvus.proto.plan.BinaryRangeExprH\000\022X\n\037b"
"inary_arith_op_eval_range_expr\030\007 \001(\0132-.m"
"ilvus.proto.plan.BinaryArithOpEvalRangeE"
"xprH\000\022\?\n\021binary_arith_expr\030\010 \001(\0132\".milvu"
"s.proto.plan.BinaryArithExprH\000\0222\n\nvalue_"
"expr\030\t \001(\0132\034.milvus.proto.plan.ValueExpr"
"H\000\0224\n\013column_expr\030\n \001(\0132\035.milvus.proto.p"
"lan.ColumnExprH\000\0224\n\013exists_expr\030\013 \001(\0132\035."
"milvus.proto.plan.ExistsExprH\000\022=\n\020always"
"_true_expr\030\014 \001(\0132!.milvus.proto.plan.Alw"
"aysTrueExprH\000\022A\n\022json_contains_expr\030\r \001("
"\0132#.milvus.proto.plan.JSONContainsExprH\000"
"B\006\n\004expr\"\312\001\n\nVectorANNS\0222\n\013vector_type\030\001"
" \001(\0162\035.milvus.proto.plan.VectorType\022\020\n\010f"
"ield_id\030\002 \001(\003\022+\n\npredicates\030\003 \001(\0132\027.milv"
"us.proto.plan.Expr\0220\n\nquery_info\030\004 \001(\0132\034"
".milvus.proto.plan.QueryInfo\022\027\n\017placehol"
"der_tag\030\005 \001(\t\"]\n\rQueryPlanNode\022+\n\npredic"
"ates\030\001 \001(\0132\027.milvus.proto.plan.Expr\022\020\n\010i"
"s_count\030\002 \001(\010\022\r\n\005limit\030\003 \001(\003\"\304\001\n\010PlanNod"
"e\0224\n\013vector_anns\030\001 \001(\0132\035.milvus.proto.pl"
"an.VectorANNSH\000\022-\n\npredicates\030\002 \001(\0132\027.mi"
"lvus.proto.plan.ExprH\000\0221\n\005query\030\004 \001(\0132 ."
"milvus.proto.plan.QueryPlanNodeH\000\022\030\n\020out"
"put_field_ids\030\003 \003(\003B\006\n\004node*\272\001\n\006OpType\022\013"
"\n\007Invalid\020\000\022\017\n\013GreaterThan\020\001\022\020\n\014GreaterE"
"qual\020\002\022\014\n\010LessThan\020\003\022\r\n\tLessEqual\020\004\022\t\n\005E"
"qual\020\005\022\014\n\010NotEqual\020\006\022\017\n\013PrefixMatch\020\007\022\020\n"
"\014PostfixMatch\020\010\022\t\n\005Match\020\t\022\t\n\005Range\020\n\022\006\n"
"\002In\020\013\022\t\n\005NotIn\020\014*G\n\013ArithOpType\022\013\n\007Unkno"
"wn\020\000\022\007\n\003Add\020\001\022\007\n\003Sub\020\002\022\007\n\003Mul\020\003\022\007\n\003Div\020\004"
"\022\007\n\003Mod\020\005*B\n\nVectorType\022\020\n\014BinaryVector\020"
"\000\022\017\n\013FloatVector\020\001\022\021\n\rFloat16Vector\020\002B3Z"
"1github.com/milvus-io/milvus/internal/pr"
"oto/planpbb\006proto3"
"\"\177\n\005Array\022.\n\005array\030\001 \003(\0132\037.milvus.proto."
"plan.GenericValue\022\021\n\tsame_type\030\002 \001(\010\0223\n\014"
"element_type\030\003 \001(\0162\035.milvus.proto.schema"
".DataType\"\\\n\tQueryInfo\022\014\n\004topk\030\001 \001(\003\022\023\n\013"
"metric_type\030\003 \001(\t\022\025\n\rsearch_params\030\004 \001(\t"
"\022\025\n\rround_decimal\030\005 \001(\003\"\337\001\n\nColumnInfo\022\020"
"\n\010field_id\030\001 \001(\003\0220\n\tdata_type\030\002 \001(\0162\035.mi"
"lvus.proto.schema.DataType\022\026\n\016is_primary"
"_key\030\003 \001(\010\022\021\n\tis_autoID\030\004 \001(\010\022\023\n\013nested_"
"path\030\005 \003(\t\022\030\n\020is_partition_key\030\006 \001(\010\0223\n\014"
"element_type\030\007 \001(\0162\035.milvus.proto.schema"
".DataType\"9\n\nColumnExpr\022+\n\004info\030\001 \001(\0132\035."
"milvus.proto.plan.ColumnInfo\"9\n\nExistsEx"
"pr\022+\n\004info\030\001 \001(\0132\035.milvus.proto.plan.Col"
"umnInfo\";\n\tValueExpr\022.\n\005value\030\001 \001(\0132\037.mi"
"lvus.proto.plan.GenericValue\"\233\001\n\016UnaryRa"
"ngeExpr\0222\n\013column_info\030\001 \001(\0132\035.milvus.pr"
"oto.plan.ColumnInfo\022%\n\002op\030\002 \001(\0162\031.milvus"
".proto.plan.OpType\022.\n\005value\030\003 \001(\0132\037.milv"
"us.proto.plan.GenericValue\"\343\001\n\017BinaryRan"
"geExpr\0222\n\013column_info\030\001 \001(\0132\035.milvus.pro"
"to.plan.ColumnInfo\022\027\n\017lower_inclusive\030\002 "
"\001(\010\022\027\n\017upper_inclusive\030\003 \001(\010\0224\n\013lower_va"
"lue\030\004 \001(\0132\037.milvus.proto.plan.GenericVal"
"ue\0224\n\013upper_value\030\005 \001(\0132\037.milvus.proto.p"
"lan.GenericValue\"\247\001\n\013CompareExpr\0227\n\020left"
"_column_info\030\001 \001(\0132\035.milvus.proto.plan.C"
"olumnInfo\0228\n\021right_column_info\030\002 \001(\0132\035.m"
"ilvus.proto.plan.ColumnInfo\022%\n\002op\030\003 \001(\0162"
"\031.milvus.proto.plan.OpType\"\204\001\n\010TermExpr\022"
"2\n\013column_info\030\001 \001(\0132\035.milvus.proto.plan"
".ColumnInfo\022/\n\006values\030\002 \003(\0132\037.milvus.pro"
"to.plan.GenericValue\022\023\n\013is_in_field\030\003 \001("
"\010\"\224\002\n\020JSONContainsExpr\0222\n\013column_info\030\001 "
"\001(\0132\035.milvus.proto.plan.ColumnInfo\0221\n\010el"
"ements\030\002 \003(\0132\037.milvus.proto.plan.Generic"
"Value\0226\n\002op\030\003 \001(\0162*.milvus.proto.plan.JS"
"ONContainsExpr.JSONOp\022\032\n\022elements_same_t"
"ype\030\004 \001(\010\"E\n\006JSONOp\022\013\n\007Invalid\020\000\022\014\n\010Cont"
"ains\020\001\022\017\n\013ContainsAll\020\002\022\017\n\013ContainsAny\020\003"
"\"\206\001\n\tUnaryExpr\0220\n\002op\030\001 \001(\0162$.milvus.prot"
"o.plan.UnaryExpr.UnaryOp\022&\n\005child\030\002 \001(\0132"
"\027.milvus.proto.plan.Expr\"\037\n\007UnaryOp\022\013\n\007I"
"nvalid\020\000\022\007\n\003Not\020\001\"\307\001\n\nBinaryExpr\0222\n\002op\030\001"
" \001(\0162&.milvus.proto.plan.BinaryExpr.Bina"
"ryOp\022%\n\004left\030\002 \001(\0132\027.milvus.proto.plan.E"
"xpr\022&\n\005right\030\003 \001(\0132\027.milvus.proto.plan.E"
"xpr\"6\n\010BinaryOp\022\013\n\007Invalid\020\000\022\016\n\nLogicalA"
"nd\020\001\022\r\n\tLogicalOr\020\002\"\255\001\n\rBinaryArithOp\0222\n"
"\013column_info\030\001 \001(\0132\035.milvus.proto.plan.C"
"olumnInfo\0220\n\010arith_op\030\002 \001(\0162\036.milvus.pro"
"to.plan.ArithOpType\0226\n\rright_operand\030\003 \001"
"(\0132\037.milvus.proto.plan.GenericValue\"\214\001\n\017"
"BinaryArithExpr\022%\n\004left\030\001 \001(\0132\027.milvus.p"
"roto.plan.Expr\022&\n\005right\030\002 \001(\0132\027.milvus.p"
"roto.plan.Expr\022*\n\002op\030\003 \001(\0162\036.milvus.prot"
"o.plan.ArithOpType\"\221\002\n\032BinaryArithOpEval"
"RangeExpr\0222\n\013column_info\030\001 \001(\0132\035.milvus."
"proto.plan.ColumnInfo\0220\n\010arith_op\030\002 \001(\0162"
"\036.milvus.proto.plan.ArithOpType\0226\n\rright"
"_operand\030\003 \001(\0132\037.milvus.proto.plan.Gener"
"icValue\022%\n\002op\030\004 \001(\0162\031.milvus.proto.plan."
"OpType\022.\n\005value\030\005 \001(\0132\037.milvus.proto.pla"
"n.GenericValue\"\020\n\016AlwaysTrueExpr\"\237\006\n\004Exp"
"r\0220\n\tterm_expr\030\001 \001(\0132\033.milvus.proto.plan"
".TermExprH\000\0222\n\nunary_expr\030\002 \001(\0132\034.milvus"
".proto.plan.UnaryExprH\000\0224\n\013binary_expr\030\003"
" \001(\0132\035.milvus.proto.plan.BinaryExprH\000\0226\n"
"\014compare_expr\030\004 \001(\0132\036.milvus.proto.plan."
"CompareExprH\000\022=\n\020unary_range_expr\030\005 \001(\0132"
"!.milvus.proto.plan.UnaryRangeExprH\000\022\?\n\021"
"binary_range_expr\030\006 \001(\0132\".milvus.proto.p"
"lan.BinaryRangeExprH\000\022X\n\037binary_arith_op"
"_eval_range_expr\030\007 \001(\0132-.milvus.proto.pl"
"an.BinaryArithOpEvalRangeExprH\000\022\?\n\021binar"
"y_arith_expr\030\010 \001(\0132\".milvus.proto.plan.B"
"inaryArithExprH\000\0222\n\nvalue_expr\030\t \001(\0132\034.m"
"ilvus.proto.plan.ValueExprH\000\0224\n\013column_e"
"xpr\030\n \001(\0132\035.milvus.proto.plan.ColumnExpr"
"H\000\0224\n\013exists_expr\030\013 \001(\0132\035.milvus.proto.p"
"lan.ExistsExprH\000\022=\n\020always_true_expr\030\014 \001"
"(\0132!.milvus.proto.plan.AlwaysTrueExprH\000\022"
"A\n\022json_contains_expr\030\r \001(\0132#.milvus.pro"
"to.plan.JSONContainsExprH\000B\006\n\004expr\"\312\001\n\nV"
"ectorANNS\0222\n\013vector_type\030\001 \001(\0162\035.milvus."
"proto.plan.VectorType\022\020\n\010field_id\030\002 \001(\003\022"
"+\n\npredicates\030\003 \001(\0132\027.milvus.proto.plan."
"Expr\0220\n\nquery_info\030\004 \001(\0132\034.milvus.proto."
"plan.QueryInfo\022\027\n\017placeholder_tag\030\005 \001(\t\""
"]\n\rQueryPlanNode\022+\n\npredicates\030\001 \001(\0132\027.m"
"ilvus.proto.plan.Expr\022\020\n\010is_count\030\002 \001(\010\022"
"\r\n\005limit\030\003 \001(\003\"\304\001\n\010PlanNode\0224\n\013vector_an"
"ns\030\001 \001(\0132\035.milvus.proto.plan.VectorANNSH"
"\000\022-\n\npredicates\030\002 \001(\0132\027.milvus.proto.pla"
"n.ExprH\000\0221\n\005query\030\004 \001(\0132 .milvus.proto.p"
"lan.QueryPlanNodeH\000\022\030\n\020output_field_ids\030"
"\003 \003(\003B\006\n\004node*\272\001\n\006OpType\022\013\n\007Invalid\020\000\022\017\n"
"\013GreaterThan\020\001\022\020\n\014GreaterEqual\020\002\022\014\n\010Less"
"Than\020\003\022\r\n\tLessEqual\020\004\022\t\n\005Equal\020\005\022\014\n\010NotE"
"qual\020\006\022\017\n\013PrefixMatch\020\007\022\020\n\014PostfixMatch\020"
"\010\022\t\n\005Match\020\t\022\t\n\005Range\020\n\022\006\n\002In\020\013\022\t\n\005NotIn"
"\020\014*X\n\013ArithOpType\022\013\n\007Unknown\020\000\022\007\n\003Add\020\001\022"
"\007\n\003Sub\020\002\022\007\n\003Mul\020\003\022\007\n\003Div\020\004\022\007\n\003Mod\020\005\022\017\n\013A"
"rrayLength\020\006*B\n\nVectorType\022\020\n\014BinaryVect"
"or\020\000\022\017\n\013FloatVector\020\001\022\021\n\rFloat16Vector\020\002"
"B3Z1github.com/milvus-io/milvus/internal"
"/proto/planpbb\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_plan_2eproto_deps[1] = {
&::descriptor_table_schema_2eproto,
};
static ::_pbi::once_flag descriptor_table_plan_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_plan_2eproto = {
false, false, 4338, descriptor_table_protodef_plan_2eproto,
false, false, 4461, descriptor_table_protodef_plan_2eproto,
"plan.proto",
&descriptor_table_plan_2eproto_once, descriptor_table_plan_2eproto_deps, 1, 22,
schemas, file_default_instances, TableStruct_plan_2eproto::offsets,
@ -862,6 +869,7 @@ bool ArithOpType_IsValid(int value) {
case 3:
case 4:
case 5:
case 6:
return true;
default:
return false;
@ -1281,10 +1289,13 @@ Array::Array(const Array& from)
new (&_impl_) Impl_{
decltype(_impl_.array_){from._impl_.array_}
, decltype(_impl_.same_type_){}
, decltype(_impl_.element_type_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_impl_.same_type_ = from._impl_.same_type_;
::memcpy(&_impl_.same_type_, &from._impl_.same_type_,
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.element_type_) -
reinterpret_cast<char*>(&_impl_.same_type_)) + sizeof(_impl_.element_type_));
// @@protoc_insertion_point(copy_constructor:milvus.proto.plan.Array)
}
@ -1295,6 +1306,7 @@ inline void Array::SharedCtor(
new (&_impl_) Impl_{
decltype(_impl_.array_){arena}
, decltype(_impl_.same_type_){false}
, decltype(_impl_.element_type_){0}
, /*decltype(_impl_._cached_size_)*/{}
};
}
@ -1324,7 +1336,9 @@ void Array::Clear() {
(void) cached_has_bits;
_impl_.array_.Clear();
_impl_.same_type_ = false;
::memset(&_impl_.same_type_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.element_type_) -
reinterpret_cast<char*>(&_impl_.same_type_)) + sizeof(_impl_.element_type_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
@ -1355,6 +1369,15 @@ const char* Array::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
} else
goto handle_unusual;
continue;
// .milvus.proto.schema.DataType element_type = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
_internal_set_element_type(static_cast<::milvus::proto::schema::DataType>(val));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
@ -1398,6 +1421,13 @@ uint8_t* Array::_InternalSerialize(
target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_same_type(), target);
}
// .milvus.proto.schema.DataType element_type = 3;
if (this->_internal_element_type() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
3, this->_internal_element_type(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
@ -1426,6 +1456,12 @@ size_t Array::ByteSizeLong() const {
total_size += 1 + 1;
}
// .milvus.proto.schema.DataType element_type = 3;
if (this->_internal_element_type() != 0) {
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_element_type());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
@ -1448,6 +1484,9 @@ void Array::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF
if (from._internal_same_type() != 0) {
_this->_internal_set_same_type(from._internal_same_type());
}
if (from._internal_element_type() != 0) {
_this->_internal_set_element_type(from._internal_element_type());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
@ -1466,7 +1505,12 @@ void Array::InternalSwap(Array* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
_impl_.array_.InternalSwap(&other->_impl_.array_);
swap(_impl_.same_type_, other->_impl_.same_type_);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(Array, _impl_.element_type_)
+ sizeof(Array::_impl_.element_type_)
- PROTOBUF_FIELD_OFFSET(Array, _impl_.same_type_)>(
reinterpret_cast<char*>(&_impl_.same_type_),
reinterpret_cast<char*>(&other->_impl_.same_type_));
}
::PROTOBUF_NAMESPACE_ID::Metadata Array::GetMetadata() const {
@ -1810,12 +1854,13 @@ ColumnInfo::ColumnInfo(const ColumnInfo& from)
, decltype(_impl_.is_primary_key_){}
, decltype(_impl_.is_autoid_){}
, decltype(_impl_.is_partition_key_){}
, decltype(_impl_.element_type_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::memcpy(&_impl_.field_id_, &from._impl_.field_id_,
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.is_partition_key_) -
reinterpret_cast<char*>(&_impl_.field_id_)) + sizeof(_impl_.is_partition_key_));
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.element_type_) -
reinterpret_cast<char*>(&_impl_.field_id_)) + sizeof(_impl_.element_type_));
// @@protoc_insertion_point(copy_constructor:milvus.proto.plan.ColumnInfo)
}
@ -1830,6 +1875,7 @@ inline void ColumnInfo::SharedCtor(
, decltype(_impl_.is_primary_key_){false}
, decltype(_impl_.is_autoid_){false}
, decltype(_impl_.is_partition_key_){false}
, decltype(_impl_.element_type_){0}
, /*decltype(_impl_._cached_size_)*/{}
};
}
@ -1860,8 +1906,8 @@ void ColumnInfo::Clear() {
_impl_.nested_path_.Clear();
::memset(&_impl_.field_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.is_partition_key_) -
reinterpret_cast<char*>(&_impl_.field_id_)) + sizeof(_impl_.is_partition_key_));
reinterpret_cast<char*>(&_impl_.element_type_) -
reinterpret_cast<char*>(&_impl_.field_id_)) + sizeof(_impl_.element_type_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
@ -1927,6 +1973,15 @@ const char* ColumnInfo::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct
} else
goto handle_unusual;
continue;
// .milvus.proto.schema.DataType element_type = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
_internal_set_element_type(static_cast<::milvus::proto::schema::DataType>(val));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
@ -1997,6 +2052,13 @@ uint8_t* ColumnInfo::_InternalSerialize(
target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_is_partition_key(), target);
}
// .milvus.proto.schema.DataType element_type = 7;
if (this->_internal_element_type() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
7, this->_internal_element_type(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
@ -2047,6 +2109,12 @@ size_t ColumnInfo::ByteSizeLong() const {
total_size += 1 + 1;
}
// .milvus.proto.schema.DataType element_type = 7;
if (this->_internal_element_type() != 0) {
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_element_type());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
@ -2081,6 +2149,9 @@ void ColumnInfo::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PRO
if (from._internal_is_partition_key() != 0) {
_this->_internal_set_is_partition_key(from._internal_is_partition_key());
}
if (from._internal_element_type() != 0) {
_this->_internal_set_element_type(from._internal_element_type());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
@ -2100,8 +2171,8 @@ void ColumnInfo::InternalSwap(ColumnInfo* other) {
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
_impl_.nested_path_.InternalSwap(&other->_impl_.nested_path_);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(ColumnInfo, _impl_.is_partition_key_)
+ sizeof(ColumnInfo::_impl_.is_partition_key_)
PROTOBUF_FIELD_OFFSET(ColumnInfo, _impl_.element_type_)
+ sizeof(ColumnInfo::_impl_.element_type_)
- PROTOBUF_FIELD_OFFSET(ColumnInfo, _impl_.field_id_)>(
reinterpret_cast<char*>(&_impl_.field_id_),
reinterpret_cast<char*>(&other->_impl_.field_id_));

View File

@ -268,12 +268,13 @@ enum ArithOpType : int {
Mul = 3,
Div = 4,
Mod = 5,
ArrayLength = 6,
ArithOpType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::min(),
ArithOpType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::max()
};
bool ArithOpType_IsValid(int value);
constexpr ArithOpType ArithOpType_MIN = Unknown;
constexpr ArithOpType ArithOpType_MAX = Mod;
constexpr ArithOpType ArithOpType_MAX = ArrayLength;
constexpr int ArithOpType_ARRAYSIZE = ArithOpType_MAX + 1;
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ArithOpType_descriptor();
@ -688,6 +689,7 @@ class Array final :
enum : int {
kArrayFieldNumber = 1,
kSameTypeFieldNumber = 2,
kElementTypeFieldNumber = 3,
};
// repeated .milvus.proto.plan.GenericValue array = 1;
int array_size() const;
@ -716,6 +718,15 @@ class Array final :
void _internal_set_same_type(bool value);
public:
// .milvus.proto.schema.DataType element_type = 3;
void clear_element_type();
::milvus::proto::schema::DataType element_type() const;
void set_element_type(::milvus::proto::schema::DataType value);
private:
::milvus::proto::schema::DataType _internal_element_type() const;
void _internal_set_element_type(::milvus::proto::schema::DataType value);
public:
// @@protoc_insertion_point(class_scope:milvus.proto.plan.Array)
private:
class _Internal;
@ -726,6 +737,7 @@ class Array final :
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::proto::plan::GenericValue > array_;
bool same_type_;
int element_type_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
@ -1051,6 +1063,7 @@ class ColumnInfo final :
kIsPrimaryKeyFieldNumber = 3,
kIsAutoIDFieldNumber = 4,
kIsPartitionKeyFieldNumber = 6,
kElementTypeFieldNumber = 7,
};
// repeated string nested_path = 5;
int nested_path_size() const;
@ -1121,6 +1134,15 @@ class ColumnInfo final :
void _internal_set_is_partition_key(bool value);
public:
// .milvus.proto.schema.DataType element_type = 7;
void clear_element_type();
::milvus::proto::schema::DataType element_type() const;
void set_element_type(::milvus::proto::schema::DataType value);
private:
::milvus::proto::schema::DataType _internal_element_type() const;
void _internal_set_element_type(::milvus::proto::schema::DataType value);
public:
// @@protoc_insertion_point(class_scope:milvus.proto.plan.ColumnInfo)
private:
class _Internal;
@ -1135,6 +1157,7 @@ class ColumnInfo final :
bool is_primary_key_;
bool is_autoid_;
bool is_partition_key_;
int element_type_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
@ -5182,6 +5205,26 @@ inline void Array::set_same_type(bool value) {
// @@protoc_insertion_point(field_set:milvus.proto.plan.Array.same_type)
}
// .milvus.proto.schema.DataType element_type = 3;
inline void Array::clear_element_type() {
_impl_.element_type_ = 0;
}
inline ::milvus::proto::schema::DataType Array::_internal_element_type() const {
return static_cast< ::milvus::proto::schema::DataType >(_impl_.element_type_);
}
inline ::milvus::proto::schema::DataType Array::element_type() const {
// @@protoc_insertion_point(field_get:milvus.proto.plan.Array.element_type)
return _internal_element_type();
}
inline void Array::_internal_set_element_type(::milvus::proto::schema::DataType value) {
_impl_.element_type_ = value;
}
inline void Array::set_element_type(::milvus::proto::schema::DataType value) {
_internal_set_element_type(value);
// @@protoc_insertion_point(field_set:milvus.proto.plan.Array.element_type)
}
// -------------------------------------------------------------------
// QueryInfo
@ -5505,6 +5548,26 @@ inline void ColumnInfo::set_is_partition_key(bool value) {
// @@protoc_insertion_point(field_set:milvus.proto.plan.ColumnInfo.is_partition_key)
}
// .milvus.proto.schema.DataType element_type = 7;
inline void ColumnInfo::clear_element_type() {
_impl_.element_type_ = 0;
}
inline ::milvus::proto::schema::DataType ColumnInfo::_internal_element_type() const {
return static_cast< ::milvus::proto::schema::DataType >(_impl_.element_type_);
}
inline ::milvus::proto::schema::DataType ColumnInfo::element_type() const {
// @@protoc_insertion_point(field_get:milvus.proto.plan.ColumnInfo.element_type)
return _internal_element_type();
}
inline void ColumnInfo::_internal_set_element_type(::milvus::proto::schema::DataType value) {
_impl_.element_type_ = value;
}
inline void ColumnInfo::set_element_type(::milvus::proto::schema::DataType value) {
_internal_set_element_type(value);
// @@protoc_insertion_point(field_set:milvus.proto.plan.ColumnInfo.element_type)
}
// -------------------------------------------------------------------
// ColumnExpr

View File

@ -87,6 +87,9 @@ ExtractUnaryRangeExprImpl(FieldId field_id,
} else if constexpr (std::is_same_v<T, std::string>) {
Assert(value_proto.val_case() == planpb::GenericValue::kStringVal);
return static_cast<T>(value_proto.string_val());
} else if constexpr (std::is_same_v<T, proto::plan::Array>) {
Assert(value_proto.val_case() == planpb::GenericValue::kArrayVal);
return static_cast<proto::plan::Array>(value_proto.array_val());
} else {
static_assert(always_false<T>);
}
@ -151,6 +154,15 @@ ExtractBinaryArithOpEvalRangeExprImpl(
static_assert(always_false<T>);
}
};
if (expr_proto.arith_op() == proto::plan::ArrayLength) {
return std::make_unique<BinaryArithOpEvalRangeExprImpl<T>>(
expr_proto.column_info(),
expr_proto.value().val_case(),
expr_proto.arith_op(),
0,
expr_proto.op(),
getValue(expr_proto.value()));
}
return std::make_unique<BinaryArithOpEvalRangeExprImpl<T>>(
expr_proto.column_info(),
expr_proto.value().val_case(),
@ -307,7 +319,8 @@ ProtoParser::ParseUnaryRangeExpr(const proto::plan::UnaryRangeExpr& expr_pb) {
return ExtractUnaryRangeExprImpl<std::string>(
field_id, data_type, expr_pb);
}
case DataType::JSON: {
case DataType::JSON:
case DataType::ARRAY: {
switch (expr_pb.value().val_case()) {
case proto::plan::GenericValue::ValCase::kBoolVal:
return ExtractUnaryRangeExprImpl<bool>(
@ -321,6 +334,9 @@ ProtoParser::ParseUnaryRangeExpr(const proto::plan::UnaryRangeExpr& expr_pb) {
case proto::plan::GenericValue::ValCase::kStringVal:
return ExtractUnaryRangeExprImpl<std::string>(
field_id, data_type, expr_pb);
case proto::plan::GenericValue::ValCase::kArrayVal:
return ExtractUnaryRangeExprImpl<proto::plan::Array>(
field_id, data_type, expr_pb);
default:
PanicInfo(
fmt::format("unknown data type: {} in expression",
@ -388,6 +404,21 @@ ProtoParser::ParseBinaryRangeExpr(const proto::plan::BinaryRangeExpr& expr_pb) {
PanicInfo("unknown data type in expression");
}
}
case DataType::ARRAY: {
switch (expr_pb.lower_value().val_case()) {
case proto::plan::GenericValue::ValCase::kInt64Val:
return ExtractBinaryRangeExprImpl<int64_t>(
field_id, data_type, expr_pb);
case proto::plan::GenericValue::ValCase::kFloatVal:
return ExtractBinaryRangeExprImpl<double>(
field_id, data_type, expr_pb);
case proto::plan::GenericValue::ValCase::kStringVal:
return ExtractBinaryRangeExprImpl<std::string>(
field_id, data_type, expr_pb);
default:
PanicInfo("unknown data type in expression");
}
}
default: {
PanicInfo("unsupported data type");
@ -486,6 +517,30 @@ ProtoParser::ParseTermExpr(const proto::plan::TermExpr& expr_pb) {
expr_pb.values()[0].val_case()));
}
}
case DataType::ARRAY: {
if (expr_pb.values().size() == 0) {
return ExtractTermExprImpl<bool>(
field_id, data_type, expr_pb);
}
switch (expr_pb.values()[0].val_case()) {
case proto::plan::GenericValue::ValCase::kBoolVal:
return ExtractTermExprImpl<bool>(
field_id, data_type, expr_pb);
case proto::plan::GenericValue::ValCase::kFloatVal:
return ExtractTermExprImpl<double>(
field_id, data_type, expr_pb);
case proto::plan::GenericValue::ValCase::kInt64Val:
return ExtractTermExprImpl<int64_t>(
field_id, data_type, expr_pb);
case proto::plan::GenericValue::ValCase::kStringVal:
return ExtractTermExprImpl<std::string>(
field_id, data_type, expr_pb);
default:
PanicInfo(
fmt::format("unknown data type: {} in expression",
expr_pb.values()[0].val_case()));
}
}
default: {
PanicInfo("unsupported data type");
}
@ -551,6 +606,20 @@ ProtoParser::ParseBinaryArithOpEvalRangeExpr(
expr_pb.value().val_case()));
}
}
case DataType::ARRAY: {
switch (expr_pb.value().val_case()) {
case proto::plan::GenericValue::ValCase::kInt64Val:
return ExtractBinaryArithOpEvalRangeExprImpl<int64_t>(
field_id, data_type, expr_pb);
case proto::plan::GenericValue::ValCase::kFloatVal:
return ExtractBinaryArithOpEvalRangeExprImpl<double>(
field_id, data_type, expr_pb);
default:
PanicInfo(fmt::format(
"unsupported data type {} in expression",
expr_pb.value().val_case()));
}
}
default: {
PanicInfo("unsupported data type");
}

View File

@ -114,11 +114,21 @@ class ExecExprVisitor : public ExprVisitor {
auto
ExecUnaryRangeVisitorDispatcherJson(UnaryRangeExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecUnaryRangeVisitorDispatcherArray(UnaryRangeExpr& expr_raw)
-> BitsetType;
template <typename ExprValueType>
auto
ExecBinaryArithOpEvalRangeVisitorDispatcherJson(
BinaryArithOpEvalRangeExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecBinaryArithOpEvalRangeVisitorDispatcherArray(
BinaryArithOpEvalRangeExpr& expr_raw) -> BitsetType;
template <typename T>
auto
ExecBinaryArithOpEvalRangeVisitorDispatcher(
@ -129,6 +139,11 @@ class ExecExprVisitor : public ExprVisitor {
ExecBinaryRangeVisitorDispatcherJson(BinaryRangeExpr& expr_raw)
-> BitsetType;
template <typename ExprValueType>
auto
ExecBinaryRangeVisitorDispatcherArray(BinaryRangeExpr& expr_raw)
-> BitsetType;
template <typename T>
auto
ExecBinaryRangeVisitorDispatcher(BinaryRangeExpr& expr_raw) -> BitsetType;
@ -145,14 +160,26 @@ class ExecExprVisitor : public ExprVisitor {
auto
ExecTermJsonVariableInField(TermExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecTermArrayVariableInField(TermExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecTermJsonFieldInVariable(TermExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecTermArrayFieldInVariable(TermExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecTermVisitorImplTemplateJson(TermExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecTermVisitorImplTemplateArray(TermExpr& expr_raw) -> BitsetType;
template <typename CmpFunc>
auto
ExecCompareExprDispatcher(CompareExpr& expr, CmpFunc cmp_func)
@ -162,6 +189,10 @@ class ExecExprVisitor : public ExprVisitor {
auto
ExecJsonContains(JsonContainsExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecArrayContains(JsonContainsExpr& expr_raw) -> BitsetType;
auto
ExecJsonContainsArray(JsonContainsExpr& expr_raw) -> BitsetType;
@ -172,6 +203,10 @@ class ExecExprVisitor : public ExprVisitor {
auto
ExecJsonContainsAll(JsonContainsExpr& expr_raw) -> BitsetType;
template <typename ExprValueType>
auto
ExecArrayContainsAll(JsonContainsExpr& expr_raw) -> BitsetType;
auto
ExecJsonContainsAllArray(JsonContainsExpr& expr_raw) -> BitsetType;

File diff suppressed because it is too large Load Diff

View File

@ -87,6 +87,16 @@ VectorBase::set_data_raw(ssize_t element_offset,
return set_data_raw(element_offset, data_raw.data(), element_count);
}
case DataType::ARRAY: {
auto& array_data = FIELD_DATA(data, array);
std::vector<Array> data_raw{};
data_raw.reserve(array_data.size());
for (auto& array_bytes : array_data) {
data_raw.emplace_back(Array(array_bytes));
}
return set_data_raw(element_offset, data_raw.data(), element_count);
}
default: {
PanicCodeInfo(DataTypeInvalid,
fmt::format("unsupported datatype {}",

View File

@ -341,11 +341,10 @@ struct InsertRecord {
this->append_field_data<Json>(field_id, size_per_chunk);
break;
}
// case DataType::ARRAY: {
// this->append_field_data<std::string>(field_id,
// size_per_chunk);
// break;
// }
case DataType::ARRAY: {
this->append_field_data<Array>(field_id, size_per_chunk);
break;
}
default: {
PanicCodeInfo(DataTypeInvalid,
fmt::format("unsupported scalar type",

View File

@ -396,6 +396,12 @@ ReduceHelper::GetSearchResultDataSlice(int slice_index) {
auto& field_meta = plan_->schema_[field_id];
auto field_data =
milvus::segcore::MergeDataArray(result_pairs, field_meta);
if (field_meta.get_data_type() == DataType::ARRAY) {
field_data->mutable_scalars()
->mutable_array_data()
->set_element_type(
proto::schema::DataType(field_meta.get_element_type()));
}
search_result_data->mutable_fields_data()->AddAllocated(
field_data.release());
}

View File

@ -417,6 +417,12 @@ SegmentGrowingImpl::bulk_subscript(FieldId field_id,
vec_ptr, seg_offsets, count, output.data());
return CreateScalarDataArrayFrom(output.data(), count, field_meta);
}
case DataType::ARRAY: {
// element
FixedVector<ScalarArray> output(count);
bulk_subscript_impl(*vec_ptr, seg_offsets, count, output.data());
return CreateScalarDataArrayFrom(output.data(), count, field_meta);
}
default: {
PanicCodeInfo(
DataTypeInvalid,
@ -484,6 +490,23 @@ SegmentGrowingImpl::bulk_subscript_impl(const VectorBase* vec_raw,
}
}
void
SegmentGrowingImpl::bulk_subscript_impl(const VectorBase& vec_raw,
const int64_t* seg_offsets,
int64_t count,
void* output_raw) const {
auto vec_ptr = dynamic_cast<const ConcurrentVector<Array>*>(&vec_raw);
AssertInfo(vec_ptr, "Pointer of vec_raw is nullptr");
auto& vec = *vec_ptr;
auto output = reinterpret_cast<ScalarArray*>(output_raw);
for (int64_t i = 0; i < count; ++i) {
auto offset = seg_offsets[i];
if (offset != INVALID_SEG_OFFSET) {
output[i] = vec[offset].output_data();
}
}
}
void
SegmentGrowingImpl::bulk_subscript(SystemFieldType system_type,
const int64_t* seg_offsets,

View File

@ -152,6 +152,13 @@ class SegmentGrowingImpl : public SegmentGrowing {
int64_t count,
void* output_raw) const;
// for scalar array vectors
void
bulk_subscript_impl(const VectorBase& vec_raw,
const int64_t* seg_offsets,
int64_t count,
void* output_raw) const;
template <typename T>
void
bulk_subscript_impl(FieldId field_id,

View File

@ -141,6 +141,10 @@ SegmentInternalInterface::Retrieve(const query::RetrievePlan* plan,
auto col = bulk_subscript(field_id,
retrieve_results.result_offsets_.data(),
retrieve_results.result_offsets_.size());
if (field_meta.get_data_type() == DataType::ARRAY) {
col->mutable_scalars()->mutable_array_data()->set_element_type(
proto::schema::DataType(field_meta.get_element_type()));
}
auto col_data = col.release();
fields_data->AddAllocated(col_data);
if (pk_field_id.has_value() && pk_field_id.value() == field_id) {

View File

@ -25,6 +25,7 @@
#include "Types.h"
#include "common/Json.h"
#include "common/EasyAssert.h"
#include "common/Array.h"
#include "mmap/Column.h"
#include "common/Consts.h"
#include "common/FieldMeta.h"
@ -311,7 +312,24 @@ SegmentSealedImpl::LoadFieldData(FieldId field_id, FieldDataInfo& data) {
column = std::move(var_column);
break;
}
case milvus::DataType::ARRAY: {
auto var_column =
std::make_shared<ArrayColumn>(num_rows, field_meta);
storage::FieldDataPtr field_data;
while (data.channel->pop(field_data)) {
for (auto i = 0; i < field_data->get_num_rows(); i++) {
auto rawValue = field_data->RawValue(i);
auto array =
static_cast<const milvus::Array*>(rawValue);
var_column->Append(*array);
}
}
var_column->Seal();
column = std::move(var_column);
break;
}
default: {
PanicInfo("unsupported data type");
}
}
@ -370,10 +388,12 @@ SegmentSealedImpl::MapFieldData(const FieldId field_id, FieldDataInfo& data) {
size_t total_written{0};
auto data_size = 0;
std::vector<uint64_t> indices{};
std::vector<std::vector<uint64_t>> element_indices{};
storage::FieldDataPtr field_data;
while (data.channel->pop(field_data)) {
data_size += field_data->Size();
auto written = WriteFieldData(file, data_type, field_data);
auto written =
WriteFieldData(file, data_type, field_data, element_indices);
if (written != field_data->Size()) {
break;
}
@ -413,7 +433,16 @@ SegmentSealedImpl::MapFieldData(const FieldId field_id, FieldDataInfo& data) {
column = std::move(var_column);
break;
}
case milvus::DataType::ARRAY: {
auto arr_column = std::make_shared<ArrayColumn>(
file, total_written, field_meta);
arr_column->Seal(std::move(indices),
std::move(element_indices));
column = std::move(arr_column);
break;
}
default: {
PanicInfo(fmt::format("unsupported data type {}", data_type));
}
}
} else {
@ -857,6 +886,21 @@ SegmentSealedImpl::bulk_subscript_impl(const ColumnBase* column,
}
}
void
SegmentSealedImpl::bulk_subscript_impl(const ColumnBase* column,
const int64_t* seg_offsets,
int64_t count,
void* dst_raw) {
auto field = reinterpret_cast<const ArrayColumn*>(column);
auto dst = reinterpret_cast<ScalarArray*>(dst_raw);
for (int64_t i = 0; i < count; ++i) {
auto offset = seg_offsets[i];
if (offset != INVALID_SEG_OFFSET) {
dst[i] = std::move(field->RawAt(offset));
}
}
}
// for vector
void
SegmentSealedImpl::bulk_subscript_impl(int64_t element_sizeof,
@ -931,6 +975,14 @@ SegmentSealedImpl::bulk_subscript(FieldId field_id,
output.data(), count, field_meta);
}
case DataType::ARRAY: {
FixedVector<ScalarArray> output(count);
bulk_subscript_impl(
column.get(), seg_offsets, count, output.data());
return CreateScalarDataArrayFrom(
output.data(), count, field_meta);
}
default:
PanicInfo(
fmt::format("unsupported data type: {}",

View File

@ -122,6 +122,13 @@ class SegmentSealedImpl : public SegmentSealed {
limit, bitset, false_filtered_out);
}
// Calculate: output[i] = Vec[seg_offset[i]]
// where Vec is determined from field_offset
std::unique_ptr<DataArray>
bulk_subscript(FieldId field_id,
const int64_t* seg_offsets,
int64_t count) const override;
protected:
// blob and row_count
SpanBase
@ -138,13 +145,6 @@ class SegmentSealedImpl : public SegmentSealed {
int64_t count,
void* output) const override;
// Calculate: output[i] = Vec[seg_offset[i]]
// where Vec is determined from field_offset
std::unique_ptr<DataArray>
bulk_subscript(FieldId field_id,
const int64_t* seg_offsets,
int64_t count) const override;
void
check_search(const query::Plan* plan) const override;
@ -171,6 +171,12 @@ class SegmentSealedImpl : public SegmentSealed {
int64_t count,
void* dst_raw);
static void
bulk_subscript_impl(const ColumnBase* column,
const int64_t* seg_offsets,
int64_t count,
void* dst_raw);
static void
bulk_subscript_impl(int64_t element_sizeof,
const void* src_raw,

View File

@ -135,6 +135,64 @@ GetRawDataSizeOfDataArray(const DataArray* data,
}
break;
}
case DataType::ARRAY: {
auto& array_data = FIELD_DATA(data, array);
switch (field_meta.get_element_type()) {
case DataType::BOOL: {
for (auto& array_bytes : array_data) {
result += array_bytes.bool_data().data_size() *
sizeof(bool);
}
break;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
for (auto& array_bytes : array_data) {
result += array_bytes.int_data().data_size() *
sizeof(int);
}
break;
}
case DataType::INT64: {
for (auto& array_bytes : array_data) {
result += array_bytes.long_data().data_size() *
sizeof(int64_t);
}
break;
}
case DataType::FLOAT: {
for (auto& array_bytes : array_data) {
result += array_bytes.float_data().data_size() *
sizeof(float);
}
break;
}
case DataType::DOUBLE: {
for (auto& array_bytes : array_data) {
result += array_bytes.double_data().data_size() *
sizeof(double);
}
break;
}
case DataType::VARCHAR:
case DataType::STRING: {
for (auto& array_bytes : array_data) {
auto element_num =
array_bytes.string_data().data_size();
for (int i = 0; i < element_num; ++i) {
result +=
array_bytes.string_data().data(i).size();
}
}
break;
}
default:
PanicInfo("unsupported element type for array");
}
break;
}
default: {
PanicInfo(
fmt::format("unsupported variable datatype {}", data_type));
@ -209,6 +267,14 @@ CreateScalarDataArray(int64_t count, const FieldMeta& field_meta) {
}
break;
}
case DataType::ARRAY: {
auto obj = scalar_array->mutable_array_data();
obj->mutable_data()->Reserve(count);
for (int i = 0; i < count; i++) {
*(obj->mutable_data()->Add()) = proto::schema::ScalarField();
}
break;
}
default: {
PanicInfo("unsupported datatype");
}
@ -326,6 +392,14 @@ CreateScalarDataArrayFrom(const void* data_raw,
}
break;
}
case DataType::ARRAY: {
auto data = reinterpret_cast<const ScalarArray*>(data_raw);
auto obj = scalar_array->mutable_array_data();
for (auto i = 0; i < count; i++) {
*(obj->mutable_data()->Add()) = data[i];
}
break;
}
default: {
PanicInfo("unsupported datatype");
}
@ -477,6 +551,14 @@ MergeDataArray(
*(obj->mutable_data()->Add()) = data[src_offset];
break;
}
case DataType::ARRAY: {
auto& data = FIELD_DATA(src_field_data, array);
auto obj = scalar_array->mutable_array_data();
obj->set_element_type(
proto::schema::DataType(field_meta.get_element_type()));
*(obj->mutable_data()->Add()) = data[src_offset];
break;
}
default: {
PanicInfo(fmt::format("unsupported data type {}", data_type));
}

View File

@ -76,7 +76,9 @@ ChunkCache::Mmap(const std::filesystem::path& path,
// write the field data to disk
auto data_size = field_data->Size();
auto written = WriteFieldData(file, data_type, field_data);
// unused
std::vector<std::vector<uint64_t>> element_indices{};
auto written = WriteFieldData(file, data_type, field_data, element_indices);
AssertInfo(written == data_size,
fmt::format("failed to write data file {}, written "
"{} but total {}, err: {}",

View File

@ -23,6 +23,7 @@
#include "common/Json.h"
#include "common/Consts.h"
#include "common/FieldMeta.h"
#include "common/Array.h"
namespace milvus::storage {
@ -233,7 +234,19 @@ BaseEventData::Serialize() {
}
break;
}
case DataType::ARRAY:
case DataType::ARRAY: {
for (size_t offset = 0; offset < field_data->get_num_rows();
++offset) {
auto array =
static_cast<const Array*>(field_data->RawValue(offset));
auto array_string = array->output_data().SerializeAsString();
payload_writer->add_one_binary_payload(
reinterpret_cast<const uint8_t*>(array_string.c_str()),
array_string.size());
}
break;
}
case DataType::JSON: {
for (size_t offset = 0; offset < field_data->get_num_rows();
++offset) {

View File

@ -19,6 +19,8 @@
#include "common/EasyAssert.h"
#include "common/Json.h"
#include "simdjson/padded_string.h"
#include "common/Array.h"
#include "FieldDataInterface.h"
namespace milvus::storage {
@ -131,6 +133,17 @@ FieldDataImpl<Type, is_scalar>::FillFieldData(
}
return FillFieldData(values.data(), element_count);
}
case DataType::ARRAY: {
auto array_array =
std::dynamic_pointer_cast<arrow::BinaryArray>(array);
std::vector<Array> values(element_count);
for (size_t index = 0; index < element_count; ++index) {
ScalarArray field_data;
field_data.ParseFromString(array_array->GetString(index));
values[index] = Array(field_data);
}
return FillFieldData(values.data(), element_count);
}
case DataType::VECTOR_FLOAT:
case DataType::VECTOR_FLOAT16:
case DataType::VECTOR_BINARY: {
@ -160,6 +173,7 @@ template class FieldDataImpl<float, true>;
template class FieldDataImpl<double, true>;
template class FieldDataImpl<std::string, true>;
template class FieldDataImpl<Json, true>;
template class FieldDataImpl<Array, true>;
// vector data
template class FieldDataImpl<int8_t, false>;

View File

@ -54,6 +54,15 @@ class FieldData<Json> : public FieldDataJsonImpl {
}
};
template <>
class FieldData<Array> : public FieldDataArrayImpl {
public:
static_assert(IsScalar<Array> || std::is_same_v<std::string, PkType>);
explicit FieldData(DataType data_type, int64_t buffered_num_rows = 0)
: FieldDataArrayImpl(data_type, buffered_num_rows) {
}
};
template <>
class FieldData<FloatVector> : public FieldDataImpl<float, false> {
public:

View File

@ -31,6 +31,7 @@
#include "common/Utils.h"
#include "common/VectorTrait.h"
#include "common/EasyAssert.h"
#include "common/Array.h"
namespace milvus::storage {
@ -305,4 +306,30 @@ class FieldDataJsonImpl : public FieldDataImpl<Json, true> {
}
};
class FieldDataArrayImpl : public FieldDataImpl<Array, true> {
public:
explicit FieldDataArrayImpl(DataType data_type, int64_t total_num_rows = 0)
: FieldDataImpl<Array, true>(1, data_type, total_num_rows) {
}
int64_t
Size() const {
int64_t data_size = 0;
for (size_t offset = 0; offset < length(); ++offset) {
data_size += field_data_[offset].byte_size();
}
return data_size;
}
int64_t
Size(ssize_t offset) const {
AssertInfo(offset < get_num_rows(),
"field data subscript out of range");
AssertInfo(offset < length(),
"subscript position don't has valid value");
return field_data_[offset].byte_size();
}
};
} // namespace milvus::storage

View File

@ -650,6 +650,8 @@ CreateFieldData(const DataType& type, int64_t dim, int64_t total_num_rows) {
total_num_rows);
case DataType::JSON:
return std::make_shared<FieldData<Json>>(type, total_num_rows);
case DataType::ARRAY:
return std::make_shared<FieldData<Array>>(type, total_num_rows);
case DataType::VECTOR_FLOAT:
return std::make_shared<FieldData<FloatVector>>(
dim, type, total_num_rows);

View File

@ -71,7 +71,7 @@ if (LINUX OR APPLE)
${MILVUS_TEST_FILES}
test_scalar_index_creator.cpp
test_string_index.cpp
)
test_array.cpp test_array_expr.cpp)
endif()
if (DEFINED AZURE_BUILD_DIR)

View File

@ -0,0 +1,121 @@
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License
#include <gtest/gtest.h>
#include <random>
#include "common/Array.h"
TEST(Array, TestConstructArray) {
using namespace milvus;
int N = 10;
milvus::proto::schema::ScalarField field_int_data;
milvus::proto::plan::Array field_int_array;
field_int_array.set_same_type(true);
for (int i = 0; i < N; i++) {
field_int_data.mutable_int_data()->add_data(i);
field_int_array.mutable_array()->Add()->set_int64_val(i);
}
auto int_array = Array(field_int_data);
ASSERT_EQ(N, int_array.length());
ASSERT_EQ(N * sizeof(int), int_array.byte_size());
for (int i = 0; i < N; ++i) {
ASSERT_EQ(int_array.get_data<int>(i), i);
}
ASSERT_TRUE(int_array.is_same_array(field_int_array));
milvus::proto::schema::ScalarField field_long_data;
milvus::proto::plan::Array field_long_array;
field_long_array.set_same_type(true);
for (int i = 0; i < N; i++) {
field_long_data.mutable_long_data()->add_data(i);
field_long_array.mutable_array()->Add()->set_int64_val(i);
}
auto long_array = Array(field_long_data);
ASSERT_EQ(N, long_array.length());
ASSERT_EQ(N * sizeof(int64_t), long_array.byte_size());
for (int i = 0; i < N; ++i) {
ASSERT_EQ(long_array.get_data<int64_t>(i), i);
}
ASSERT_TRUE(long_array.is_same_array(field_int_array));
milvus::proto::schema::ScalarField field_string_data;
milvus::proto::plan::Array field_string_array;
field_string_array.set_same_type(true);
for (int i = 0; i < N; i++) {
field_string_data.mutable_string_data()->add_data(std::to_string(i));
proto::plan::GenericValue string_val;
string_val.set_string_val(std::to_string(i));
field_string_array.mutable_array()->Add()->CopyFrom(string_val);
}
auto string_array = Array(field_string_data);
ASSERT_EQ(N, string_array.length());
// ASSERT_EQ(N, string_array.size());
for (int i = 0; i < N; ++i) {
ASSERT_EQ(string_array.get_data<std::string_view>(i),
std::to_string(i));
}
ASSERT_TRUE(string_array.is_same_array(field_string_array));
milvus::proto::schema::ScalarField field_bool_data;
milvus::proto::plan::Array field_bool_array;
field_bool_array.set_same_type(true);
for (int i = 0; i < N; i++) {
field_bool_data.mutable_bool_data()->add_data(bool(i));
field_bool_array.mutable_array()->Add()->set_bool_val(bool(i));
}
auto bool_array = Array(field_bool_data);
ASSERT_EQ(N, bool_array.length());
ASSERT_EQ(N * sizeof(bool), bool_array.byte_size());
for (int i = 0; i < N; ++i) {
ASSERT_EQ(bool_array.get_data<bool>(i), bool(i));
}
ASSERT_TRUE(bool_array.is_same_array(field_bool_array));
milvus::proto::schema::ScalarField field_float_data;
milvus::proto::plan::Array field_float_array;
field_float_array.set_same_type(true);
for (int i = 0; i < N; i++) {
field_float_data.mutable_float_data()->add_data(float(i) * 0.1);
field_float_array.mutable_array()->Add()->set_float_val(float(i * 0.1));
}
auto float_array = Array(field_float_data);
ASSERT_EQ(N, float_array.length());
ASSERT_EQ(N * sizeof(float), float_array.byte_size());
for (int i = 0; i < N; ++i) {
ASSERT_DOUBLE_EQ(float_array.get_data<float>(i), float(i * 0.1));
}
ASSERT_TRUE(float_array.is_same_array(field_float_array));
milvus::proto::schema::ScalarField field_double_data;
milvus::proto::plan::Array field_double_array;
field_double_array.set_same_type(true);
for (int i = 0; i < N; i++) {
field_double_data.mutable_double_data()->add_data(double(i) * 0.1);
field_double_array.mutable_array()->Add()->set_float_val(
double(i * 0.1));
}
auto double_array = Array(field_double_data);
ASSERT_EQ(N, double_array.length());
ASSERT_EQ(N * sizeof(double), double_array.byte_size());
for (int i = 0; i < N; ++i) {
ASSERT_DOUBLE_EQ(double_array.get_data<double>(i), double(i * 0.1));
}
ASSERT_TRUE(double_array.is_same_array(field_double_array));
milvus::proto::schema::ScalarField field_empty_data;
milvus::proto::plan::Array field_empty_array;
auto empty_array = Array(field_empty_data);
ASSERT_EQ(0, empty_array.length());
ASSERT_EQ(0, empty_array.byte_size());
ASSERT_TRUE(empty_array.is_same_array(field_empty_array));
}

File diff suppressed because it is too large Load Diff

View File

@ -359,3 +359,40 @@ TEST(storage, IndexData) {
memcpy(new_data.data(), new_field_data->Data(), new_field_data->Size());
ASSERT_EQ(data, new_data);
}
TEST(storage, InsertDataStringArray) {
milvus::proto::schema::ScalarField field_string_data;
field_string_data.mutable_string_data()->add_data("test_array1");
field_string_data.mutable_string_data()->add_data("test_array2");
field_string_data.mutable_string_data()->add_data("test_array3");
field_string_data.mutable_string_data()->add_data("test_array4");
field_string_data.mutable_string_data()->add_data("test_array5");
auto string_array = Array(field_string_data);
FixedVector<Array> data = {string_array};
auto field_data =
milvus::storage::CreateFieldData(storage::DataType::ARRAY);
field_data->FillFieldData(data.data(), data.size());
storage::InsertData insert_data(field_data);
storage::FieldDataMeta field_data_meta{100, 101, 102, 103};
insert_data.SetFieldDataMeta(field_data_meta);
insert_data.SetTimestamps(0, 100);
auto serialized_bytes = insert_data.Serialize(storage::StorageType::Remote);
std::shared_ptr<uint8_t[]> serialized_data_ptr(serialized_bytes.data(),
[&](uint8_t*) {});
auto new_insert_data = storage::DeserializeFileData(
serialized_data_ptr, serialized_bytes.size());
ASSERT_EQ(new_insert_data->GetCodecType(), storage::InsertDataType);
ASSERT_EQ(new_insert_data->GetTimeRage(),
std::make_pair(Timestamp(0), Timestamp(100)));
auto new_payload = new_insert_data->GetFieldData();
ASSERT_EQ(new_payload->get_data_type(), storage::DataType::ARRAY);
ASSERT_EQ(new_payload->get_num_rows(), data.size());
FixedVector<Array> new_data(data.size());
for (int i = 0; i < data.size(); ++i) {
new_data[i] = *static_cast<const Array*>(new_payload->RawValue(i));
ASSERT_EQ(new_payload->Size(i), data[i].byte_size());
ASSERT_TRUE(data[i].operator==(new_data[i]));
}
}

View File

@ -486,7 +486,7 @@ TEST(Expr, TestRange) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<int> age_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_age_col = raw_data.get_col<int>(i64_fid);
@ -553,7 +553,7 @@ TEST(Expr, TestBinaryRangeJSON) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -641,7 +641,7 @@ TEST(Expr, TestExistsJson) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -706,7 +706,7 @@ TEST(Expr, TestUnaryRangeJson) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -796,6 +796,55 @@ TEST(Expr, TestUnaryRangeJson) {
}
}
}
struct TestArrayCase {
proto::plan::Array val;
std::vector<std::string> nested_path;
};
proto::plan::Array arr;
arr.set_same_type(true);
proto::plan::GenericValue int_val1;
int_val1.set_int64_val(int64_t(1));
arr.add_array()->CopyFrom(int_val1);
proto::plan::GenericValue int_val2;
int_val2.set_int64_val(int64_t(2));
arr.add_array()->CopyFrom(int_val2);
proto::plan::GenericValue int_val3;
int_val3.set_int64_val(int64_t(3));
arr.add_array()->CopyFrom(int_val3);
std::vector<TestArrayCase> array_cases = {
{arr, {"array"}}
};
for (const auto& testcase : array_cases) {
auto check = [&](OpType op) {
if (testcase.nested_path[0] == "array" && op == OpType::Equal) {
return true;
}
return false;
};
for (auto& op : ops) {
RetrievePlanNode plan;
auto pointer = milvus::Json::pointer(testcase.nested_path);
plan.predicate_ = std::make_unique<UnaryRangeExprImpl<proto::plan::Array>>(
ColumnInfo(json_fid, DataType::JSON, testcase.nested_path),
op,
testcase.val,
proto::plan::GenericValue::ValCase::kArrayVal);
auto final = visitor.call_child(*plan.predicate_.value());
EXPECT_EQ(final.size(), N * num_iters);
for (int i = 0; i < N * num_iters; ++i) {
auto ans = final[i];
auto ref = check(op);
ASSERT_EQ(ans, ref);
}
}
}
}
TEST(Expr, TestTermJson) {
@ -1065,7 +1114,7 @@ TEST(Expr, TestCompare) {
int N = 1000;
std::vector<int> age1_col;
std::vector<int64_t> age2_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_age1_col = raw_data.get_col<int>(i32_fid);
@ -1371,7 +1420,7 @@ TEST(Expr, TestMultiLogicalExprsOptimization) {
schema->set_primary_field_id(str1_fid);
auto seg = CreateSealedSegment(schema);
size_t N = 1000000;
size_t N = 10000;
auto raw_data = DataGen(schema, N);
auto fields = schema->get_fields();
for (auto field_data : raw_data.raw_->fields_data()) {
@ -1470,7 +1519,7 @@ TEST(Expr, TestExprs) {
schema->set_primary_field_id(str1_fid);
auto seg = CreateSealedSegment(schema);
int N = 1000000;
int N = 10000;
auto raw_data = DataGen(schema, N);
// load field data
@ -1998,7 +2047,7 @@ TEST(Expr, TestBinaryArithOpEvalRange) {
std::vector<int64_t> age64_col;
std::vector<float> age_float_col;
std::vector<double> age_double_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
@ -2125,7 +2174,7 @@ TEST(Expr, TestBinaryArithOpEvalRangeJSON) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -2213,7 +2262,7 @@ TEST(Expr, TestBinaryArithOpEvalRangeJSONFloat) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -2261,6 +2310,46 @@ TEST(Expr, TestBinaryArithOpEvalRangeJSONFloat) {
ASSERT_EQ(ans, ref) << testcase.value << " " << val;
}
}
std::vector<Testcase> array_testcases{
{0, 3, OpType::Equal, {"array"}},
{0, 5, OpType::NotEqual, {"array"}},
};
for (auto testcase : array_testcases) {
auto check = [&](int64_t value) {
if (testcase.op == OpType::Equal) {
return value == testcase.value;
}
return value != testcase.value;
};
RetrievePlanNode plan;
auto pointer = milvus::Json::pointer(testcase.nested_path);
plan.predicate_ =
std::make_unique<BinaryArithOpEvalRangeExprImpl<int64_t>>(
ColumnInfo(json_fid, DataType::JSON, testcase.nested_path),
proto::plan::GenericValue::ValCase::kInt64Val,
ArithOpType::ArrayLength,
testcase.right_operand,
testcase.op,
testcase.value);
auto final = visitor.call_child(*plan.predicate_.value());
EXPECT_EQ(final.size(), N * num_iters);
for (int i = 0; i < N * num_iters; ++i) {
auto ans = final[i];
auto json = milvus::Json(simdjson::padded_string(json_col[i]));
int64_t array_length = 0;
auto doc = json.doc();
auto array = doc.at_pointer(pointer).get_array();
if (!array.error()) {
array_length = array.count_elements();
}
auto ref = check(array_length);
ASSERT_EQ(ans, ref) << testcase.value << " " << array_length;
}
}
}
TEST(Expr, TestBinaryArithOpEvalRangeWithScalarSortIndex) {
@ -2683,7 +2772,7 @@ TEST(Expr, TestUnaryRangeWithJSON) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -2861,7 +2950,7 @@ TEST(Expr, TestTermWithJSON) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -3006,7 +3095,7 @@ TEST(Expr, TestExistsWithJSON) {
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 100;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGen(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -3116,6 +3205,7 @@ template <typename T>
struct Testcase {
std::vector<T> term;
std::vector<std::string> nested_path;
bool res;
};
TEST(Expr, TestTermInFieldJson) {
@ -3129,9 +3219,9 @@ TEST(Expr, TestTermInFieldJson) {
schema->set_primary_field_id(i64_fid);
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 10000;
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 2;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGenForJsonArray(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -3465,9 +3555,9 @@ TEST(Expr, TestJsonContainsAny) {
schema->set_primary_field_id(i64_fid);
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 10000;
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 2;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGenForJsonArray(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -3658,9 +3748,9 @@ TEST(Expr, TestJsonContainsAll) {
schema->set_primary_field_id(i64_fid);
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 10000;
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 2;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGenForJsonArray(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -3875,9 +3965,9 @@ TEST(Expr, TestJsonContainsArray) {
schema->set_primary_field_id(i64_fid);
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 10000;
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 2;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGenForJsonArray(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -4021,7 +4111,7 @@ TEST(Expr, TestJsonContainsArray) {
{{sub_arr1, sub_arr2}, {"array2"}}};
for (auto& testcase : diff_testcases2) {
auto check = [&](const std::vector<bool>& values, int i) {
auto check = [&]() {
return true;
};
RetrievePlanNode plan;
@ -4044,8 +4134,7 @@ TEST(Expr, TestJsonContainsArray) {
for (int i = 0; i < N * num_iters; ++i) {
auto ans = final[i];
std::vector<bool> res;
ASSERT_EQ(ans, check(res, i));
ASSERT_EQ(ans, check());
}
}
@ -4100,9 +4189,9 @@ TEST(Expr, TestJsonContainsArray) {
std::vector<Testcase<proto::plan::Array>> diff_testcases3{
{{sub_arr3, sub_arr4}, {"array2"}}};
for (auto& testcase : diff_testcases2) {
for (auto& testcase : diff_testcases3) {
auto check = [&](const std::vector<bool>& values, int i) {
return true;
return false;
};
RetrievePlanNode plan;
auto pointer = milvus::Json::pointer(testcase.nested_path);
@ -4129,9 +4218,9 @@ TEST(Expr, TestJsonContainsArray) {
}
}
for (auto& testcase : diff_testcases2) {
for (auto& testcase : diff_testcases3) {
auto check = [&](const std::vector<bool>& values, int i) {
return true;
return false;
};
RetrievePlanNode plan;
auto pointer = milvus::Json::pointer(testcase.nested_path);
@ -4159,7 +4248,37 @@ TEST(Expr, TestJsonContainsArray) {
}
}
TEST(Expr, TestJsonContainsDiffType) {
milvus::proto::plan::GenericValue generatedArrayWithFourDiffType(
int64_t int_val,
double float_val,
bool bool_val,
std::string string_val) {
using namespace milvus;
proto::plan::GenericValue value;
proto::plan::Array diff_type_array;
diff_type_array.set_same_type(false);
proto::plan::GenericValue int_value;
int_value.set_int64_val(int_val);
diff_type_array.add_array()->CopyFrom(int_value);
proto::plan::GenericValue float_value;
float_value.set_float_val(float_val);
diff_type_array.add_array()->CopyFrom(float_value);
proto::plan::GenericValue bool_value;
bool_value.set_bool_val(bool_val);
diff_type_array.add_array()->CopyFrom(bool_value);
proto::plan::GenericValue string_value;
string_value.set_string_val(string_val);
diff_type_array.add_array()->CopyFrom(string_value);
value.mutable_array_val()->CopyFrom(diff_type_array);
return value;
}
TEST(Expr, TestJsonContainsDiffTypeArray) {
using namespace milvus;
using namespace milvus::query;
using namespace milvus::segcore;
@ -4170,9 +4289,9 @@ TEST(Expr, TestJsonContainsDiffType) {
schema->set_primary_field_id(i64_fid);
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 10000;
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 2;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGenForJsonArray(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
@ -4191,32 +4310,136 @@ TEST(Expr, TestJsonContainsDiffType) {
ExecExprVisitor visitor(
*seg_promote, seg_promote->get_row_count(), MAX_TIMESTAMP);
proto::plan::GenericValue v;
auto a = v.mutable_array_val();
proto::plan::GenericValue int_val;
int_val.set_int64_val(int64_t(1));
a->add_array()->CopyFrom(int_val);
proto::plan::GenericValue bool_val;
bool_val.set_bool_val(bool(false));
a->add_array()->CopyFrom(bool_val);
proto::plan::GenericValue float_val;
float_val.set_float_val(double(100.34));
a->add_array()->CopyFrom(float_val);
proto::plan::GenericValue string_val;
string_val.set_string_val("10dsf");
a->add_array()->CopyFrom(string_val);
// a->set_same_type(false);
// v.set_allocated_array_val(a);
proto::plan::GenericValue int_value;
int_value.set_int64_val(1);
auto diff_type_array1 = generatedArrayWithFourDiffType(1, 2.2, false, "abc");
auto diff_type_array2 = generatedArrayWithFourDiffType(1, 2.2, false, "def");
auto diff_type_array3 = generatedArrayWithFourDiffType(1, 2.2, true, "abc");
auto diff_type_array4 = generatedArrayWithFourDiffType(1, 3.3, false, "abc");
auto diff_type_array5 = generatedArrayWithFourDiffType(2, 2.2, false, "abc");
std::vector<Testcase<proto::plan::GenericValue>> diff_testcases{
{{v}, {"string"}}};
{{diff_type_array1, int_value}, {"array3"}, true},
{{diff_type_array2, int_value}, {"array3"}, false},
{{diff_type_array3, int_value}, {"array3"}, false},
{{diff_type_array4, int_value}, {"array3"}, false},
{{diff_type_array5, int_value}, {"array3"}, false},
};
for (auto& testcase : diff_testcases) {
auto check = [&](const std::vector<std::string_view>& values) {
return std::find(values.begin(),
values.end(),
std::string_view("10dsf")) != values.end();
auto check = [&]() {
return testcase.res;
};
RetrievePlanNode plan;
auto pointer = milvus::Json::pointer(testcase.nested_path);
plan.predicate_ =
std::make_unique<JsonContainsExprImpl<proto::plan::GenericValue>>(
ColumnInfo(json_fid, DataType::JSON, testcase.nested_path),
testcase.term,
false,
proto::plan::JSONContainsExpr_JSONOp_ContainsAny,
proto::plan::GenericValue::ValCase::kArrayVal);
auto start = std::chrono::steady_clock::now();
auto final = visitor.call_child(*plan.predicate_.value());
std::cout << "cost"
<< std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now() - start)
.count()
<< std::endl;
EXPECT_EQ(final.size(), N * num_iters);
for (int i = 0; i < N * num_iters; ++i) {
auto ans = final[i];
ASSERT_EQ(ans, check());
}
}
for (auto& testcase : diff_testcases) {
auto check = [&]() {
return false;
};
RetrievePlanNode plan;
auto pointer = milvus::Json::pointer(testcase.nested_path);
plan.predicate_ =
std::make_unique<JsonContainsExprImpl<proto::plan::GenericValue>>(
ColumnInfo(json_fid, DataType::JSON, testcase.nested_path),
testcase.term,
false,
proto::plan::JSONContainsExpr_JSONOp_ContainsAll,
proto::plan::GenericValue::ValCase::kArrayVal);
auto start = std::chrono::steady_clock::now();
auto final = visitor.call_child(*plan.predicate_.value());
std::cout << "cost"
<< std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now() - start)
.count()
<< std::endl;
EXPECT_EQ(final.size(), N * num_iters);
for (int i = 0; i < N * num_iters; ++i) {
auto ans = final[i];
ASSERT_EQ(ans, check());
}
}
}
TEST(Expr, TestJsonContainsDiffType) {
using namespace milvus;
using namespace milvus::query;
using namespace milvus::segcore;
auto schema = std::make_shared<Schema>();
auto i64_fid = schema->AddDebugField("id", DataType::INT64);
auto json_fid = schema->AddDebugField("json", DataType::JSON);
schema->set_primary_field_id(i64_fid);
auto seg = CreateGrowingSegment(schema, empty_index_meta);
int N = 1000;
std::vector<std::string> json_col;
int num_iters = 1;
for (int iter = 0; iter < num_iters; ++iter) {
auto raw_data = DataGenForJsonArray(schema, N, iter);
auto new_json_col = raw_data.get_col<std::string>(json_fid);
json_col.insert(
json_col.end(), new_json_col.begin(), new_json_col.end());
seg->PreInsert(N);
seg->Insert(iter * N,
N,
raw_data.row_ids_.data(),
raw_data.timestamps_.data(),
raw_data.raw_);
}
auto seg_promote = dynamic_cast<SegmentGrowingImpl*>(seg.get());
ExecExprVisitor visitor(
*seg_promote, seg_promote->get_row_count(), MAX_TIMESTAMP);
proto::plan::GenericValue int_val;
int_val.set_int64_val(int64_t(3));
proto::plan::GenericValue bool_val;
bool_val.set_bool_val(bool(false));
proto::plan::GenericValue float_val;
float_val.set_float_val(double(100.34));
proto::plan::GenericValue string_val;
string_val.set_string_val("10dsf");
proto::plan::GenericValue string_val2;
string_val2.set_string_val("abc");
proto::plan::GenericValue bool_val2;
bool_val2.set_bool_val(bool(true));
proto::plan::GenericValue float_val2;
float_val2.set_float_val(double(2.2));
proto::plan::GenericValue int_val2;
int_val2.set_int64_val(int64_t(1));
std::vector<Testcase<proto::plan::GenericValue>> diff_testcases{
{{int_val, bool_val, float_val, string_val}, {"diff_type_array"}, false},
{{string_val2, bool_val2, float_val2, int_val2}, {"diff_type_array"}, true},
};
for (auto& testcase : diff_testcases) {
RetrievePlanNode plan;
auto pointer = milvus::Json::pointer(testcase.nested_path);
plan.predicate_ =
@ -4237,21 +4460,11 @@ TEST(Expr, TestJsonContainsDiffType) {
for (int i = 0; i < N * num_iters; ++i) {
auto ans = final[i];
auto array = milvus::Json(simdjson::padded_string(json_col[i]))
.array_at(pointer);
std::vector<std::string_view> res;
for (const auto& element : array) {
res.push_back(element.template get<std::string_view>());
}
ASSERT_EQ(ans, check(res));
ASSERT_EQ(ans, testcase.res);
}
}
for (auto& testcase : diff_testcases) {
auto check = [&](const std::vector<std::string_view>& values) {
return false;
};
RetrievePlanNode plan;
auto pointer = milvus::Json::pointer(testcase.nested_path);
plan.predicate_ =
@ -4272,14 +4485,7 @@ TEST(Expr, TestJsonContainsDiffType) {
for (int i = 0; i < N * num_iters; ++i) {
auto ans = final[i];
auto array = milvus::Json(simdjson::padded_string(json_col[i]))
.array_at(pointer);
std::vector<std::string_view> res;
for (const auto& element : array) {
res.push_back(element.template get<std::string_view>());
}
ASSERT_EQ(ans, check(res));
ASSERT_EQ(ans, testcase.res);
}
}
}

View File

@ -100,6 +100,18 @@ TEST(Growing, FillData) {
auto double_field = schema->AddDebugField("double", DataType::DOUBLE);
auto varchar_field = schema->AddDebugField("varchar", DataType::VARCHAR);
auto json_field = schema->AddDebugField("json", DataType::JSON);
auto int_array_field =
schema->AddDebugField("int_array", DataType::ARRAY, DataType::INT8);
auto long_array_field =
schema->AddDebugField("long_array", DataType::ARRAY, DataType::INT64);
auto bool_array_field =
schema->AddDebugField("bool_array", DataType::ARRAY, DataType::BOOL);
auto string_array_field = schema->AddDebugField(
"string_array", DataType::ARRAY, DataType::VARCHAR);
auto double_array_field = schema->AddDebugField(
"double_array", DataType::ARRAY, DataType::DOUBLE);
auto float_array_field =
schema->AddDebugField("float_array", DataType::ARRAY, DataType::FLOAT);
auto vec = schema->AddDebugField(
"embeddings", DataType::VECTOR_FLOAT, 128, metric_type);
schema->set_primary_field_id(int64_field);
@ -133,6 +145,15 @@ TEST(Growing, FillData) {
auto double_values = dataset.get_col<double>(double_field);
auto varchar_values = dataset.get_col<std::string>(varchar_field);
auto json_values = dataset.get_col<std::string>(json_field);
auto int_array_values = dataset.get_col<ScalarArray>(int_array_field);
auto long_array_values = dataset.get_col<ScalarArray>(long_array_field);
auto bool_array_values = dataset.get_col<ScalarArray>(bool_array_field);
auto string_array_values =
dataset.get_col<ScalarArray>(string_array_field);
auto double_array_values =
dataset.get_col<ScalarArray>(double_array_field);
auto float_array_values =
dataset.get_col<ScalarArray>(float_array_field);
auto vector_values = dataset.get_col<float>(vec);
auto offset = segment->PreInsert(per_batch);
@ -159,13 +180,26 @@ TEST(Growing, FillData) {
varchar_field, ids_ds->GetIds(), num_inserted);
auto json_result =
segment->bulk_subscript(json_field, ids_ds->GetIds(), num_inserted);
auto int_array_result = segment->bulk_subscript(
int_array_field, ids_ds->GetIds(), num_inserted);
auto long_array_result = segment->bulk_subscript(
long_array_field, ids_ds->GetIds(), num_inserted);
auto bool_array_result = segment->bulk_subscript(
bool_array_field, ids_ds->GetIds(), num_inserted);
auto string_array_result = segment->bulk_subscript(
string_array_field, ids_ds->GetIds(), num_inserted);
auto double_array_result = segment->bulk_subscript(
double_array_field, ids_ds->GetIds(), num_inserted);
auto float_array_result = segment->bulk_subscript(
float_array_field, ids_ds->GetIds(), num_inserted);
auto vec_result =
segment->bulk_subscript(vec, ids_ds->GetIds(), num_inserted);
EXPECT_EQ(int8_result->scalars().int_data().data_size(), num_inserted);
EXPECT_EQ(int16_result->scalars().int_data().data_size(), num_inserted);
EXPECT_EQ(int32_result->scalars().int_data().data_size(), num_inserted);
EXPECT_EQ(int64_result->scalars().long_data().data_size(), num_inserted);
EXPECT_EQ(int64_result->scalars().long_data().data_size(),
num_inserted);
EXPECT_EQ(float_result->scalars().float_data().data_size(),
num_inserted);
EXPECT_EQ(double_result->scalars().double_data().data_size(),
@ -175,5 +209,17 @@ TEST(Growing, FillData) {
EXPECT_EQ(json_result->scalars().json_data().data_size(), num_inserted);
EXPECT_EQ(vec_result->vectors().float_vector().data_size(),
num_inserted * dim);
EXPECT_EQ(int_array_result->scalars().array_data().data_size(),
num_inserted);
EXPECT_EQ(long_array_result->scalars().array_data().data_size(),
num_inserted);
EXPECT_EQ(bool_array_result->scalars().array_data().data_size(),
num_inserted);
EXPECT_EQ(string_array_result->scalars().array_data().data_size(),
num_inserted);
EXPECT_EQ(double_array_result->scalars().array_data().data_size(),
num_inserted);
EXPECT_EQ(float_array_result->scalars().array_data().data_size(),
num_inserted);
}
}

View File

@ -382,6 +382,7 @@ TEST(Sealed, LoadFieldData) {
schema->AddDebugField("int16", DataType::INT16);
schema->AddDebugField("float", DataType::FLOAT);
schema->AddDebugField("json", DataType::JSON);
schema->AddDebugField("array", DataType::ARRAY, DataType::INT64);
schema->set_primary_field_id(counter_id);
auto dataset = DataGen(schema, N);
@ -506,6 +507,7 @@ TEST(Sealed, LoadFieldDataMmap) {
schema->AddDebugField("int16", DataType::INT16);
schema->AddDebugField("float", DataType::FLOAT);
schema->AddDebugField("json", DataType::JSON);
schema->AddDebugField("array", DataType::ARRAY, DataType::INT64);
schema->set_primary_field_id(counter_id);
auto dataset = DataGen(schema, N);
@ -1259,3 +1261,111 @@ TEST(Sealed, GetVectorFromChunkCache) {
exist = std::filesystem::exists(mmap_dir);
Assert(!exist);
}
TEST(Sealed, LoadArrayFieldData) {
auto dim = 16;
auto topK = 5;
auto N = 10;
auto metric_type = knowhere::metric::L2;
auto schema = std::make_shared<Schema>();
auto fakevec_id = schema->AddDebugField(
"fakevec", DataType::VECTOR_FLOAT, dim, metric_type);
auto counter_id = schema->AddDebugField("counter", DataType::INT64);
auto array_id =
schema->AddDebugField("array", DataType::ARRAY, DataType::INT64);
schema->set_primary_field_id(counter_id);
auto dataset = DataGen(schema, N);
auto fakevec = dataset.get_col<float>(fakevec_id);
auto segment = CreateSealedSegment(schema);
const char* raw_plan = R"(vector_anns:<
field_id:100
predicates:<
json_contains_expr:<
column_info:<
field_id:102
data_type:Array
element_type:Int64
>
elements:<int64_val:1 >
op:Contains
elements_same_type:true
>
>
query_info:<
topk: 5
round_decimal: 3
metric_type: "L2"
search_params: "{\"nprobe\": 10}"
> placeholder_tag:"$0"
>)";
auto plan_str = translate_text_plan_to_binary_plan(raw_plan);
auto plan =
CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size());
auto num_queries = 5;
auto ph_group_raw = CreatePlaceholderGroup(num_queries, 16, 1024);
auto ph_group =
ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString());
SealedLoadFieldData(dataset, *segment);
segment->Search(plan.get(), ph_group.get());
auto ids_ds = GenRandomIds(N);
auto s = dynamic_cast<SegmentSealedImpl*>(segment.get());
auto int64_result = s->bulk_subscript(array_id, ids_ds->GetIds(), N);
auto result_count = int64_result->scalars().array_data().data().size();
ASSERT_EQ(result_count, N);
}
TEST(Sealed, LoadArrayFieldDataWithMMap) {
auto dim = 16;
auto topK = 5;
auto N = ROW_COUNT;
auto metric_type = knowhere::metric::L2;
auto schema = std::make_shared<Schema>();
auto fakevec_id = schema->AddDebugField(
"fakevec", DataType::VECTOR_FLOAT, dim, metric_type);
auto counter_id = schema->AddDebugField("counter", DataType::INT64);
auto array_id =
schema->AddDebugField("array", DataType::ARRAY, DataType::INT64);
schema->set_primary_field_id(counter_id);
auto dataset = DataGen(schema, N);
auto fakevec = dataset.get_col<float>(fakevec_id);
auto segment = CreateSealedSegment(schema);
const char* raw_plan = R"(vector_anns:<
field_id:100
predicates:<
json_contains_expr:<
column_info:<
field_id:102
data_type:Array
element_type:Int64
>
elements:<int64_val:1 >
op:Contains
elements_same_type:true
>
>
query_info:<
topk: 5
round_decimal: 3
metric_type: "L2"
search_params: "{\"nprobe\": 10}"
> placeholder_tag:"$0"
>)";
auto plan_str = translate_text_plan_to_binary_plan(raw_plan);
auto plan =
CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size());
auto num_queries = 5;
auto ph_group_raw = CreatePlaceholderGroup(num_queries, 16, 1024);
auto ph_group =
ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString());
SealedLoadFieldData(dataset, *segment, {}, true);
segment->Search(plan.get(), ph_group.get());
}

View File

@ -120,59 +120,78 @@ struct GeneratedData {
return std::move(ret);
}
switch (field_meta.get_data_type()) {
case DataType::BOOL: {
auto src_data = reinterpret_cast<const T*>(
target_field_data.scalars().bool_data().data().data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
auto src_data = reinterpret_cast<const int32_t*>(
target_field_data.scalars().int_data().data().data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::INT64: {
auto src_data = reinterpret_cast<const T*>(
target_field_data.scalars().long_data().data().data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::FLOAT: {
auto src_data = reinterpret_cast<const T*>(
target_field_data.scalars().float_data().data().data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::DOUBLE: {
auto src_data =
reinterpret_cast<const T*>(target_field_data.scalars()
.double_data()
.data()
.data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::VARCHAR: {
auto ret_data = reinterpret_cast<std::string*>(ret.data());
auto src_data =
target_field_data.scalars().string_data().data();
std::copy(src_data.begin(), src_data.end(), ret_data);
break;
}
case DataType::JSON: {
auto ret_data = reinterpret_cast<std::string*>(ret.data());
auto src_data =
target_field_data.scalars().json_data().data();
std::copy(src_data.begin(), src_data.end(), ret_data);
break;
}
default: {
PanicCodeInfo(Unsupported, "unsupported");
if constexpr (std::is_same_v<T, ScalarArray>) {
auto ret_data = reinterpret_cast<ScalarArray*>(ret.data());
auto src_data = target_field_data.scalars().array_data().data();
std::copy(src_data.begin(), src_data.end(), ret_data);
} else {
switch (field_meta.get_data_type()) {
case DataType::BOOL: {
auto src_data = reinterpret_cast<const T*>(
target_field_data.scalars()
.bool_data()
.data()
.data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
auto src_data = reinterpret_cast<const int32_t*>(
target_field_data.scalars()
.int_data()
.data()
.data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::INT64: {
auto src_data = reinterpret_cast<const T*>(
target_field_data.scalars()
.long_data()
.data()
.data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::FLOAT: {
auto src_data = reinterpret_cast<const T*>(
target_field_data.scalars()
.float_data()
.data()
.data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::DOUBLE: {
auto src_data = reinterpret_cast<const T*>(
target_field_data.scalars()
.double_data()
.data()
.data());
std::copy_n(src_data, raw_->num_rows(), ret.data());
break;
}
case DataType::VARCHAR: {
auto ret_data =
reinterpret_cast<std::string*>(ret.data());
auto src_data =
target_field_data.scalars().string_data().data();
std::copy(src_data.begin(), src_data.end(), ret_data);
break;
}
case DataType::JSON: {
auto ret_data =
reinterpret_cast<std::string*>(ret.data());
auto src_data =
target_field_data.scalars().json_data().data();
std::copy(src_data.begin(), src_data.end(), ret_data);
break;
}
default: {
PanicCodeInfo(Unsupported, "unsupported");
}
}
}
}
@ -197,7 +216,8 @@ struct GeneratedData {
int64_t N,
uint64_t seed,
uint64_t ts_offset,
int repeat_count);
int repeat_count,
int array_len);
friend GeneratedData
DataGenForJsonArray(SchemaPtr schema,
int64_t N,
@ -212,7 +232,8 @@ DataGen(SchemaPtr schema,
int64_t N,
uint64_t seed = 42,
uint64_t ts_offset = 0,
int repeat_count = 1) {
int repeat_count = 1,
int array_len = 10) {
using std::vector;
std::default_random_engine er(seed);
std::normal_distribution<> distr(0, 1);
@ -347,16 +368,100 @@ DataGen(SchemaPtr schema,
case DataType::JSON: {
vector<std::string> data(N);
for (int i = 0; i < N / repeat_count; i++) {
auto str = R"({"int":)" + std::to_string(er()) +
R"(,"double":)" +
std::to_string(static_cast<double>(er())) +
R"(,"string":")" + std::to_string(er()) +
R"(","bool": true)" + "}";
auto str =
R"({"int":)" + std::to_string(er()) + R"(,"double":)" +
std::to_string(static_cast<double>(er())) +
R"(,"string":")" + std::to_string(er()) +
R"(","bool": true)" + R"(, "array": [1,2,3])" + "}";
data[i] = str;
}
insert_cols(data, N, field_meta);
break;
}
case DataType::ARRAY: {
vector<ScalarArray> data(N);
switch (field_meta.get_element_type()) {
case DataType::BOOL: {
for (int i = 0; i < N / repeat_count; i++) {
milvus::proto::schema::ScalarField field_data;
for (int j = 0; j < array_len; j++) {
field_data.mutable_bool_data()->add_data(
static_cast<bool>(er()));
}
data[i] = field_data;
}
break;
}
case DataType::INT8:
case DataType::INT16:
case DataType::INT32: {
for (int i = 0; i < N / repeat_count; i++) {
milvus::proto::schema::ScalarField field_data;
for (int j = 0; j < array_len; j++) {
field_data.mutable_int_data()->add_data(
static_cast<int>(er()));
}
data[i] = field_data;
}
break;
}
case DataType::INT64: {
for (int i = 0; i < N / repeat_count; i++) {
milvus::proto::schema::ScalarField field_data;
for (int j = 0; j < array_len; j++) {
field_data.mutable_long_data()->add_data(
static_cast<int64_t>(er()));
}
data[i] = field_data;
}
break;
}
case DataType::STRING:
case DataType::VARCHAR: {
for (int i = 0; i < N / repeat_count; i++) {
milvus::proto::schema::ScalarField field_data;
for (int j = 0; j < array_len; j++) {
field_data.mutable_string_data()->add_data(
std::to_string(er()));
}
data[i] = field_data;
}
break;
}
case DataType::FLOAT: {
for (int i = 0; i < N / repeat_count; i++) {
milvus::proto::schema::ScalarField field_data;
for (int j = 0; j < array_len; j++) {
field_data.mutable_float_data()->add_data(
static_cast<float>(er()));
}
data[i] = field_data;
}
break;
}
case DataType::DOUBLE: {
for (int i = 0; i < N / repeat_count; i++) {
milvus::proto::schema::ScalarField field_data;
for (int j = 0; j < array_len; j++) {
field_data.mutable_double_data()->add_data(
static_cast<double>(er()));
}
data[i] = field_data;
}
break;
}
default: {
throw std::runtime_error("unsupported data type");
}
}
insert_cols(data, N, field_meta);
break;
}
default: {
throw SegcoreError(ErrorCode::NotImplemented, "unimplemented");
}
@ -435,13 +540,14 @@ DataGenForJsonArray(SchemaPtr schema,
arrayVec.push_back(
fmt::format("[{}, {}, {}]", i, i + 1, i + 2));
}
auto str = R"({"int":[)" + join(intVec, ",") +
R"(],"double":[)" + join(doubleVec, ",") +
R"(],"string":[)" + join(stringVec, ",") +
R"(],"bool": [)" + join(boolVec, ",") +
R"(],"array": [)" + join(arrayVec, ",") +
R"(],"array2": [[1,2], [3,4]])" + "}";
//std::cout << str << std::endl;
auto str =
R"({"int":[)" + join(intVec, ",") + R"(],"double":[)" +
join(doubleVec, ",") + R"(],"string":[)" +
join(stringVec, ",") + R"(],"bool": [)" +
join(boolVec, ",") + R"(],"array": [)" +
join(arrayVec, ",") + R"(],"array2": [[1,2], [3,4]])" +
R"(,"array3": [[1,2.2,false,"abc"]])" +
R"(,"diff_type_array": [1,2.2,true,"abc"])" + "}";
data[i] = str;
}
insert_cols(data, N, field_meta);
@ -712,6 +818,15 @@ CreateFieldDataFromDataArray(ssize_t raw_count,
createFieldData(data_raw.data(), DataType::JSON, dim);
break;
}
case DataType::ARRAY: {
auto src_data = data->scalars().array_data().data();
std::vector<Array> data_raw(src_data.size());
for (int i = 0; i < src_data.size(); i++) {
data_raw[i] = Array(src_data.at(i));
}
createFieldData(data_raw.data(), DataType::ARRAY, dim);
break;
}
default: {
PanicCodeInfo(Unsupported, "unsupported");
}

View File

@ -20,6 +20,7 @@ type Field struct {
IsDynamic bool
IsPartitionKey bool // partition key mode, multi logic partitions share a physical partition
DefaultValue *schemapb.ValueField
ElementType schemapb.DataType
}
func (f *Field) Available() bool {
@ -40,6 +41,7 @@ func (f *Field) Clone() *Field {
IsDynamic: f.IsDynamic,
IsPartitionKey: f.IsPartitionKey,
DefaultValue: f.DefaultValue,
ElementType: f.ElementType,
}
}
@ -67,7 +69,8 @@ func (f *Field) Equal(other Field) bool {
f.AutoID == other.AutoID &&
f.IsPartitionKey == other.IsPartitionKey &&
f.IsDynamic == other.IsDynamic &&
f.DefaultValue == other.DefaultValue
f.DefaultValue == other.DefaultValue &&
f.ElementType == other.ElementType
}
func CheckFieldsEqual(fieldsA, fieldsB []*Field) bool {
@ -100,6 +103,7 @@ func MarshalFieldModel(field *Field) *schemapb.FieldSchema {
IsDynamic: field.IsDynamic,
IsPartitionKey: field.IsPartitionKey,
DefaultValue: field.DefaultValue,
ElementType: field.ElementType,
}
}
@ -132,6 +136,7 @@ func UnmarshalFieldModel(fieldSchema *schemapb.FieldSchema) *Field {
IsDynamic: fieldSchema.IsDynamic,
IsPartitionKey: fieldSchema.IsPartitionKey,
DefaultValue: fieldSchema.DefaultValue,
ElementType: fieldSchema.ElementType,
}
}

View File

@ -18,9 +18,10 @@ expr:
| expr op = (SHL | SHR) expr # Shift
| expr op = (IN | NIN) ('[' expr (',' expr)* ','? ']') # Term
| expr op = (IN | NIN) EmptyTerm # EmptyTerm
| JSONContains'('expr',' expr')' # JSONContains
| JSONContainsAll'('expr',' expr')' # JSONContainsAll
| JSONContainsAny'('expr',' expr')' # JSONContainsAny
| (JSONContains | ArrayContains)'('expr',' expr')' # JSONContains
| (JSONContainsAll | ArrayContainsAll)'('expr',' expr')' # JSONContainsAll
| (JSONContainsAny | ArrayContainsAny)'('expr',' expr')' # JSONContainsAny
| ArrayLength'('(Identifier | JSONIdentifier)')' # ArrayLength
| expr op1 = (LT | LE) (Identifier | JSONIdentifier) op2 = (LT | LE) expr # Range
| expr op1 = (GT | GE) (Identifier | JSONIdentifier) op2 = (GT | GE) expr # ReverseRange
| expr op = (LT | LE | GT | GE) expr # Relational
@ -78,6 +79,11 @@ JSONContains: 'json_contains' | 'JSON_CONTAINS';
JSONContainsAll: 'json_contains_all' | 'JSON_CONTAINS_ALL';
JSONContainsAny: 'json_contains_any' | 'JSON_CONTAINS_ANY';
ArrayContains: 'array_contains' | 'ARRAY_CONTAINS';
ArrayContainsAll: 'array_contains_all' | 'ARRAY_CONTAINS_ALL';
ArrayContainsAny: 'array_contains_any' | 'ARRAY_CONTAINS_ANY';
ArrayLength: 'array_length' | 'ARRAY_LENGTH';
BooleanConstant: 'true' | 'True' | 'TRUE' | 'false' | 'False' | 'FALSE';
IntegerConstant:

View File

@ -42,6 +42,10 @@ null
null
null
null
null
null
null
null
token symbolic names:
null
@ -79,6 +83,10 @@ EmptyTerm
JSONContains
JSONContainsAll
JSONContainsAny
ArrayContains
ArrayContainsAll
ArrayContainsAny
ArrayLength
BooleanConstant
IntegerConstant
FloatingConstant
@ -93,4 +101,4 @@ expr
atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 44, 127, 4, 2, 9, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 20, 10, 2, 12, 2, 14, 2, 23, 11, 2, 3, 2, 5, 2, 26, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 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, 2, 2, 21, 19, 3, 2, 2, 2, 21, 22, 3, 2, 2, 2, 22, 25, 3, 2, 2, 2, 23, 21, 3, 2, 2, 2, 24, 26, 7, 6, 2, 2, 25, 24, 3, 2, 2, 2, 25, 26, 3, 2, 2, 2, 26, 27, 3, 2, 2, 2, 27, 28, 7, 7, 2, 2, 28, 55, 3, 2, 2, 2, 29, 30, 9, 2, 2, 2, 30, 55, 5, 2, 2, 21, 31, 32, 7, 34, 2, 2, 32, 33, 7, 3, 2, 2, 33, 34, 5, 2, 2, 2, 34, 35, 7, 6, 2, 2, 35, 36, 5, 2, 2, 2, 36, 37, 7, 4, 2, 2, 37, 55, 3, 2, 2, 2, 38, 39, 7, 35, 2, 2, 39, 40, 7, 3, 2, 2, 40, 41, 5, 2, 2, 2, 41, 42, 7, 6, 2, 2, 42, 43, 5, 2, 2, 2, 43, 44, 7, 4, 2, 2, 44, 55, 3, 2, 2, 2, 45, 46, 7, 36, 2, 2, 46, 47, 7, 3, 2, 2, 47, 48, 5, 2, 2, 2, 48, 49, 7, 6, 2, 2, 49, 50, 5, 2, 2, 2, 50, 51, 7, 4, 2, 2, 51, 55, 3, 2, 2, 2, 52, 53, 7, 15, 2, 2, 53, 55, 5, 2, 2, 3, 54, 4, 3, 2, 2, 2, 54, 6, 3, 2, 2, 2, 54, 7, 3, 2, 2, 2, 54, 8, 3, 2, 2, 2, 54, 9, 3, 2, 2, 2, 54, 10, 3, 2, 2, 2, 54, 11, 3, 2, 2, 2, 54, 15, 3, 2, 2, 2, 54, 29, 3, 2, 2, 2, 54, 31, 3, 2, 2, 2, 54, 38, 3, 2, 2, 2, 54, 45, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2, 55, 123, 3, 2, 2, 2, 56, 57, 12, 22, 2, 2, 57, 58, 7, 21, 2, 2, 58, 122, 5, 2, 2, 23, 59, 60, 12, 20, 2, 2, 60, 61, 9, 3, 2, 2, 61, 122, 5, 2, 2, 21, 62, 63, 12, 19, 2, 2, 63, 64, 9, 4, 2, 2, 64, 122, 5, 2, 2, 20, 65, 66, 12, 18, 2, 2, 66, 67, 9, 5, 2, 2, 67, 122, 5, 2, 2, 19, 68, 69, 12, 12, 2, 2, 69, 70, 9, 6, 2, 2, 70, 71, 9, 7, 2, 2, 71, 72, 9, 6, 2, 2, 72, 122, 5, 2, 2, 13, 73, 74, 12, 11, 2, 2, 74, 75, 9, 8, 2, 2, 75, 76, 9, 7, 2, 2, 76, 77, 9, 8, 2, 2, 77, 122, 5, 2, 2, 12, 78, 79, 12, 10, 2, 2, 79, 80, 9, 9, 2, 2, 80, 122, 5, 2, 2, 11, 81, 82, 12, 9, 2, 2, 82, 83, 9, 10, 2, 2, 83, 122, 5, 2, 2, 10, 84, 85, 12, 8, 2, 2, 85, 86, 7, 24, 2, 2, 86, 122, 5, 2, 2, 9, 87, 88, 12, 7, 2, 2, 88, 89, 7, 26, 2, 2, 89, 122, 5, 2, 2, 8, 90, 91, 12, 6, 2, 2, 91, 92, 7, 25, 2, 2, 92, 122, 5, 2, 2, 7, 93, 94, 12, 5, 2, 2, 94, 95, 7, 27, 2, 2, 95, 122, 5, 2, 2, 6, 96, 97, 12, 4, 2, 2, 97, 98, 7, 28, 2, 2, 98, 122, 5, 2, 2, 5, 99, 100, 12, 23, 2, 2, 100, 101, 7, 14, 2, 2, 101, 122, 7, 41, 2, 2, 102, 103, 12, 17, 2, 2, 103, 104, 9, 11, 2, 2, 104, 105, 7, 5, 2, 2, 105, 110, 5, 2, 2, 2, 106, 107, 7, 6, 2, 2, 107, 109, 5, 2, 2, 2, 108, 106, 3, 2, 2, 2, 109, 112, 3, 2, 2, 2, 110, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 114, 3, 2, 2, 2, 112, 110, 3, 2, 2, 2, 113, 115, 7, 6, 2, 2, 114, 113, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 116, 3, 2, 2, 2, 116, 117, 7, 7, 2, 2, 117, 122, 3, 2, 2, 2, 118, 119, 12, 16, 2, 2, 119, 120, 9, 11, 2, 2, 120, 122, 7, 33, 2, 2, 121, 56, 3, 2, 2, 2, 121, 59, 3, 2, 2, 2, 121, 62, 3, 2, 2, 2, 121, 65, 3, 2, 2, 2, 121, 68, 3, 2, 2, 2, 121, 73, 3, 2, 2, 2, 121, 78, 3, 2, 2, 2, 121, 81, 3, 2, 2, 2, 121, 84, 3, 2, 2, 2, 121, 87, 3, 2, 2, 2, 121, 90, 3, 2, 2, 2, 121, 93, 3, 2, 2, 2, 121, 96, 3, 2, 2, 2, 121, 99, 3, 2, 2, 2, 121, 102, 3, 2, 2, 2, 121, 118, 3, 2, 2, 2, 122, 125, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 124, 3, 2, 2, 2, 124, 3, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 9, 21, 25, 54, 110, 114, 121, 123]
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 48, 131, 4, 2, 9, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 20, 10, 2, 12, 2, 14, 2, 23, 11, 2, 3, 2, 5, 2, 26, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 59, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 113, 10, 2, 12, 2, 14, 2, 116, 11, 2, 3, 2, 5, 2, 119, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 126, 10, 2, 12, 2, 14, 2, 129, 11, 2, 3, 2, 2, 3, 2, 3, 2, 2, 15, 4, 2, 16, 17, 29, 30, 4, 2, 34, 34, 37, 37, 4, 2, 35, 35, 38, 38, 4, 2, 36, 36, 39, 39, 4, 2, 44, 44, 46, 46, 3, 2, 18, 20, 3, 2, 16, 17, 3, 2, 22, 23, 3, 2, 8, 9, 3, 2, 10, 11, 3, 2, 8, 11, 3, 2, 12, 13, 3, 2, 31, 32, 2, 162, 2, 58, 3, 2, 2, 2, 4, 5, 8, 2, 1, 2, 5, 59, 7, 42, 2, 2, 6, 59, 7, 43, 2, 2, 7, 59, 7, 41, 2, 2, 8, 59, 7, 45, 2, 2, 9, 59, 7, 44, 2, 2, 10, 59, 7, 46, 2, 2, 11, 12, 7, 3, 2, 2, 12, 13, 5, 2, 2, 2, 13, 14, 7, 4, 2, 2, 14, 59, 3, 2, 2, 2, 15, 16, 7, 5, 2, 2, 16, 21, 5, 2, 2, 2, 17, 18, 7, 6, 2, 2, 18, 20, 5, 2, 2, 2, 19, 17, 3, 2, 2, 2, 20, 23, 3, 2, 2, 2, 21, 19, 3, 2, 2, 2, 21, 22, 3, 2, 2, 2, 22, 25, 3, 2, 2, 2, 23, 21, 3, 2, 2, 2, 24, 26, 7, 6, 2, 2, 25, 24, 3, 2, 2, 2, 25, 26, 3, 2, 2, 2, 26, 27, 3, 2, 2, 2, 27, 28, 7, 7, 2, 2, 28, 59, 3, 2, 2, 2, 29, 30, 9, 2, 2, 2, 30, 59, 5, 2, 2, 22, 31, 32, 9, 3, 2, 2, 32, 33, 7, 3, 2, 2, 33, 34, 5, 2, 2, 2, 34, 35, 7, 6, 2, 2, 35, 36, 5, 2, 2, 2, 36, 37, 7, 4, 2, 2, 37, 59, 3, 2, 2, 2, 38, 39, 9, 4, 2, 2, 39, 40, 7, 3, 2, 2, 40, 41, 5, 2, 2, 2, 41, 42, 7, 6, 2, 2, 42, 43, 5, 2, 2, 2, 43, 44, 7, 4, 2, 2, 44, 59, 3, 2, 2, 2, 45, 46, 9, 5, 2, 2, 46, 47, 7, 3, 2, 2, 47, 48, 5, 2, 2, 2, 48, 49, 7, 6, 2, 2, 49, 50, 5, 2, 2, 2, 50, 51, 7, 4, 2, 2, 51, 59, 3, 2, 2, 2, 52, 53, 7, 40, 2, 2, 53, 54, 7, 3, 2, 2, 54, 55, 9, 6, 2, 2, 55, 59, 7, 4, 2, 2, 56, 57, 7, 15, 2, 2, 57, 59, 5, 2, 2, 3, 58, 4, 3, 2, 2, 2, 58, 6, 3, 2, 2, 2, 58, 7, 3, 2, 2, 2, 58, 8, 3, 2, 2, 2, 58, 9, 3, 2, 2, 2, 58, 10, 3, 2, 2, 2, 58, 11, 3, 2, 2, 2, 58, 15, 3, 2, 2, 2, 58, 29, 3, 2, 2, 2, 58, 31, 3, 2, 2, 2, 58, 38, 3, 2, 2, 2, 58, 45, 3, 2, 2, 2, 58, 52, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 59, 127, 3, 2, 2, 2, 60, 61, 12, 23, 2, 2, 61, 62, 7, 21, 2, 2, 62, 126, 5, 2, 2, 24, 63, 64, 12, 21, 2, 2, 64, 65, 9, 7, 2, 2, 65, 126, 5, 2, 2, 22, 66, 67, 12, 20, 2, 2, 67, 68, 9, 8, 2, 2, 68, 126, 5, 2, 2, 21, 69, 70, 12, 19, 2, 2, 70, 71, 9, 9, 2, 2, 71, 126, 5, 2, 2, 20, 72, 73, 12, 12, 2, 2, 73, 74, 9, 10, 2, 2, 74, 75, 9, 6, 2, 2, 75, 76, 9, 10, 2, 2, 76, 126, 5, 2, 2, 13, 77, 78, 12, 11, 2, 2, 78, 79, 9, 11, 2, 2, 79, 80, 9, 6, 2, 2, 80, 81, 9, 11, 2, 2, 81, 126, 5, 2, 2, 12, 82, 83, 12, 10, 2, 2, 83, 84, 9, 12, 2, 2, 84, 126, 5, 2, 2, 11, 85, 86, 12, 9, 2, 2, 86, 87, 9, 13, 2, 2, 87, 126, 5, 2, 2, 10, 88, 89, 12, 8, 2, 2, 89, 90, 7, 24, 2, 2, 90, 126, 5, 2, 2, 9, 91, 92, 12, 7, 2, 2, 92, 93, 7, 26, 2, 2, 93, 126, 5, 2, 2, 8, 94, 95, 12, 6, 2, 2, 95, 96, 7, 25, 2, 2, 96, 126, 5, 2, 2, 7, 97, 98, 12, 5, 2, 2, 98, 99, 7, 27, 2, 2, 99, 126, 5, 2, 2, 6, 100, 101, 12, 4, 2, 2, 101, 102, 7, 28, 2, 2, 102, 126, 5, 2, 2, 5, 103, 104, 12, 24, 2, 2, 104, 105, 7, 14, 2, 2, 105, 126, 7, 45, 2, 2, 106, 107, 12, 18, 2, 2, 107, 108, 9, 14, 2, 2, 108, 109, 7, 5, 2, 2, 109, 114, 5, 2, 2, 2, 110, 111, 7, 6, 2, 2, 111, 113, 5, 2, 2, 2, 112, 110, 3, 2, 2, 2, 113, 116, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 118, 3, 2, 2, 2, 116, 114, 3, 2, 2, 2, 117, 119, 7, 6, 2, 2, 118, 117, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 121, 7, 7, 2, 2, 121, 126, 3, 2, 2, 2, 122, 123, 12, 17, 2, 2, 123, 124, 9, 14, 2, 2, 124, 126, 7, 33, 2, 2, 125, 60, 3, 2, 2, 2, 125, 63, 3, 2, 2, 2, 125, 66, 3, 2, 2, 2, 125, 69, 3, 2, 2, 2, 125, 72, 3, 2, 2, 2, 125, 77, 3, 2, 2, 2, 125, 82, 3, 2, 2, 2, 125, 85, 3, 2, 2, 2, 125, 88, 3, 2, 2, 2, 125, 91, 3, 2, 2, 2, 125, 94, 3, 2, 2, 2, 125, 97, 3, 2, 2, 2, 125, 100, 3, 2, 2, 2, 125, 103, 3, 2, 2, 2, 125, 106, 3, 2, 2, 2, 125, 122, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 3, 3, 2, 2, 2, 129, 127, 3, 2, 2, 2, 9, 21, 25, 58, 114, 118, 125, 127]

View File

@ -32,14 +32,18 @@ EmptyTerm=31
JSONContains=32
JSONContainsAll=33
JSONContainsAny=34
BooleanConstant=35
IntegerConstant=36
FloatingConstant=37
Identifier=38
StringLiteral=39
JSONIdentifier=40
Whitespace=41
Newline=42
ArrayContains=35
ArrayContainsAll=36
ArrayContainsAny=37
ArrayLength=38
BooleanConstant=39
IntegerConstant=40
FloatingConstant=41
Identifier=42
StringLiteral=43
JSONIdentifier=44
Whitespace=45
Newline=46
'('=1
')'=2
'['=3

File diff suppressed because one or more lines are too long

View File

@ -32,14 +32,18 @@ EmptyTerm=31
JSONContains=32
JSONContainsAll=33
JSONContainsAny=34
BooleanConstant=35
IntegerConstant=36
FloatingConstant=37
Identifier=38
StringLiteral=39
JSONIdentifier=40
Whitespace=41
Newline=42
ArrayContains=35
ArrayContainsAll=36
ArrayContainsAny=37
ArrayLength=38
BooleanConstant=39
IntegerConstant=40
FloatingConstant=41
Identifier=42
StringLiteral=43
JSONIdentifier=44
Whitespace=45
Newline=46
'('=1
')'=2
'['=3

View File

@ -75,6 +75,10 @@ func (v *BasePlanVisitor) VisitRelational(ctx *RelationalContext) interface{} {
return v.VisitChildren(ctx)
}
func (v *BasePlanVisitor) VisitArrayLength(ctx *ArrayLengthContext) interface{} {
return v.VisitChildren(ctx)
}
func (v *BasePlanVisitor) VisitTerm(ctx *TermContext) interface{} {
return v.VisitChildren(ctx)
}

View File

@ -14,7 +14,7 @@ var _ = fmt.Printf
var _ = unicode.IsLetter
var serializedLexerAtn = []uint16{
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 44, 614,
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 48, 754,
8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7,
9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12,
4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4,
@ -27,275 +27,336 @@ var serializedLexerAtn = []uint16{
49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54,
4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4,
60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65,
9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 3, 2, 3, 2, 3, 3, 3, 3,
3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 9,
3, 9, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3,
13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 172, 10, 13,
3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3,
14, 3, 14, 5, 14, 186, 10, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17,
3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3,
22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26,
3, 26, 3, 26, 3, 26, 5, 26, 218, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5,
27, 224, 10, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 232,
10, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31,
3, 31, 3, 32, 3, 32, 3, 32, 7, 32, 247, 10, 32, 12, 32, 14, 32, 250, 11,
32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33,
9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9,
70, 4, 71, 9, 71, 4, 72, 9, 72, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3,
5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3,
10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13,
3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 180, 10, 13, 3, 14, 3, 14, 3,
14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14,
194, 10, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3,
19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22,
3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3,
26, 5, 26, 226, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 232, 10, 27,
3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 240, 10, 29, 3, 30, 3,
30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32,
3, 32, 7, 32, 255, 10, 32, 12, 32, 14, 32, 258, 11, 32, 3, 32, 3, 32, 3,
33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33,
3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3,
33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 280, 10, 33,
33, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 288, 10, 33, 3, 34, 3, 34, 3, 34,
3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3,
34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34,
3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3,
34, 3, 34, 3, 34, 5, 34, 316, 10, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35,
3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 5,
34, 324, 10, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35,
3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3,
35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35,
3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 352, 10,
35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36,
3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 360, 10, 35, 3, 36, 3, 36, 3,
36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36,
3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3,
36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 381, 10, 36, 3, 37,
3, 37, 3, 37, 3, 37, 5, 37, 387, 10, 37, 3, 38, 3, 38, 5, 38, 391, 10,
38, 3, 39, 3, 39, 3, 39, 7, 39, 396, 10, 39, 12, 39, 14, 39, 399, 11, 39,
3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 406, 10, 39, 3, 40, 5, 40, 409,
10, 40, 3, 40, 3, 40, 5, 40, 413, 10, 40, 3, 40, 3, 40, 3, 40, 5, 40, 418,
10, 40, 3, 40, 5, 40, 421, 10, 40, 3, 41, 3, 41, 3, 41, 3, 41, 5, 41, 427,
10, 41, 3, 41, 3, 41, 6, 41, 431, 10, 41, 13, 41, 14, 41, 432, 3, 42, 3,
42, 3, 42, 5, 42, 438, 10, 42, 3, 43, 6, 43, 441, 10, 43, 13, 43, 14, 43,
442, 3, 44, 6, 44, 446, 10, 44, 13, 44, 14, 44, 447, 3, 45, 3, 45, 3, 45,
3, 45, 3, 45, 3, 45, 3, 45, 5, 45, 457, 10, 45, 3, 46, 3, 46, 3, 46, 3,
46, 3, 46, 3, 46, 3, 46, 5, 46, 466, 10, 46, 3, 47, 3, 47, 3, 48, 3, 48,
3, 49, 3, 49, 3, 49, 6, 49, 475, 10, 49, 13, 49, 14, 49, 476, 3, 50, 3,
50, 7, 50, 481, 10, 50, 12, 50, 14, 50, 484, 11, 50, 3, 50, 5, 50, 487,
10, 50, 3, 51, 3, 51, 7, 51, 491, 10, 51, 12, 51, 14, 51, 494, 11, 51,
3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 54, 3, 54, 3, 55, 3, 55, 3,
56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57,
3, 57, 3, 57, 3, 57, 3, 57, 5, 57, 521, 10, 57, 3, 58, 3, 58, 5, 58, 525,
10, 58, 3, 58, 3, 58, 3, 58, 5, 58, 530, 10, 58, 3, 59, 3, 59, 3, 59, 3,
59, 5, 59, 536, 10, 59, 3, 59, 3, 59, 3, 60, 5, 60, 541, 10, 60, 3, 60,
3, 60, 3, 60, 3, 60, 3, 60, 5, 60, 548, 10, 60, 3, 61, 3, 61, 5, 61, 552,
10, 61, 3, 61, 3, 61, 3, 62, 6, 62, 557, 10, 62, 13, 62, 14, 62, 558, 3,
63, 5, 63, 562, 10, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 569,
10, 63, 3, 64, 6, 64, 572, 10, 64, 13, 64, 14, 64, 573, 3, 65, 3, 65, 5,
65, 578, 10, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 5, 66,
587, 10, 66, 3, 66, 5, 66, 590, 10, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3,
66, 5, 66, 597, 10, 66, 3, 67, 6, 67, 600, 10, 67, 13, 67, 14, 67, 601,
3, 67, 3, 67, 3, 68, 3, 68, 5, 68, 608, 10, 68, 3, 68, 5, 68, 611, 10,
68, 3, 68, 3, 68, 2, 2, 69, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9,
17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18,
35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27,
53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36,
71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 2, 85, 2, 87, 2, 89,
2, 91, 2, 93, 2, 95, 2, 97, 2, 99, 2, 101, 2, 103, 2, 105, 2, 107, 2, 109,
2, 111, 2, 113, 2, 115, 2, 117, 2, 119, 2, 121, 2, 123, 2, 125, 2, 127,
2, 129, 2, 131, 2, 133, 43, 135, 44, 3, 2, 18, 5, 2, 78, 78, 87, 87, 119,
119, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 6, 2, 12, 12, 15, 15, 41, 41,
94, 94, 5, 2, 67, 92, 97, 97, 99, 124, 3, 2, 50, 59, 4, 2, 68, 68, 100,
100, 3, 2, 50, 51, 4, 2, 90, 90, 122, 122, 3, 2, 51, 59, 3, 2, 50, 57,
5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47,
47, 4, 2, 82, 82, 114, 114, 12, 2, 36, 36, 41, 41, 65, 65, 94, 94, 99,
100, 104, 104, 112, 112, 116, 116, 118, 118, 120, 120, 4, 2, 11, 11, 34,
34, 2, 649, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9,
3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2,
17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2,
2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2,
2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2,
2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3,
2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55,
3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2,
63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2,
2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2,
2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3,
2, 2, 2, 3, 137, 3, 2, 2, 2, 5, 139, 3, 2, 2, 2, 7, 141, 3, 2, 2, 2, 9,
143, 3, 2, 2, 2, 11, 145, 3, 2, 2, 2, 13, 147, 3, 2, 2, 2, 15, 149, 3,
2, 2, 2, 17, 152, 3, 2, 2, 2, 19, 154, 3, 2, 2, 2, 21, 157, 3, 2, 2, 2,
23, 160, 3, 2, 2, 2, 25, 171, 3, 2, 2, 2, 27, 185, 3, 2, 2, 2, 29, 187,
3, 2, 2, 2, 31, 189, 3, 2, 2, 2, 33, 191, 3, 2, 2, 2, 35, 193, 3, 2, 2,
2, 37, 195, 3, 2, 2, 2, 39, 197, 3, 2, 2, 2, 41, 200, 3, 2, 2, 2, 43, 203,
3, 2, 2, 2, 45, 206, 3, 2, 2, 2, 47, 208, 3, 2, 2, 2, 49, 210, 3, 2, 2,
2, 51, 217, 3, 2, 2, 2, 53, 223, 3, 2, 2, 2, 55, 225, 3, 2, 2, 2, 57, 231,
3, 2, 2, 2, 59, 233, 3, 2, 2, 2, 61, 236, 3, 2, 2, 2, 63, 243, 3, 2, 2,
2, 65, 279, 3, 2, 2, 2, 67, 315, 3, 2, 2, 2, 69, 351, 3, 2, 2, 2, 71, 380,
3, 2, 2, 2, 73, 386, 3, 2, 2, 2, 75, 390, 3, 2, 2, 2, 77, 405, 3, 2, 2,
2, 79, 408, 3, 2, 2, 2, 81, 422, 3, 2, 2, 2, 83, 437, 3, 2, 2, 2, 85, 440,
3, 2, 2, 2, 87, 445, 3, 2, 2, 2, 89, 456, 3, 2, 2, 2, 91, 465, 3, 2, 2,
2, 93, 467, 3, 2, 2, 2, 95, 469, 3, 2, 2, 2, 97, 471, 3, 2, 2, 2, 99, 486,
3, 2, 2, 2, 101, 488, 3, 2, 2, 2, 103, 495, 3, 2, 2, 2, 105, 499, 3, 2,
2, 2, 107, 501, 3, 2, 2, 2, 109, 503, 3, 2, 2, 2, 111, 505, 3, 2, 2, 2,
113, 520, 3, 2, 2, 2, 115, 529, 3, 2, 2, 2, 117, 531, 3, 2, 2, 2, 119,
547, 3, 2, 2, 2, 121, 549, 3, 2, 2, 2, 123, 556, 3, 2, 2, 2, 125, 568,
3, 2, 2, 2, 127, 571, 3, 2, 2, 2, 129, 575, 3, 2, 2, 2, 131, 596, 3, 2,
2, 2, 133, 599, 3, 2, 2, 2, 135, 610, 3, 2, 2, 2, 137, 138, 7, 42, 2, 2,
138, 4, 3, 2, 2, 2, 139, 140, 7, 43, 2, 2, 140, 6, 3, 2, 2, 2, 141, 142,
7, 93, 2, 2, 142, 8, 3, 2, 2, 2, 143, 144, 7, 46, 2, 2, 144, 10, 3, 2,
2, 2, 145, 146, 7, 95, 2, 2, 146, 12, 3, 2, 2, 2, 147, 148, 7, 62, 2, 2,
148, 14, 3, 2, 2, 2, 149, 150, 7, 62, 2, 2, 150, 151, 7, 63, 2, 2, 151,
16, 3, 2, 2, 2, 152, 153, 7, 64, 2, 2, 153, 18, 3, 2, 2, 2, 154, 155, 7,
64, 2, 2, 155, 156, 7, 63, 2, 2, 156, 20, 3, 2, 2, 2, 157, 158, 7, 63,
2, 2, 158, 159, 7, 63, 2, 2, 159, 22, 3, 2, 2, 2, 160, 161, 7, 35, 2, 2,
161, 162, 7, 63, 2, 2, 162, 24, 3, 2, 2, 2, 163, 164, 7, 110, 2, 2, 164,
165, 7, 107, 2, 2, 165, 166, 7, 109, 2, 2, 166, 172, 7, 103, 2, 2, 167,
168, 7, 78, 2, 2, 168, 169, 7, 75, 2, 2, 169, 170, 7, 77, 2, 2, 170, 172,
7, 71, 2, 2, 171, 163, 3, 2, 2, 2, 171, 167, 3, 2, 2, 2, 172, 26, 3, 2,
2, 2, 173, 174, 7, 103, 2, 2, 174, 175, 7, 122, 2, 2, 175, 176, 7, 107,
2, 2, 176, 177, 7, 117, 2, 2, 177, 178, 7, 118, 2, 2, 178, 186, 7, 117,
2, 2, 179, 180, 7, 71, 2, 2, 180, 181, 7, 90, 2, 2, 181, 182, 7, 75, 2,
2, 182, 183, 7, 85, 2, 2, 183, 184, 7, 86, 2, 2, 184, 186, 7, 85, 2, 2,
185, 173, 3, 2, 2, 2, 185, 179, 3, 2, 2, 2, 186, 28, 3, 2, 2, 2, 187, 188,
7, 45, 2, 2, 188, 30, 3, 2, 2, 2, 189, 190, 7, 47, 2, 2, 190, 32, 3, 2,
2, 2, 191, 192, 7, 44, 2, 2, 192, 34, 3, 2, 2, 2, 193, 194, 7, 49, 2, 2,
194, 36, 3, 2, 2, 2, 195, 196, 7, 39, 2, 2, 196, 38, 3, 2, 2, 2, 197, 198,
7, 44, 2, 2, 198, 199, 7, 44, 2, 2, 199, 40, 3, 2, 2, 2, 200, 201, 7, 62,
2, 2, 201, 202, 7, 62, 2, 2, 202, 42, 3, 2, 2, 2, 203, 204, 7, 64, 2, 2,
204, 205, 7, 64, 2, 2, 205, 44, 3, 2, 2, 2, 206, 207, 7, 40, 2, 2, 207,
46, 3, 2, 2, 2, 208, 209, 7, 126, 2, 2, 209, 48, 3, 2, 2, 2, 210, 211,
7, 96, 2, 2, 211, 50, 3, 2, 2, 2, 212, 213, 7, 40, 2, 2, 213, 218, 7, 40,
2, 2, 214, 215, 7, 99, 2, 2, 215, 216, 7, 112, 2, 2, 216, 218, 7, 102,
2, 2, 217, 212, 3, 2, 2, 2, 217, 214, 3, 2, 2, 2, 218, 52, 3, 2, 2, 2,
219, 220, 7, 126, 2, 2, 220, 224, 7, 126, 2, 2, 221, 222, 7, 113, 2, 2,
222, 224, 7, 116, 2, 2, 223, 219, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 224,
54, 3, 2, 2, 2, 225, 226, 7, 128, 2, 2, 226, 56, 3, 2, 2, 2, 227, 232,
7, 35, 2, 2, 228, 229, 7, 112, 2, 2, 229, 230, 7, 113, 2, 2, 230, 232,
7, 118, 2, 2, 231, 227, 3, 2, 2, 2, 231, 228, 3, 2, 2, 2, 232, 58, 3, 2,
2, 2, 233, 234, 7, 107, 2, 2, 234, 235, 7, 112, 2, 2, 235, 60, 3, 2, 2,
2, 236, 237, 7, 112, 2, 2, 237, 238, 7, 113, 2, 2, 238, 239, 7, 118, 2,
2, 239, 240, 7, 34, 2, 2, 240, 241, 7, 107, 2, 2, 241, 242, 7, 112, 2,
2, 242, 62, 3, 2, 2, 2, 243, 248, 7, 93, 2, 2, 244, 247, 5, 133, 67, 2,
245, 247, 5, 135, 68, 2, 246, 244, 3, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247,
250, 3, 2, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 251,
3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 251, 252, 7, 95, 2, 2, 252, 64, 3, 2,
2, 2, 253, 254, 7, 108, 2, 2, 254, 255, 7, 117, 2, 2, 255, 256, 7, 113,
2, 2, 256, 257, 7, 112, 2, 2, 257, 258, 7, 97, 2, 2, 258, 259, 7, 101,
2, 2, 259, 260, 7, 113, 2, 2, 260, 261, 7, 112, 2, 2, 261, 262, 7, 118,
2, 2, 262, 263, 7, 99, 2, 2, 263, 264, 7, 107, 2, 2, 264, 265, 7, 112,
2, 2, 265, 280, 7, 117, 2, 2, 266, 267, 7, 76, 2, 2, 267, 268, 7, 85, 2,
2, 268, 269, 7, 81, 2, 2, 269, 270, 7, 80, 2, 2, 270, 271, 7, 97, 2, 2,
271, 272, 7, 69, 2, 2, 272, 273, 7, 81, 2, 2, 273, 274, 7, 80, 2, 2, 274,
275, 7, 86, 2, 2, 275, 276, 7, 67, 2, 2, 276, 277, 7, 75, 2, 2, 277, 278,
7, 80, 2, 2, 278, 280, 7, 85, 2, 2, 279, 253, 3, 2, 2, 2, 279, 266, 3,
2, 2, 2, 280, 66, 3, 2, 2, 2, 281, 282, 7, 108, 2, 2, 282, 283, 7, 117,
2, 2, 283, 284, 7, 113, 2, 2, 284, 285, 7, 112, 2, 2, 285, 286, 7, 97,
2, 2, 286, 287, 7, 101, 2, 2, 287, 288, 7, 113, 2, 2, 288, 289, 7, 112,
2, 2, 289, 290, 7, 118, 2, 2, 290, 291, 7, 99, 2, 2, 291, 292, 7, 107,
2, 2, 292, 293, 7, 112, 2, 2, 293, 294, 7, 117, 2, 2, 294, 295, 7, 97,
2, 2, 295, 296, 7, 99, 2, 2, 296, 297, 7, 110, 2, 2, 297, 316, 7, 110,
2, 2, 298, 299, 7, 76, 2, 2, 299, 300, 7, 85, 2, 2, 300, 301, 7, 81, 2,
2, 301, 302, 7, 80, 2, 2, 302, 303, 7, 97, 2, 2, 303, 304, 7, 69, 2, 2,
304, 305, 7, 81, 2, 2, 305, 306, 7, 80, 2, 2, 306, 307, 7, 86, 2, 2, 307,
308, 7, 67, 2, 2, 308, 309, 7, 75, 2, 2, 309, 310, 7, 80, 2, 2, 310, 311,
7, 85, 2, 2, 311, 312, 7, 97, 2, 2, 312, 313, 7, 67, 2, 2, 313, 314, 7,
78, 2, 2, 314, 316, 7, 78, 2, 2, 315, 281, 3, 2, 2, 2, 315, 298, 3, 2,
2, 2, 316, 68, 3, 2, 2, 2, 317, 318, 7, 108, 2, 2, 318, 319, 7, 117, 2,
2, 319, 320, 7, 113, 2, 2, 320, 321, 7, 112, 2, 2, 321, 322, 7, 97, 2,
2, 322, 323, 7, 101, 2, 2, 323, 324, 7, 113, 2, 2, 324, 325, 7, 112, 2,
2, 325, 326, 7, 118, 2, 2, 326, 327, 7, 99, 2, 2, 327, 328, 7, 107, 2,
2, 328, 329, 7, 112, 2, 2, 329, 330, 7, 117, 2, 2, 330, 331, 7, 97, 2,
2, 331, 332, 7, 99, 2, 2, 332, 333, 7, 112, 2, 2, 333, 352, 7, 123, 2,
2, 334, 335, 7, 76, 2, 2, 335, 336, 7, 85, 2, 2, 336, 337, 7, 81, 2, 2,
337, 338, 7, 80, 2, 2, 338, 339, 7, 97, 2, 2, 339, 340, 7, 69, 2, 2, 340,
341, 7, 81, 2, 2, 341, 342, 7, 80, 2, 2, 342, 343, 7, 86, 2, 2, 343, 344,
7, 67, 2, 2, 344, 345, 7, 75, 2, 2, 345, 346, 7, 80, 2, 2, 346, 347, 7,
85, 2, 2, 347, 348, 7, 97, 2, 2, 348, 349, 7, 67, 2, 2, 349, 350, 7, 80,
2, 2, 350, 352, 7, 91, 2, 2, 351, 317, 3, 2, 2, 2, 351, 334, 3, 2, 2, 2,
352, 70, 3, 2, 2, 2, 353, 354, 7, 118, 2, 2, 354, 355, 7, 116, 2, 2, 355,
356, 7, 119, 2, 2, 356, 381, 7, 103, 2, 2, 357, 358, 7, 86, 2, 2, 358,
359, 7, 116, 2, 2, 359, 360, 7, 119, 2, 2, 360, 381, 7, 103, 2, 2, 361,
362, 7, 86, 2, 2, 362, 363, 7, 84, 2, 2, 363, 364, 7, 87, 2, 2, 364, 381,
7, 71, 2, 2, 365, 366, 7, 104, 2, 2, 366, 367, 7, 99, 2, 2, 367, 368, 7,
110, 2, 2, 368, 369, 7, 117, 2, 2, 369, 381, 7, 103, 2, 2, 370, 371, 7,
72, 2, 2, 371, 372, 7, 99, 2, 2, 372, 373, 7, 110, 2, 2, 373, 374, 7, 117,
2, 2, 374, 381, 7, 103, 2, 2, 375, 376, 7, 72, 2, 2, 376, 377, 7, 67, 2,
2, 377, 378, 7, 78, 2, 2, 378, 379, 7, 85, 2, 2, 379, 381, 7, 71, 2, 2,
380, 353, 3, 2, 2, 2, 380, 357, 3, 2, 2, 2, 380, 361, 3, 2, 2, 2, 380,
365, 3, 2, 2, 2, 380, 370, 3, 2, 2, 2, 380, 375, 3, 2, 2, 2, 381, 72, 3,
2, 2, 2, 382, 387, 5, 99, 50, 2, 383, 387, 5, 101, 51, 2, 384, 387, 5,
103, 52, 2, 385, 387, 5, 97, 49, 2, 386, 382, 3, 2, 2, 2, 386, 383, 3,
2, 2, 2, 386, 384, 3, 2, 2, 2, 386, 385, 3, 2, 2, 2, 387, 74, 3, 2, 2,
2, 388, 391, 5, 115, 58, 2, 389, 391, 5, 117, 59, 2, 390, 388, 3, 2, 2,
2, 390, 389, 3, 2, 2, 2, 391, 76, 3, 2, 2, 2, 392, 397, 5, 93, 47, 2, 393,
396, 5, 93, 47, 2, 394, 396, 5, 95, 48, 2, 395, 393, 3, 2, 2, 2, 395, 394,
3, 2, 2, 2, 396, 399, 3, 2, 2, 2, 397, 395, 3, 2, 2, 2, 397, 398, 3, 2,
2, 2, 398, 406, 3, 2, 2, 2, 399, 397, 3, 2, 2, 2, 400, 401, 7, 38, 2, 2,
401, 402, 7, 111, 2, 2, 402, 403, 7, 103, 2, 2, 403, 404, 7, 118, 2, 2,
404, 406, 7, 99, 2, 2, 405, 392, 3, 2, 2, 2, 405, 400, 3, 2, 2, 2, 406,
78, 3, 2, 2, 2, 407, 409, 5, 83, 42, 2, 408, 407, 3, 2, 2, 2, 408, 409,
3, 2, 2, 2, 409, 420, 3, 2, 2, 2, 410, 412, 7, 36, 2, 2, 411, 413, 5, 85,
43, 2, 412, 411, 3, 2, 2, 2, 412, 413, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2,
414, 421, 7, 36, 2, 2, 415, 417, 7, 41, 2, 2, 416, 418, 5, 87, 44, 2, 417,
416, 3, 2, 2, 2, 417, 418, 3, 2, 2, 2, 418, 419, 3, 2, 2, 2, 419, 421,
7, 41, 2, 2, 420, 410, 3, 2, 2, 2, 420, 415, 3, 2, 2, 2, 421, 80, 3, 2,
2, 2, 422, 430, 5, 77, 39, 2, 423, 426, 7, 93, 2, 2, 424, 427, 5, 79, 40,
2, 425, 427, 5, 99, 50, 2, 426, 424, 3, 2, 2, 2, 426, 425, 3, 2, 2, 2,
427, 428, 3, 2, 2, 2, 428, 429, 7, 95, 2, 2, 429, 431, 3, 2, 2, 2, 430,
423, 3, 2, 2, 2, 431, 432, 3, 2, 2, 2, 432, 430, 3, 2, 2, 2, 432, 433,
3, 2, 2, 2, 433, 82, 3, 2, 2, 2, 434, 435, 7, 119, 2, 2, 435, 438, 7, 58,
2, 2, 436, 438, 9, 2, 2, 2, 437, 434, 3, 2, 2, 2, 437, 436, 3, 2, 2, 2,
438, 84, 3, 2, 2, 2, 439, 441, 5, 89, 45, 2, 440, 439, 3, 2, 2, 2, 441,
442, 3, 2, 2, 2, 442, 440, 3, 2, 2, 2, 442, 443, 3, 2, 2, 2, 443, 86, 3,
2, 2, 2, 444, 446, 5, 91, 46, 2, 445, 444, 3, 2, 2, 2, 446, 447, 3, 2,
2, 2, 447, 445, 3, 2, 2, 2, 447, 448, 3, 2, 2, 2, 448, 88, 3, 2, 2, 2,
449, 457, 10, 3, 2, 2, 450, 457, 5, 131, 66, 2, 451, 452, 7, 94, 2, 2,
452, 457, 7, 12, 2, 2, 453, 454, 7, 94, 2, 2, 454, 455, 7, 15, 2, 2, 455,
457, 7, 12, 2, 2, 456, 449, 3, 2, 2, 2, 456, 450, 3, 2, 2, 2, 456, 451,
3, 2, 2, 2, 456, 453, 3, 2, 2, 2, 457, 90, 3, 2, 2, 2, 458, 466, 10, 4,
2, 2, 459, 466, 5, 131, 66, 2, 460, 461, 7, 94, 2, 2, 461, 466, 7, 12,
2, 2, 462, 463, 7, 94, 2, 2, 463, 464, 7, 15, 2, 2, 464, 466, 7, 12, 2,
2, 465, 458, 3, 2, 2, 2, 465, 459, 3, 2, 2, 2, 465, 460, 3, 2, 2, 2, 465,
462, 3, 2, 2, 2, 466, 92, 3, 2, 2, 2, 467, 468, 9, 5, 2, 2, 468, 94, 3,
2, 2, 2, 469, 470, 9, 6, 2, 2, 470, 96, 3, 2, 2, 2, 471, 472, 7, 50, 2,
2, 472, 474, 9, 7, 2, 2, 473, 475, 9, 8, 2, 2, 474, 473, 3, 2, 2, 2, 475,
476, 3, 2, 2, 2, 476, 474, 3, 2, 2, 2, 476, 477, 3, 2, 2, 2, 477, 98, 3,
2, 2, 2, 478, 482, 5, 105, 53, 2, 479, 481, 5, 95, 48, 2, 480, 479, 3,
2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 482, 483, 3, 2, 2,
2, 483, 487, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 485, 487, 7, 50, 2, 2, 486,
478, 3, 2, 2, 2, 486, 485, 3, 2, 2, 2, 487, 100, 3, 2, 2, 2, 488, 492,
7, 50, 2, 2, 489, 491, 5, 107, 54, 2, 490, 489, 3, 2, 2, 2, 491, 494, 3,
2, 2, 2, 492, 490, 3, 2, 2, 2, 492, 493, 3, 2, 2, 2, 493, 102, 3, 2, 2,
2, 494, 492, 3, 2, 2, 2, 495, 496, 7, 50, 2, 2, 496, 497, 9, 9, 2, 2, 497,
498, 5, 127, 64, 2, 498, 104, 3, 2, 2, 2, 499, 500, 9, 10, 2, 2, 500, 106,
3, 2, 2, 2, 501, 502, 9, 11, 2, 2, 502, 108, 3, 2, 2, 2, 503, 504, 9, 12,
2, 2, 504, 110, 3, 2, 2, 2, 505, 506, 5, 109, 55, 2, 506, 507, 5, 109,
55, 2, 507, 508, 5, 109, 55, 2, 508, 509, 5, 109, 55, 2, 509, 112, 3, 2,
2, 2, 510, 511, 7, 94, 2, 2, 511, 512, 7, 119, 2, 2, 512, 513, 3, 2, 2,
2, 513, 521, 5, 111, 56, 2, 514, 515, 7, 94, 2, 2, 515, 516, 7, 87, 2,
2, 516, 517, 3, 2, 2, 2, 517, 518, 5, 111, 56, 2, 518, 519, 5, 111, 56,
2, 519, 521, 3, 2, 2, 2, 520, 510, 3, 2, 2, 2, 520, 514, 3, 2, 2, 2, 521,
114, 3, 2, 2, 2, 522, 524, 5, 119, 60, 2, 523, 525, 5, 121, 61, 2, 524,
523, 3, 2, 2, 2, 524, 525, 3, 2, 2, 2, 525, 530, 3, 2, 2, 2, 526, 527,
5, 123, 62, 2, 527, 528, 5, 121, 61, 2, 528, 530, 3, 2, 2, 2, 529, 522,
3, 2, 2, 2, 529, 526, 3, 2, 2, 2, 530, 116, 3, 2, 2, 2, 531, 532, 7, 50,
2, 2, 532, 535, 9, 9, 2, 2, 533, 536, 5, 125, 63, 2, 534, 536, 5, 127,
64, 2, 535, 533, 3, 2, 2, 2, 535, 534, 3, 2, 2, 2, 536, 537, 3, 2, 2, 2,
537, 538, 5, 129, 65, 2, 538, 118, 3, 2, 2, 2, 539, 541, 5, 123, 62, 2,
540, 539, 3, 2, 2, 2, 540, 541, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542,
543, 7, 48, 2, 2, 543, 548, 5, 123, 62, 2, 544, 545, 5, 123, 62, 2, 545,
546, 7, 48, 2, 2, 546, 548, 3, 2, 2, 2, 547, 540, 3, 2, 2, 2, 547, 544,
3, 2, 2, 2, 548, 120, 3, 2, 2, 2, 549, 551, 9, 13, 2, 2, 550, 552, 9, 14,
2, 2, 551, 550, 3, 2, 2, 2, 551, 552, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2,
553, 554, 5, 123, 62, 2, 554, 122, 3, 2, 2, 2, 555, 557, 5, 95, 48, 2,
556, 555, 3, 2, 2, 2, 557, 558, 3, 2, 2, 2, 558, 556, 3, 2, 2, 2, 558,
559, 3, 2, 2, 2, 559, 124, 3, 2, 2, 2, 560, 562, 5, 127, 64, 2, 561, 560,
3, 2, 2, 2, 561, 562, 3, 2, 2, 2, 562, 563, 3, 2, 2, 2, 563, 564, 7, 48,
2, 2, 564, 569, 5, 127, 64, 2, 565, 566, 5, 127, 64, 2, 566, 567, 7, 48,
2, 2, 567, 569, 3, 2, 2, 2, 568, 561, 3, 2, 2, 2, 568, 565, 3, 2, 2, 2,
569, 126, 3, 2, 2, 2, 570, 572, 5, 109, 55, 2, 571, 570, 3, 2, 2, 2, 572,
573, 3, 2, 2, 2, 573, 571, 3, 2, 2, 2, 573, 574, 3, 2, 2, 2, 574, 128,
3, 2, 2, 2, 575, 577, 9, 15, 2, 2, 576, 578, 9, 14, 2, 2, 577, 576, 3,
2, 2, 2, 577, 578, 3, 2, 2, 2, 578, 579, 3, 2, 2, 2, 579, 580, 5, 123,
62, 2, 580, 130, 3, 2, 2, 2, 581, 582, 7, 94, 2, 2, 582, 597, 9, 16, 2,
2, 583, 584, 7, 94, 2, 2, 584, 586, 5, 107, 54, 2, 585, 587, 5, 107, 54,
2, 586, 585, 3, 2, 2, 2, 586, 587, 3, 2, 2, 2, 587, 589, 3, 2, 2, 2, 588,
590, 5, 107, 54, 2, 589, 588, 3, 2, 2, 2, 589, 590, 3, 2, 2, 2, 590, 597,
3, 2, 2, 2, 591, 592, 7, 94, 2, 2, 592, 593, 7, 122, 2, 2, 593, 594, 3,
2, 2, 2, 594, 597, 5, 127, 64, 2, 595, 597, 5, 113, 57, 2, 596, 581, 3,
2, 2, 2, 596, 583, 3, 2, 2, 2, 596, 591, 3, 2, 2, 2, 596, 595, 3, 2, 2,
2, 597, 132, 3, 2, 2, 2, 598, 600, 9, 17, 2, 2, 599, 598, 3, 2, 2, 2, 600,
601, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 601, 602, 3, 2, 2, 2, 602, 603,
3, 2, 2, 2, 603, 604, 8, 67, 2, 2, 604, 134, 3, 2, 2, 2, 605, 607, 7, 15,
2, 2, 606, 608, 7, 12, 2, 2, 607, 606, 3, 2, 2, 2, 607, 608, 3, 2, 2, 2,
608, 611, 3, 2, 2, 2, 609, 611, 7, 12, 2, 2, 610, 605, 3, 2, 2, 2, 610,
609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 613, 8, 68, 2, 2, 613, 136,
3, 2, 2, 2, 52, 2, 171, 185, 217, 223, 231, 246, 248, 279, 315, 351, 380,
386, 390, 395, 397, 405, 408, 412, 417, 420, 426, 432, 437, 442, 447, 456,
465, 476, 482, 486, 492, 520, 524, 529, 535, 540, 547, 551, 558, 561, 568,
573, 577, 586, 589, 596, 601, 607, 610, 3, 8, 2, 2,
36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 390, 10, 36, 3, 37, 3, 37, 3, 37,
3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3,
37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37,
3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3,
37, 3, 37, 5, 37, 428, 10, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38,
3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3,
38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38,
3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 5, 38, 466,
10, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39,
3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3,
39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 492, 10, 39, 3, 40, 3, 40, 3, 40,
3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3,
40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40,
3, 40, 3, 40, 3, 40, 5, 40, 521, 10, 40, 3, 41, 3, 41, 3, 41, 3, 41, 5,
41, 527, 10, 41, 3, 42, 3, 42, 5, 42, 531, 10, 42, 3, 43, 3, 43, 3, 43,
7, 43, 536, 10, 43, 12, 43, 14, 43, 539, 11, 43, 3, 43, 3, 43, 3, 43, 3,
43, 3, 43, 5, 43, 546, 10, 43, 3, 44, 5, 44, 549, 10, 44, 3, 44, 3, 44,
5, 44, 553, 10, 44, 3, 44, 3, 44, 3, 44, 5, 44, 558, 10, 44, 3, 44, 5,
44, 561, 10, 44, 3, 45, 3, 45, 3, 45, 3, 45, 5, 45, 567, 10, 45, 3, 45,
3, 45, 6, 45, 571, 10, 45, 13, 45, 14, 45, 572, 3, 46, 3, 46, 3, 46, 5,
46, 578, 10, 46, 3, 47, 6, 47, 581, 10, 47, 13, 47, 14, 47, 582, 3, 48,
6, 48, 586, 10, 48, 13, 48, 14, 48, 587, 3, 49, 3, 49, 3, 49, 3, 49, 3,
49, 3, 49, 3, 49, 5, 49, 597, 10, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50,
3, 50, 3, 50, 5, 50, 606, 10, 50, 3, 51, 3, 51, 3, 52, 3, 52, 3, 53, 3,
53, 3, 53, 6, 53, 615, 10, 53, 13, 53, 14, 53, 616, 3, 54, 3, 54, 7, 54,
621, 10, 54, 12, 54, 14, 54, 624, 11, 54, 3, 54, 5, 54, 627, 10, 54, 3,
55, 3, 55, 7, 55, 631, 10, 55, 12, 55, 14, 55, 634, 11, 55, 3, 56, 3, 56,
3, 56, 3, 56, 3, 57, 3, 57, 3, 58, 3, 58, 3, 59, 3, 59, 3, 60, 3, 60, 3,
60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61,
3, 61, 3, 61, 5, 61, 661, 10, 61, 3, 62, 3, 62, 5, 62, 665, 10, 62, 3,
62, 3, 62, 3, 62, 5, 62, 670, 10, 62, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63,
676, 10, 63, 3, 63, 3, 63, 3, 64, 5, 64, 681, 10, 64, 3, 64, 3, 64, 3,
64, 3, 64, 3, 64, 5, 64, 688, 10, 64, 3, 65, 3, 65, 5, 65, 692, 10, 65,
3, 65, 3, 65, 3, 66, 6, 66, 697, 10, 66, 13, 66, 14, 66, 698, 3, 67, 5,
67, 702, 10, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 5, 67, 709, 10, 67,
3, 68, 6, 68, 712, 10, 68, 13, 68, 14, 68, 713, 3, 69, 3, 69, 5, 69, 718,
10, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 5, 70, 727, 10,
70, 3, 70, 5, 70, 730, 10, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 5, 70,
737, 10, 70, 3, 71, 6, 71, 740, 10, 71, 13, 71, 14, 71, 741, 3, 71, 3,
71, 3, 72, 3, 72, 5, 72, 748, 10, 72, 3, 72, 5, 72, 751, 10, 72, 3, 72,
3, 72, 2, 2, 73, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19,
11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37,
20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55,
29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73,
38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91,
2, 93, 2, 95, 2, 97, 2, 99, 2, 101, 2, 103, 2, 105, 2, 107, 2, 109, 2,
111, 2, 113, 2, 115, 2, 117, 2, 119, 2, 121, 2, 123, 2, 125, 2, 127, 2,
129, 2, 131, 2, 133, 2, 135, 2, 137, 2, 139, 2, 141, 47, 143, 48, 3, 2,
18, 5, 2, 78, 78, 87, 87, 119, 119, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94,
6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 5, 2, 67, 92, 97, 97, 99, 124, 3,
2, 50, 59, 4, 2, 68, 68, 100, 100, 3, 2, 50, 51, 4, 2, 90, 90, 122, 122,
3, 2, 51, 59, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 71, 71,
103, 103, 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, 11, 153, 3, 2, 2, 2, 13,
155, 3, 2, 2, 2, 15, 157, 3, 2, 2, 2, 17, 160, 3, 2, 2, 2, 19, 162, 3,
2, 2, 2, 21, 165, 3, 2, 2, 2, 23, 168, 3, 2, 2, 2, 25, 179, 3, 2, 2, 2,
27, 193, 3, 2, 2, 2, 29, 195, 3, 2, 2, 2, 31, 197, 3, 2, 2, 2, 33, 199,
3, 2, 2, 2, 35, 201, 3, 2, 2, 2, 37, 203, 3, 2, 2, 2, 39, 205, 3, 2, 2,
2, 41, 208, 3, 2, 2, 2, 43, 211, 3, 2, 2, 2, 45, 214, 3, 2, 2, 2, 47, 216,
3, 2, 2, 2, 49, 218, 3, 2, 2, 2, 51, 225, 3, 2, 2, 2, 53, 231, 3, 2, 2,
2, 55, 233, 3, 2, 2, 2, 57, 239, 3, 2, 2, 2, 59, 241, 3, 2, 2, 2, 61, 244,
3, 2, 2, 2, 63, 251, 3, 2, 2, 2, 65, 287, 3, 2, 2, 2, 67, 323, 3, 2, 2,
2, 69, 359, 3, 2, 2, 2, 71, 389, 3, 2, 2, 2, 73, 427, 3, 2, 2, 2, 75, 465,
3, 2, 2, 2, 77, 491, 3, 2, 2, 2, 79, 520, 3, 2, 2, 2, 81, 526, 3, 2, 2,
2, 83, 530, 3, 2, 2, 2, 85, 545, 3, 2, 2, 2, 87, 548, 3, 2, 2, 2, 89, 562,
3, 2, 2, 2, 91, 577, 3, 2, 2, 2, 93, 580, 3, 2, 2, 2, 95, 585, 3, 2, 2,
2, 97, 596, 3, 2, 2, 2, 99, 605, 3, 2, 2, 2, 101, 607, 3, 2, 2, 2, 103,
609, 3, 2, 2, 2, 105, 611, 3, 2, 2, 2, 107, 626, 3, 2, 2, 2, 109, 628,
3, 2, 2, 2, 111, 635, 3, 2, 2, 2, 113, 639, 3, 2, 2, 2, 115, 641, 3, 2,
2, 2, 117, 643, 3, 2, 2, 2, 119, 645, 3, 2, 2, 2, 121, 660, 3, 2, 2, 2,
123, 669, 3, 2, 2, 2, 125, 671, 3, 2, 2, 2, 127, 687, 3, 2, 2, 2, 129,
689, 3, 2, 2, 2, 131, 696, 3, 2, 2, 2, 133, 708, 3, 2, 2, 2, 135, 711,
3, 2, 2, 2, 137, 715, 3, 2, 2, 2, 139, 736, 3, 2, 2, 2, 141, 739, 3, 2,
2, 2, 143, 750, 3, 2, 2, 2, 145, 146, 7, 42, 2, 2, 146, 4, 3, 2, 2, 2,
147, 148, 7, 43, 2, 2, 148, 6, 3, 2, 2, 2, 149, 150, 7, 93, 2, 2, 150,
8, 3, 2, 2, 2, 151, 152, 7, 46, 2, 2, 152, 10, 3, 2, 2, 2, 153, 154, 7,
95, 2, 2, 154, 12, 3, 2, 2, 2, 155, 156, 7, 62, 2, 2, 156, 14, 3, 2, 2,
2, 157, 158, 7, 62, 2, 2, 158, 159, 7, 63, 2, 2, 159, 16, 3, 2, 2, 2, 160,
161, 7, 64, 2, 2, 161, 18, 3, 2, 2, 2, 162, 163, 7, 64, 2, 2, 163, 164,
7, 63, 2, 2, 164, 20, 3, 2, 2, 2, 165, 166, 7, 63, 2, 2, 166, 167, 7, 63,
2, 2, 167, 22, 3, 2, 2, 2, 168, 169, 7, 35, 2, 2, 169, 170, 7, 63, 2, 2,
170, 24, 3, 2, 2, 2, 171, 172, 7, 110, 2, 2, 172, 173, 7, 107, 2, 2, 173,
174, 7, 109, 2, 2, 174, 180, 7, 103, 2, 2, 175, 176, 7, 78, 2, 2, 176,
177, 7, 75, 2, 2, 177, 178, 7, 77, 2, 2, 178, 180, 7, 71, 2, 2, 179, 171,
3, 2, 2, 2, 179, 175, 3, 2, 2, 2, 180, 26, 3, 2, 2, 2, 181, 182, 7, 103,
2, 2, 182, 183, 7, 122, 2, 2, 183, 184, 7, 107, 2, 2, 184, 185, 7, 117,
2, 2, 185, 186, 7, 118, 2, 2, 186, 194, 7, 117, 2, 2, 187, 188, 7, 71,
2, 2, 188, 189, 7, 90, 2, 2, 189, 190, 7, 75, 2, 2, 190, 191, 7, 85, 2,
2, 191, 192, 7, 86, 2, 2, 192, 194, 7, 85, 2, 2, 193, 181, 3, 2, 2, 2,
193, 187, 3, 2, 2, 2, 194, 28, 3, 2, 2, 2, 195, 196, 7, 45, 2, 2, 196,
30, 3, 2, 2, 2, 197, 198, 7, 47, 2, 2, 198, 32, 3, 2, 2, 2, 199, 200, 7,
44, 2, 2, 200, 34, 3, 2, 2, 2, 201, 202, 7, 49, 2, 2, 202, 36, 3, 2, 2,
2, 203, 204, 7, 39, 2, 2, 204, 38, 3, 2, 2, 2, 205, 206, 7, 44, 2, 2, 206,
207, 7, 44, 2, 2, 207, 40, 3, 2, 2, 2, 208, 209, 7, 62, 2, 2, 209, 210,
7, 62, 2, 2, 210, 42, 3, 2, 2, 2, 211, 212, 7, 64, 2, 2, 212, 213, 7, 64,
2, 2, 213, 44, 3, 2, 2, 2, 214, 215, 7, 40, 2, 2, 215, 46, 3, 2, 2, 2,
216, 217, 7, 126, 2, 2, 217, 48, 3, 2, 2, 2, 218, 219, 7, 96, 2, 2, 219,
50, 3, 2, 2, 2, 220, 221, 7, 40, 2, 2, 221, 226, 7, 40, 2, 2, 222, 223,
7, 99, 2, 2, 223, 224, 7, 112, 2, 2, 224, 226, 7, 102, 2, 2, 225, 220,
3, 2, 2, 2, 225, 222, 3, 2, 2, 2, 226, 52, 3, 2, 2, 2, 227, 228, 7, 126,
2, 2, 228, 232, 7, 126, 2, 2, 229, 230, 7, 113, 2, 2, 230, 232, 7, 116,
2, 2, 231, 227, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 232, 54, 3, 2, 2, 2,
233, 234, 7, 128, 2, 2, 234, 56, 3, 2, 2, 2, 235, 240, 7, 35, 2, 2, 236,
237, 7, 112, 2, 2, 237, 238, 7, 113, 2, 2, 238, 240, 7, 118, 2, 2, 239,
235, 3, 2, 2, 2, 239, 236, 3, 2, 2, 2, 240, 58, 3, 2, 2, 2, 241, 242, 7,
107, 2, 2, 242, 243, 7, 112, 2, 2, 243, 60, 3, 2, 2, 2, 244, 245, 7, 112,
2, 2, 245, 246, 7, 113, 2, 2, 246, 247, 7, 118, 2, 2, 247, 248, 7, 34,
2, 2, 248, 249, 7, 107, 2, 2, 249, 250, 7, 112, 2, 2, 250, 62, 3, 2, 2,
2, 251, 256, 7, 93, 2, 2, 252, 255, 5, 141, 71, 2, 253, 255, 5, 143, 72,
2, 254, 252, 3, 2, 2, 2, 254, 253, 3, 2, 2, 2, 255, 258, 3, 2, 2, 2, 256,
254, 3, 2, 2, 2, 256, 257, 3, 2, 2, 2, 257, 259, 3, 2, 2, 2, 258, 256,
3, 2, 2, 2, 259, 260, 7, 95, 2, 2, 260, 64, 3, 2, 2, 2, 261, 262, 7, 108,
2, 2, 262, 263, 7, 117, 2, 2, 263, 264, 7, 113, 2, 2, 264, 265, 7, 112,
2, 2, 265, 266, 7, 97, 2, 2, 266, 267, 7, 101, 2, 2, 267, 268, 7, 113,
2, 2, 268, 269, 7, 112, 2, 2, 269, 270, 7, 118, 2, 2, 270, 271, 7, 99,
2, 2, 271, 272, 7, 107, 2, 2, 272, 273, 7, 112, 2, 2, 273, 288, 7, 117,
2, 2, 274, 275, 7, 76, 2, 2, 275, 276, 7, 85, 2, 2, 276, 277, 7, 81, 2,
2, 277, 278, 7, 80, 2, 2, 278, 279, 7, 97, 2, 2, 279, 280, 7, 69, 2, 2,
280, 281, 7, 81, 2, 2, 281, 282, 7, 80, 2, 2, 282, 283, 7, 86, 2, 2, 283,
284, 7, 67, 2, 2, 284, 285, 7, 75, 2, 2, 285, 286, 7, 80, 2, 2, 286, 288,
7, 85, 2, 2, 287, 261, 3, 2, 2, 2, 287, 274, 3, 2, 2, 2, 288, 66, 3, 2,
2, 2, 289, 290, 7, 108, 2, 2, 290, 291, 7, 117, 2, 2, 291, 292, 7, 113,
2, 2, 292, 293, 7, 112, 2, 2, 293, 294, 7, 97, 2, 2, 294, 295, 7, 101,
2, 2, 295, 296, 7, 113, 2, 2, 296, 297, 7, 112, 2, 2, 297, 298, 7, 118,
2, 2, 298, 299, 7, 99, 2, 2, 299, 300, 7, 107, 2, 2, 300, 301, 7, 112,
2, 2, 301, 302, 7, 117, 2, 2, 302, 303, 7, 97, 2, 2, 303, 304, 7, 99, 2,
2, 304, 305, 7, 110, 2, 2, 305, 324, 7, 110, 2, 2, 306, 307, 7, 76, 2,
2, 307, 308, 7, 85, 2, 2, 308, 309, 7, 81, 2, 2, 309, 310, 7, 80, 2, 2,
310, 311, 7, 97, 2, 2, 311, 312, 7, 69, 2, 2, 312, 313, 7, 81, 2, 2, 313,
314, 7, 80, 2, 2, 314, 315, 7, 86, 2, 2, 315, 316, 7, 67, 2, 2, 316, 317,
7, 75, 2, 2, 317, 318, 7, 80, 2, 2, 318, 319, 7, 85, 2, 2, 319, 320, 7,
97, 2, 2, 320, 321, 7, 67, 2, 2, 321, 322, 7, 78, 2, 2, 322, 324, 7, 78,
2, 2, 323, 289, 3, 2, 2, 2, 323, 306, 3, 2, 2, 2, 324, 68, 3, 2, 2, 2,
325, 326, 7, 108, 2, 2, 326, 327, 7, 117, 2, 2, 327, 328, 7, 113, 2, 2,
328, 329, 7, 112, 2, 2, 329, 330, 7, 97, 2, 2, 330, 331, 7, 101, 2, 2,
331, 332, 7, 113, 2, 2, 332, 333, 7, 112, 2, 2, 333, 334, 7, 118, 2, 2,
334, 335, 7, 99, 2, 2, 335, 336, 7, 107, 2, 2, 336, 337, 7, 112, 2, 2,
337, 338, 7, 117, 2, 2, 338, 339, 7, 97, 2, 2, 339, 340, 7, 99, 2, 2, 340,
341, 7, 112, 2, 2, 341, 360, 7, 123, 2, 2, 342, 343, 7, 76, 2, 2, 343,
344, 7, 85, 2, 2, 344, 345, 7, 81, 2, 2, 345, 346, 7, 80, 2, 2, 346, 347,
7, 97, 2, 2, 347, 348, 7, 69, 2, 2, 348, 349, 7, 81, 2, 2, 349, 350, 7,
80, 2, 2, 350, 351, 7, 86, 2, 2, 351, 352, 7, 67, 2, 2, 352, 353, 7, 75,
2, 2, 353, 354, 7, 80, 2, 2, 354, 355, 7, 85, 2, 2, 355, 356, 7, 97, 2,
2, 356, 357, 7, 67, 2, 2, 357, 358, 7, 80, 2, 2, 358, 360, 7, 91, 2, 2,
359, 325, 3, 2, 2, 2, 359, 342, 3, 2, 2, 2, 360, 70, 3, 2, 2, 2, 361, 362,
7, 99, 2, 2, 362, 363, 7, 116, 2, 2, 363, 364, 7, 116, 2, 2, 364, 365,
7, 99, 2, 2, 365, 366, 7, 123, 2, 2, 366, 367, 7, 97, 2, 2, 367, 368, 7,
101, 2, 2, 368, 369, 7, 113, 2, 2, 369, 370, 7, 112, 2, 2, 370, 371, 7,
118, 2, 2, 371, 372, 7, 99, 2, 2, 372, 373, 7, 107, 2, 2, 373, 374, 7,
112, 2, 2, 374, 390, 7, 117, 2, 2, 375, 376, 7, 67, 2, 2, 376, 377, 7,
84, 2, 2, 377, 378, 7, 84, 2, 2, 378, 379, 7, 67, 2, 2, 379, 380, 7, 91,
2, 2, 380, 381, 7, 97, 2, 2, 381, 382, 7, 69, 2, 2, 382, 383, 7, 81, 2,
2, 383, 384, 7, 80, 2, 2, 384, 385, 7, 86, 2, 2, 385, 386, 7, 67, 2, 2,
386, 387, 7, 75, 2, 2, 387, 388, 7, 80, 2, 2, 388, 390, 7, 85, 2, 2, 389,
361, 3, 2, 2, 2, 389, 375, 3, 2, 2, 2, 390, 72, 3, 2, 2, 2, 391, 392, 7,
99, 2, 2, 392, 393, 7, 116, 2, 2, 393, 394, 7, 116, 2, 2, 394, 395, 7,
99, 2, 2, 395, 396, 7, 123, 2, 2, 396, 397, 7, 97, 2, 2, 397, 398, 7, 101,
2, 2, 398, 399, 7, 113, 2, 2, 399, 400, 7, 112, 2, 2, 400, 401, 7, 118,
2, 2, 401, 402, 7, 99, 2, 2, 402, 403, 7, 107, 2, 2, 403, 404, 7, 112,
2, 2, 404, 405, 7, 117, 2, 2, 405, 406, 7, 97, 2, 2, 406, 407, 7, 99, 2,
2, 407, 408, 7, 110, 2, 2, 408, 428, 7, 110, 2, 2, 409, 410, 7, 67, 2,
2, 410, 411, 7, 84, 2, 2, 411, 412, 7, 84, 2, 2, 412, 413, 7, 67, 2, 2,
413, 414, 7, 91, 2, 2, 414, 415, 7, 97, 2, 2, 415, 416, 7, 69, 2, 2, 416,
417, 7, 81, 2, 2, 417, 418, 7, 80, 2, 2, 418, 419, 7, 86, 2, 2, 419, 420,
7, 67, 2, 2, 420, 421, 7, 75, 2, 2, 421, 422, 7, 80, 2, 2, 422, 423, 7,
85, 2, 2, 423, 424, 7, 97, 2, 2, 424, 425, 7, 67, 2, 2, 425, 426, 7, 78,
2, 2, 426, 428, 7, 78, 2, 2, 427, 391, 3, 2, 2, 2, 427, 409, 3, 2, 2, 2,
428, 74, 3, 2, 2, 2, 429, 430, 7, 99, 2, 2, 430, 431, 7, 116, 2, 2, 431,
432, 7, 116, 2, 2, 432, 433, 7, 99, 2, 2, 433, 434, 7, 123, 2, 2, 434,
435, 7, 97, 2, 2, 435, 436, 7, 101, 2, 2, 436, 437, 7, 113, 2, 2, 437,
438, 7, 112, 2, 2, 438, 439, 7, 118, 2, 2, 439, 440, 7, 99, 2, 2, 440,
441, 7, 107, 2, 2, 441, 442, 7, 112, 2, 2, 442, 443, 7, 117, 2, 2, 443,
444, 7, 97, 2, 2, 444, 445, 7, 99, 2, 2, 445, 446, 7, 112, 2, 2, 446, 466,
7, 123, 2, 2, 447, 448, 7, 67, 2, 2, 448, 449, 7, 84, 2, 2, 449, 450, 7,
84, 2, 2, 450, 451, 7, 67, 2, 2, 451, 452, 7, 91, 2, 2, 452, 453, 7, 97,
2, 2, 453, 454, 7, 69, 2, 2, 454, 455, 7, 81, 2, 2, 455, 456, 7, 80, 2,
2, 456, 457, 7, 86, 2, 2, 457, 458, 7, 67, 2, 2, 458, 459, 7, 75, 2, 2,
459, 460, 7, 80, 2, 2, 460, 461, 7, 85, 2, 2, 461, 462, 7, 97, 2, 2, 462,
463, 7, 67, 2, 2, 463, 464, 7, 80, 2, 2, 464, 466, 7, 91, 2, 2, 465, 429,
3, 2, 2, 2, 465, 447, 3, 2, 2, 2, 466, 76, 3, 2, 2, 2, 467, 468, 7, 99,
2, 2, 468, 469, 7, 116, 2, 2, 469, 470, 7, 116, 2, 2, 470, 471, 7, 99,
2, 2, 471, 472, 7, 123, 2, 2, 472, 473, 7, 97, 2, 2, 473, 474, 7, 110,
2, 2, 474, 475, 7, 103, 2, 2, 475, 476, 7, 112, 2, 2, 476, 477, 7, 105,
2, 2, 477, 478, 7, 118, 2, 2, 478, 492, 7, 106, 2, 2, 479, 480, 7, 67,
2, 2, 480, 481, 7, 84, 2, 2, 481, 482, 7, 84, 2, 2, 482, 483, 7, 67, 2,
2, 483, 484, 7, 91, 2, 2, 484, 485, 7, 97, 2, 2, 485, 486, 7, 78, 2, 2,
486, 487, 7, 71, 2, 2, 487, 488, 7, 80, 2, 2, 488, 489, 7, 73, 2, 2, 489,
490, 7, 86, 2, 2, 490, 492, 7, 74, 2, 2, 491, 467, 3, 2, 2, 2, 491, 479,
3, 2, 2, 2, 492, 78, 3, 2, 2, 2, 493, 494, 7, 118, 2, 2, 494, 495, 7, 116,
2, 2, 495, 496, 7, 119, 2, 2, 496, 521, 7, 103, 2, 2, 497, 498, 7, 86,
2, 2, 498, 499, 7, 116, 2, 2, 499, 500, 7, 119, 2, 2, 500, 521, 7, 103,
2, 2, 501, 502, 7, 86, 2, 2, 502, 503, 7, 84, 2, 2, 503, 504, 7, 87, 2,
2, 504, 521, 7, 71, 2, 2, 505, 506, 7, 104, 2, 2, 506, 507, 7, 99, 2, 2,
507, 508, 7, 110, 2, 2, 508, 509, 7, 117, 2, 2, 509, 521, 7, 103, 2, 2,
510, 511, 7, 72, 2, 2, 511, 512, 7, 99, 2, 2, 512, 513, 7, 110, 2, 2, 513,
514, 7, 117, 2, 2, 514, 521, 7, 103, 2, 2, 515, 516, 7, 72, 2, 2, 516,
517, 7, 67, 2, 2, 517, 518, 7, 78, 2, 2, 518, 519, 7, 85, 2, 2, 519, 521,
7, 71, 2, 2, 520, 493, 3, 2, 2, 2, 520, 497, 3, 2, 2, 2, 520, 501, 3, 2,
2, 2, 520, 505, 3, 2, 2, 2, 520, 510, 3, 2, 2, 2, 520, 515, 3, 2, 2, 2,
521, 80, 3, 2, 2, 2, 522, 527, 5, 107, 54, 2, 523, 527, 5, 109, 55, 2,
524, 527, 5, 111, 56, 2, 525, 527, 5, 105, 53, 2, 526, 522, 3, 2, 2, 2,
526, 523, 3, 2, 2, 2, 526, 524, 3, 2, 2, 2, 526, 525, 3, 2, 2, 2, 527,
82, 3, 2, 2, 2, 528, 531, 5, 123, 62, 2, 529, 531, 5, 125, 63, 2, 530,
528, 3, 2, 2, 2, 530, 529, 3, 2, 2, 2, 531, 84, 3, 2, 2, 2, 532, 537, 5,
101, 51, 2, 533, 536, 5, 101, 51, 2, 534, 536, 5, 103, 52, 2, 535, 533,
3, 2, 2, 2, 535, 534, 3, 2, 2, 2, 536, 539, 3, 2, 2, 2, 537, 535, 3, 2,
2, 2, 537, 538, 3, 2, 2, 2, 538, 546, 3, 2, 2, 2, 539, 537, 3, 2, 2, 2,
540, 541, 7, 38, 2, 2, 541, 542, 7, 111, 2, 2, 542, 543, 7, 103, 2, 2,
543, 544, 7, 118, 2, 2, 544, 546, 7, 99, 2, 2, 545, 532, 3, 2, 2, 2, 545,
540, 3, 2, 2, 2, 546, 86, 3, 2, 2, 2, 547, 549, 5, 91, 46, 2, 548, 547,
3, 2, 2, 2, 548, 549, 3, 2, 2, 2, 549, 560, 3, 2, 2, 2, 550, 552, 7, 36,
2, 2, 551, 553, 5, 93, 47, 2, 552, 551, 3, 2, 2, 2, 552, 553, 3, 2, 2,
2, 553, 554, 3, 2, 2, 2, 554, 561, 7, 36, 2, 2, 555, 557, 7, 41, 2, 2,
556, 558, 5, 95, 48, 2, 557, 556, 3, 2, 2, 2, 557, 558, 3, 2, 2, 2, 558,
559, 3, 2, 2, 2, 559, 561, 7, 41, 2, 2, 560, 550, 3, 2, 2, 2, 560, 555,
3, 2, 2, 2, 561, 88, 3, 2, 2, 2, 562, 570, 5, 85, 43, 2, 563, 566, 7, 93,
2, 2, 564, 567, 5, 87, 44, 2, 565, 567, 5, 107, 54, 2, 566, 564, 3, 2,
2, 2, 566, 565, 3, 2, 2, 2, 567, 568, 3, 2, 2, 2, 568, 569, 7, 95, 2, 2,
569, 571, 3, 2, 2, 2, 570, 563, 3, 2, 2, 2, 571, 572, 3, 2, 2, 2, 572,
570, 3, 2, 2, 2, 572, 573, 3, 2, 2, 2, 573, 90, 3, 2, 2, 2, 574, 575, 7,
119, 2, 2, 575, 578, 7, 58, 2, 2, 576, 578, 9, 2, 2, 2, 577, 574, 3, 2,
2, 2, 577, 576, 3, 2, 2, 2, 578, 92, 3, 2, 2, 2, 579, 581, 5, 97, 49, 2,
580, 579, 3, 2, 2, 2, 581, 582, 3, 2, 2, 2, 582, 580, 3, 2, 2, 2, 582,
583, 3, 2, 2, 2, 583, 94, 3, 2, 2, 2, 584, 586, 5, 99, 50, 2, 585, 584,
3, 2, 2, 2, 586, 587, 3, 2, 2, 2, 587, 585, 3, 2, 2, 2, 587, 588, 3, 2,
2, 2, 588, 96, 3, 2, 2, 2, 589, 597, 10, 3, 2, 2, 590, 597, 5, 139, 70,
2, 591, 592, 7, 94, 2, 2, 592, 597, 7, 12, 2, 2, 593, 594, 7, 94, 2, 2,
594, 595, 7, 15, 2, 2, 595, 597, 7, 12, 2, 2, 596, 589, 3, 2, 2, 2, 596,
590, 3, 2, 2, 2, 596, 591, 3, 2, 2, 2, 596, 593, 3, 2, 2, 2, 597, 98, 3,
2, 2, 2, 598, 606, 10, 4, 2, 2, 599, 606, 5, 139, 70, 2, 600, 601, 7, 94,
2, 2, 601, 606, 7, 12, 2, 2, 602, 603, 7, 94, 2, 2, 603, 604, 7, 15, 2,
2, 604, 606, 7, 12, 2, 2, 605, 598, 3, 2, 2, 2, 605, 599, 3, 2, 2, 2, 605,
600, 3, 2, 2, 2, 605, 602, 3, 2, 2, 2, 606, 100, 3, 2, 2, 2, 607, 608,
9, 5, 2, 2, 608, 102, 3, 2, 2, 2, 609, 610, 9, 6, 2, 2, 610, 104, 3, 2,
2, 2, 611, 612, 7, 50, 2, 2, 612, 614, 9, 7, 2, 2, 613, 615, 9, 8, 2, 2,
614, 613, 3, 2, 2, 2, 615, 616, 3, 2, 2, 2, 616, 614, 3, 2, 2, 2, 616,
617, 3, 2, 2, 2, 617, 106, 3, 2, 2, 2, 618, 622, 5, 113, 57, 2, 619, 621,
5, 103, 52, 2, 620, 619, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3,
2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 627, 3, 2, 2, 2, 624, 622, 3, 2, 2,
2, 625, 627, 7, 50, 2, 2, 626, 618, 3, 2, 2, 2, 626, 625, 3, 2, 2, 2, 627,
108, 3, 2, 2, 2, 628, 632, 7, 50, 2, 2, 629, 631, 5, 115, 58, 2, 630, 629,
3, 2, 2, 2, 631, 634, 3, 2, 2, 2, 632, 630, 3, 2, 2, 2, 632, 633, 3, 2,
2, 2, 633, 110, 3, 2, 2, 2, 634, 632, 3, 2, 2, 2, 635, 636, 7, 50, 2, 2,
636, 637, 9, 9, 2, 2, 637, 638, 5, 135, 68, 2, 638, 112, 3, 2, 2, 2, 639,
640, 9, 10, 2, 2, 640, 114, 3, 2, 2, 2, 641, 642, 9, 11, 2, 2, 642, 116,
3, 2, 2, 2, 643, 644, 9, 12, 2, 2, 644, 118, 3, 2, 2, 2, 645, 646, 5, 117,
59, 2, 646, 647, 5, 117, 59, 2, 647, 648, 5, 117, 59, 2, 648, 649, 5, 117,
59, 2, 649, 120, 3, 2, 2, 2, 650, 651, 7, 94, 2, 2, 651, 652, 7, 119, 2,
2, 652, 653, 3, 2, 2, 2, 653, 661, 5, 119, 60, 2, 654, 655, 7, 94, 2, 2,
655, 656, 7, 87, 2, 2, 656, 657, 3, 2, 2, 2, 657, 658, 5, 119, 60, 2, 658,
659, 5, 119, 60, 2, 659, 661, 3, 2, 2, 2, 660, 650, 3, 2, 2, 2, 660, 654,
3, 2, 2, 2, 661, 122, 3, 2, 2, 2, 662, 664, 5, 127, 64, 2, 663, 665, 5,
129, 65, 2, 664, 663, 3, 2, 2, 2, 664, 665, 3, 2, 2, 2, 665, 670, 3, 2,
2, 2, 666, 667, 5, 131, 66, 2, 667, 668, 5, 129, 65, 2, 668, 670, 3, 2,
2, 2, 669, 662, 3, 2, 2, 2, 669, 666, 3, 2, 2, 2, 670, 124, 3, 2, 2, 2,
671, 672, 7, 50, 2, 2, 672, 675, 9, 9, 2, 2, 673, 676, 5, 133, 67, 2, 674,
676, 5, 135, 68, 2, 675, 673, 3, 2, 2, 2, 675, 674, 3, 2, 2, 2, 676, 677,
3, 2, 2, 2, 677, 678, 5, 137, 69, 2, 678, 126, 3, 2, 2, 2, 679, 681, 5,
131, 66, 2, 680, 679, 3, 2, 2, 2, 680, 681, 3, 2, 2, 2, 681, 682, 3, 2,
2, 2, 682, 683, 7, 48, 2, 2, 683, 688, 5, 131, 66, 2, 684, 685, 5, 131,
66, 2, 685, 686, 7, 48, 2, 2, 686, 688, 3, 2, 2, 2, 687, 680, 3, 2, 2,
2, 687, 684, 3, 2, 2, 2, 688, 128, 3, 2, 2, 2, 689, 691, 9, 13, 2, 2, 690,
692, 9, 14, 2, 2, 691, 690, 3, 2, 2, 2, 691, 692, 3, 2, 2, 2, 692, 693,
3, 2, 2, 2, 693, 694, 5, 131, 66, 2, 694, 130, 3, 2, 2, 2, 695, 697, 5,
103, 52, 2, 696, 695, 3, 2, 2, 2, 697, 698, 3, 2, 2, 2, 698, 696, 3, 2,
2, 2, 698, 699, 3, 2, 2, 2, 699, 132, 3, 2, 2, 2, 700, 702, 5, 135, 68,
2, 701, 700, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 703, 3, 2, 2, 2, 703,
704, 7, 48, 2, 2, 704, 709, 5, 135, 68, 2, 705, 706, 5, 135, 68, 2, 706,
707, 7, 48, 2, 2, 707, 709, 3, 2, 2, 2, 708, 701, 3, 2, 2, 2, 708, 705,
3, 2, 2, 2, 709, 134, 3, 2, 2, 2, 710, 712, 5, 117, 59, 2, 711, 710, 3,
2, 2, 2, 712, 713, 3, 2, 2, 2, 713, 711, 3, 2, 2, 2, 713, 714, 3, 2, 2,
2, 714, 136, 3, 2, 2, 2, 715, 717, 9, 15, 2, 2, 716, 718, 9, 14, 2, 2,
717, 716, 3, 2, 2, 2, 717, 718, 3, 2, 2, 2, 718, 719, 3, 2, 2, 2, 719,
720, 5, 131, 66, 2, 720, 138, 3, 2, 2, 2, 721, 722, 7, 94, 2, 2, 722, 737,
9, 16, 2, 2, 723, 724, 7, 94, 2, 2, 724, 726, 5, 115, 58, 2, 725, 727,
5, 115, 58, 2, 726, 725, 3, 2, 2, 2, 726, 727, 3, 2, 2, 2, 727, 729, 3,
2, 2, 2, 728, 730, 5, 115, 58, 2, 729, 728, 3, 2, 2, 2, 729, 730, 3, 2,
2, 2, 730, 737, 3, 2, 2, 2, 731, 732, 7, 94, 2, 2, 732, 733, 7, 122, 2,
2, 733, 734, 3, 2, 2, 2, 734, 737, 5, 135, 68, 2, 735, 737, 5, 121, 61,
2, 736, 721, 3, 2, 2, 2, 736, 723, 3, 2, 2, 2, 736, 731, 3, 2, 2, 2, 736,
735, 3, 2, 2, 2, 737, 140, 3, 2, 2, 2, 738, 740, 9, 17, 2, 2, 739, 738,
3, 2, 2, 2, 740, 741, 3, 2, 2, 2, 741, 739, 3, 2, 2, 2, 741, 742, 3, 2,
2, 2, 742, 743, 3, 2, 2, 2, 743, 744, 8, 71, 2, 2, 744, 142, 3, 2, 2, 2,
745, 747, 7, 15, 2, 2, 746, 748, 7, 12, 2, 2, 747, 746, 3, 2, 2, 2, 747,
748, 3, 2, 2, 2, 748, 751, 3, 2, 2, 2, 749, 751, 7, 12, 2, 2, 750, 745,
3, 2, 2, 2, 750, 749, 3, 2, 2, 2, 751, 752, 3, 2, 2, 2, 752, 753, 8, 72,
2, 2, 753, 144, 3, 2, 2, 2, 56, 2, 179, 193, 225, 231, 239, 254, 256, 287,
323, 359, 389, 427, 465, 491, 520, 526, 530, 535, 537, 545, 548, 552, 557,
560, 566, 572, 577, 582, 587, 596, 605, 616, 622, 626, 632, 660, 664, 669,
675, 680, 687, 691, 698, 701, 708, 713, 717, 726, 729, 736, 741, 747, 750,
3, 8, 2, 2,
}
var lexerChannelNames = []string{
@ -316,7 +377,8 @@ var lexerSymbolicNames = []string{
"", "", "", "", "", "", "LT", "LE", "GT", "GE", "EQ", "NE", "LIKE", "EXISTS",
"ADD", "SUB", "MUL", "DIV", "MOD", "POW", "SHL", "SHR", "BAND", "BOR",
"BXOR", "AND", "OR", "BNOT", "NOT", "IN", "NIN", "EmptyTerm", "JSONContains",
"JSONContainsAll", "JSONContainsAny", "BooleanConstant", "IntegerConstant",
"JSONContainsAll", "JSONContainsAny", "ArrayContains", "ArrayContainsAll",
"ArrayContainsAny", "ArrayLength", "BooleanConstant", "IntegerConstant",
"FloatingConstant", "Identifier", "StringLiteral", "JSONIdentifier", "Whitespace",
"Newline",
}
@ -325,7 +387,8 @@ var lexerRuleNames = []string{
"T__0", "T__1", "T__2", "T__3", "T__4", "LT", "LE", "GT", "GE", "EQ", "NE",
"LIKE", "EXISTS", "ADD", "SUB", "MUL", "DIV", "MOD", "POW", "SHL", "SHR",
"BAND", "BOR", "BXOR", "AND", "OR", "BNOT", "NOT", "IN", "NIN", "EmptyTerm",
"JSONContains", "JSONContainsAll", "JSONContainsAny", "BooleanConstant",
"JSONContains", "JSONContainsAll", "JSONContainsAny", "ArrayContains",
"ArrayContainsAll", "ArrayContainsAny", "ArrayLength", "BooleanConstant",
"IntegerConstant", "FloatingConstant", "Identifier", "StringLiteral", "JSONIdentifier",
"EncodingPrefix", "DoubleSCharSequence", "SingleSCharSequence", "DoubleSChar",
"SingleSChar", "Nondigit", "Digit", "BinaryConstant", "DecimalConstant",
@ -407,12 +470,16 @@ const (
PlanLexerJSONContains = 32
PlanLexerJSONContainsAll = 33
PlanLexerJSONContainsAny = 34
PlanLexerBooleanConstant = 35
PlanLexerIntegerConstant = 36
PlanLexerFloatingConstant = 37
PlanLexerIdentifier = 38
PlanLexerStringLiteral = 39
PlanLexerJSONIdentifier = 40
PlanLexerWhitespace = 41
PlanLexerNewline = 42
PlanLexerArrayContains = 35
PlanLexerArrayContainsAll = 36
PlanLexerArrayContainsAny = 37
PlanLexerArrayLength = 38
PlanLexerBooleanConstant = 39
PlanLexerIntegerConstant = 40
PlanLexerFloatingConstant = 41
PlanLexerIdentifier = 42
PlanLexerStringLiteral = 43
PlanLexerJSONIdentifier = 44
PlanLexerWhitespace = 45
PlanLexerNewline = 46
)

View File

@ -15,66 +15,69 @@ var _ = reflect.Copy
var _ = strconv.Itoa
var parserATN = []uint16{
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 44, 127,
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 48, 131,
4, 2, 9, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2,
3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 20, 10, 2, 12, 2, 14, 2, 23, 11, 2,
3, 2, 5, 2, 26, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2,
3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2,
3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 55, 10, 2, 3, 2, 3, 2,
3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2,
59, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2,
3, 2, 3, 2, 3, 2, 3, 2, 3, 2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 2, 27,
28, 7, 7, 2, 2, 28, 55, 3, 2, 2, 2, 29, 30, 9, 2, 2, 2, 30, 55, 5, 2, 2,
21, 31, 32, 7, 34, 2, 2, 32, 33, 7, 3, 2, 2, 33, 34, 5, 2, 2, 2, 34, 35,
7, 6, 2, 2, 35, 36, 5, 2, 2, 2, 36, 37, 7, 4, 2, 2, 37, 55, 3, 2, 2, 2,
38, 39, 7, 35, 2, 2, 39, 40, 7, 3, 2, 2, 40, 41, 5, 2, 2, 2, 41, 42, 7,
6, 2, 2, 42, 43, 5, 2, 2, 2, 43, 44, 7, 4, 2, 2, 44, 55, 3, 2, 2, 2, 45,
46, 7, 36, 2, 2, 46, 47, 7, 3, 2, 2, 47, 48, 5, 2, 2, 2, 48, 49, 7, 6,
2, 2, 49, 50, 5, 2, 2, 2, 50, 51, 7, 4, 2, 2, 51, 55, 3, 2, 2, 2, 52, 53,
7, 15, 2, 2, 53, 55, 5, 2, 2, 3, 54, 4, 3, 2, 2, 2, 54, 6, 3, 2, 2, 2,
54, 7, 3, 2, 2, 2, 54, 8, 3, 2, 2, 2, 54, 9, 3, 2, 2, 2, 54, 10, 3, 2,
2, 2, 54, 11, 3, 2, 2, 2, 54, 15, 3, 2, 2, 2, 54, 29, 3, 2, 2, 2, 54, 31,
3, 2, 2, 2, 54, 38, 3, 2, 2, 2, 54, 45, 3, 2, 2, 2, 54, 52, 3, 2, 2, 2,
55, 123, 3, 2, 2, 2, 56, 57, 12, 22, 2, 2, 57, 58, 7, 21, 2, 2, 58, 122,
5, 2, 2, 23, 59, 60, 12, 20, 2, 2, 60, 61, 9, 3, 2, 2, 61, 122, 5, 2, 2,
21, 62, 63, 12, 19, 2, 2, 63, 64, 9, 4, 2, 2, 64, 122, 5, 2, 2, 20, 65,
66, 12, 18, 2, 2, 66, 67, 9, 5, 2, 2, 67, 122, 5, 2, 2, 19, 68, 69, 12,
12, 2, 2, 69, 70, 9, 6, 2, 2, 70, 71, 9, 7, 2, 2, 71, 72, 9, 6, 2, 2, 72,
122, 5, 2, 2, 13, 73, 74, 12, 11, 2, 2, 74, 75, 9, 8, 2, 2, 75, 76, 9,
7, 2, 2, 76, 77, 9, 8, 2, 2, 77, 122, 5, 2, 2, 12, 78, 79, 12, 10, 2, 2,
79, 80, 9, 9, 2, 2, 80, 122, 5, 2, 2, 11, 81, 82, 12, 9, 2, 2, 82, 83,
9, 10, 2, 2, 83, 122, 5, 2, 2, 10, 84, 85, 12, 8, 2, 2, 85, 86, 7, 24,
2, 2, 86, 122, 5, 2, 2, 9, 87, 88, 12, 7, 2, 2, 88, 89, 7, 26, 2, 2, 89,
122, 5, 2, 2, 8, 90, 91, 12, 6, 2, 2, 91, 92, 7, 25, 2, 2, 92, 122, 5,
2, 2, 7, 93, 94, 12, 5, 2, 2, 94, 95, 7, 27, 2, 2, 95, 122, 5, 2, 2, 6,
96, 97, 12, 4, 2, 2, 97, 98, 7, 28, 2, 2, 98, 122, 5, 2, 2, 5, 99, 100,
12, 23, 2, 2, 100, 101, 7, 14, 2, 2, 101, 122, 7, 41, 2, 2, 102, 103, 12,
17, 2, 2, 103, 104, 9, 11, 2, 2, 104, 105, 7, 5, 2, 2, 105, 110, 5, 2,
2, 2, 106, 107, 7, 6, 2, 2, 107, 109, 5, 2, 2, 2, 108, 106, 3, 2, 2, 2,
109, 112, 3, 2, 2, 2, 110, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111,
114, 3, 2, 2, 2, 112, 110, 3, 2, 2, 2, 113, 115, 7, 6, 2, 2, 114, 113,
3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 116, 3, 2, 2, 2, 116, 117, 7, 7,
2, 2, 117, 122, 3, 2, 2, 2, 118, 119, 12, 16, 2, 2, 119, 120, 9, 11, 2,
2, 120, 122, 7, 33, 2, 2, 121, 56, 3, 2, 2, 2, 121, 59, 3, 2, 2, 2, 121,
62, 3, 2, 2, 2, 121, 65, 3, 2, 2, 2, 121, 68, 3, 2, 2, 2, 121, 73, 3, 2,
2, 2, 121, 78, 3, 2, 2, 2, 121, 81, 3, 2, 2, 2, 121, 84, 3, 2, 2, 2, 121,
87, 3, 2, 2, 2, 121, 90, 3, 2, 2, 2, 121, 93, 3, 2, 2, 2, 121, 96, 3, 2,
2, 2, 121, 99, 3, 2, 2, 2, 121, 102, 3, 2, 2, 2, 121, 118, 3, 2, 2, 2,
122, 125, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 124, 3, 2, 2, 2, 124,
3, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 9, 21, 25, 54, 110, 114, 121, 123,
3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 113, 10, 2, 12, 2, 14, 2, 116,
11, 2, 3, 2, 5, 2, 119, 10, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 126,
10, 2, 12, 2, 14, 2, 129, 11, 2, 3, 2, 2, 3, 2, 3, 2, 2, 15, 4, 2, 16,
17, 29, 30, 4, 2, 34, 34, 37, 37, 4, 2, 35, 35, 38, 38, 4, 2, 36, 36, 39,
39, 4, 2, 44, 44, 46, 46, 3, 2, 18, 20, 3, 2, 16, 17, 3, 2, 22, 23, 3,
2, 8, 9, 3, 2, 10, 11, 3, 2, 8, 11, 3, 2, 12, 13, 3, 2, 31, 32, 2, 162,
2, 58, 3, 2, 2, 2, 4, 5, 8, 2, 1, 2, 5, 59, 7, 42, 2, 2, 6, 59, 7, 43,
2, 2, 7, 59, 7, 41, 2, 2, 8, 59, 7, 45, 2, 2, 9, 59, 7, 44, 2, 2, 10, 59,
7, 46, 2, 2, 11, 12, 7, 3, 2, 2, 12, 13, 5, 2, 2, 2, 13, 14, 7, 4, 2, 2,
14, 59, 3, 2, 2, 2, 15, 16, 7, 5, 2, 2, 16, 21, 5, 2, 2, 2, 17, 18, 7,
6, 2, 2, 18, 20, 5, 2, 2, 2, 19, 17, 3, 2, 2, 2, 20, 23, 3, 2, 2, 2, 21,
19, 3, 2, 2, 2, 21, 22, 3, 2, 2, 2, 22, 25, 3, 2, 2, 2, 23, 21, 3, 2, 2,
2, 24, 26, 7, 6, 2, 2, 25, 24, 3, 2, 2, 2, 25, 26, 3, 2, 2, 2, 26, 27,
3, 2, 2, 2, 27, 28, 7, 7, 2, 2, 28, 59, 3, 2, 2, 2, 29, 30, 9, 2, 2, 2,
30, 59, 5, 2, 2, 22, 31, 32, 9, 3, 2, 2, 32, 33, 7, 3, 2, 2, 33, 34, 5,
2, 2, 2, 34, 35, 7, 6, 2, 2, 35, 36, 5, 2, 2, 2, 36, 37, 7, 4, 2, 2, 37,
59, 3, 2, 2, 2, 38, 39, 9, 4, 2, 2, 39, 40, 7, 3, 2, 2, 40, 41, 5, 2, 2,
2, 41, 42, 7, 6, 2, 2, 42, 43, 5, 2, 2, 2, 43, 44, 7, 4, 2, 2, 44, 59,
3, 2, 2, 2, 45, 46, 9, 5, 2, 2, 46, 47, 7, 3, 2, 2, 47, 48, 5, 2, 2, 2,
48, 49, 7, 6, 2, 2, 49, 50, 5, 2, 2, 2, 50, 51, 7, 4, 2, 2, 51, 59, 3,
2, 2, 2, 52, 53, 7, 40, 2, 2, 53, 54, 7, 3, 2, 2, 54, 55, 9, 6, 2, 2, 55,
59, 7, 4, 2, 2, 56, 57, 7, 15, 2, 2, 57, 59, 5, 2, 2, 3, 58, 4, 3, 2, 2,
2, 58, 6, 3, 2, 2, 2, 58, 7, 3, 2, 2, 2, 58, 8, 3, 2, 2, 2, 58, 9, 3, 2,
2, 2, 58, 10, 3, 2, 2, 2, 58, 11, 3, 2, 2, 2, 58, 15, 3, 2, 2, 2, 58, 29,
3, 2, 2, 2, 58, 31, 3, 2, 2, 2, 58, 38, 3, 2, 2, 2, 58, 45, 3, 2, 2, 2,
58, 52, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 59, 127, 3, 2, 2, 2, 60, 61, 12,
23, 2, 2, 61, 62, 7, 21, 2, 2, 62, 126, 5, 2, 2, 24, 63, 64, 12, 21, 2,
2, 64, 65, 9, 7, 2, 2, 65, 126, 5, 2, 2, 22, 66, 67, 12, 20, 2, 2, 67,
68, 9, 8, 2, 2, 68, 126, 5, 2, 2, 21, 69, 70, 12, 19, 2, 2, 70, 71, 9,
9, 2, 2, 71, 126, 5, 2, 2, 20, 72, 73, 12, 12, 2, 2, 73, 74, 9, 10, 2,
2, 74, 75, 9, 6, 2, 2, 75, 76, 9, 10, 2, 2, 76, 126, 5, 2, 2, 13, 77, 78,
12, 11, 2, 2, 78, 79, 9, 11, 2, 2, 79, 80, 9, 6, 2, 2, 80, 81, 9, 11, 2,
2, 81, 126, 5, 2, 2, 12, 82, 83, 12, 10, 2, 2, 83, 84, 9, 12, 2, 2, 84,
126, 5, 2, 2, 11, 85, 86, 12, 9, 2, 2, 86, 87, 9, 13, 2, 2, 87, 126, 5,
2, 2, 10, 88, 89, 12, 8, 2, 2, 89, 90, 7, 24, 2, 2, 90, 126, 5, 2, 2, 9,
91, 92, 12, 7, 2, 2, 92, 93, 7, 26, 2, 2, 93, 126, 5, 2, 2, 8, 94, 95,
12, 6, 2, 2, 95, 96, 7, 25, 2, 2, 96, 126, 5, 2, 2, 7, 97, 98, 12, 5, 2,
2, 98, 99, 7, 27, 2, 2, 99, 126, 5, 2, 2, 6, 100, 101, 12, 4, 2, 2, 101,
102, 7, 28, 2, 2, 102, 126, 5, 2, 2, 5, 103, 104, 12, 24, 2, 2, 104, 105,
7, 14, 2, 2, 105, 126, 7, 45, 2, 2, 106, 107, 12, 18, 2, 2, 107, 108, 9,
14, 2, 2, 108, 109, 7, 5, 2, 2, 109, 114, 5, 2, 2, 2, 110, 111, 7, 6, 2,
2, 111, 113, 5, 2, 2, 2, 112, 110, 3, 2, 2, 2, 113, 116, 3, 2, 2, 2, 114,
112, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 118, 3, 2, 2, 2, 116, 114,
3, 2, 2, 2, 117, 119, 7, 6, 2, 2, 118, 117, 3, 2, 2, 2, 118, 119, 3, 2,
2, 2, 119, 120, 3, 2, 2, 2, 120, 121, 7, 7, 2, 2, 121, 126, 3, 2, 2, 2,
122, 123, 12, 17, 2, 2, 123, 124, 9, 14, 2, 2, 124, 126, 7, 33, 2, 2, 125,
60, 3, 2, 2, 2, 125, 63, 3, 2, 2, 2, 125, 66, 3, 2, 2, 2, 125, 69, 3, 2,
2, 2, 125, 72, 3, 2, 2, 2, 125, 77, 3, 2, 2, 2, 125, 82, 3, 2, 2, 2, 125,
85, 3, 2, 2, 2, 125, 88, 3, 2, 2, 2, 125, 91, 3, 2, 2, 2, 125, 94, 3, 2,
2, 2, 125, 97, 3, 2, 2, 2, 125, 100, 3, 2, 2, 2, 125, 103, 3, 2, 2, 2,
125, 106, 3, 2, 2, 2, 125, 122, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127,
125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 3, 3, 2, 2, 2, 129, 127, 3,
2, 2, 2, 9, 21, 25, 58, 114, 118, 125, 127,
}
var literalNames = []string{
"", "'('", "')'", "'['", "','", "']'", "'<'", "'<='", "'>'", "'>='", "'=='",
@ -85,7 +88,8 @@ var symbolicNames = []string{
"", "", "", "", "", "", "LT", "LE", "GT", "GE", "EQ", "NE", "LIKE", "EXISTS",
"ADD", "SUB", "MUL", "DIV", "MOD", "POW", "SHL", "SHR", "BAND", "BOR",
"BXOR", "AND", "OR", "BNOT", "NOT", "IN", "NIN", "EmptyTerm", "JSONContains",
"JSONContainsAll", "JSONContainsAny", "BooleanConstant", "IntegerConstant",
"JSONContainsAll", "JSONContainsAny", "ArrayContains", "ArrayContainsAll",
"ArrayContainsAny", "ArrayLength", "BooleanConstant", "IntegerConstant",
"FloatingConstant", "Identifier", "StringLiteral", "JSONIdentifier", "Whitespace",
"Newline",
}
@ -160,14 +164,18 @@ const (
PlanParserJSONContains = 32
PlanParserJSONContainsAll = 33
PlanParserJSONContainsAny = 34
PlanParserBooleanConstant = 35
PlanParserIntegerConstant = 36
PlanParserFloatingConstant = 37
PlanParserIdentifier = 38
PlanParserStringLiteral = 39
PlanParserJSONIdentifier = 40
PlanParserWhitespace = 41
PlanParserNewline = 42
PlanParserArrayContains = 35
PlanParserArrayContainsAll = 36
PlanParserArrayContainsAny = 37
PlanParserArrayLength = 38
PlanParserBooleanConstant = 39
PlanParserIntegerConstant = 40
PlanParserFloatingConstant = 41
PlanParserIdentifier = 42
PlanParserStringLiteral = 43
PlanParserJSONIdentifier = 44
PlanParserWhitespace = 45
PlanParserNewline = 46
)
// PlanParserRULE_expr is the PlanParser rule.
@ -375,10 +383,6 @@ func (s *JSONContainsAllContext) GetRuleContext() antlr.RuleContext {
return s
}
func (s *JSONContainsAllContext) JSONContainsAll() antlr.TerminalNode {
return s.GetToken(PlanParserJSONContainsAll, 0)
}
func (s *JSONContainsAllContext) AllExpr() []IExprContext {
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem())
var tst = make([]IExprContext, len(ts))
@ -402,6 +406,14 @@ func (s *JSONContainsAllContext) Expr(i int) IExprContext {
return t.(IExprContext)
}
func (s *JSONContainsAllContext) JSONContainsAll() antlr.TerminalNode {
return s.GetToken(PlanParserJSONContainsAll, 0)
}
func (s *JSONContainsAllContext) ArrayContainsAll() antlr.TerminalNode {
return s.GetToken(PlanParserArrayContainsAll, 0)
}
func (s *JSONContainsAllContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case PlanVisitor:
@ -1104,6 +1116,46 @@ func (s *RelationalContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
type ArrayLengthContext struct {
*ExprContext
}
func NewArrayLengthContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArrayLengthContext {
var p = new(ArrayLengthContext)
p.ExprContext = NewEmptyExprContext()
p.parser = parser
p.CopyFrom(ctx.(*ExprContext))
return p
}
func (s *ArrayLengthContext) GetRuleContext() antlr.RuleContext {
return s
}
func (s *ArrayLengthContext) ArrayLength() antlr.TerminalNode {
return s.GetToken(PlanParserArrayLength, 0)
}
func (s *ArrayLengthContext) Identifier() antlr.TerminalNode {
return s.GetToken(PlanParserIdentifier, 0)
}
func (s *ArrayLengthContext) JSONIdentifier() antlr.TerminalNode {
return s.GetToken(PlanParserJSONIdentifier, 0)
}
func (s *ArrayLengthContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case PlanVisitor:
return t.VisitArrayLength(s)
default:
return t.VisitChildren(s)
}
}
type TermContext struct {
*ExprContext
op antlr.Token
@ -1186,10 +1238,6 @@ func (s *JSONContainsContext) GetRuleContext() antlr.RuleContext {
return s
}
func (s *JSONContainsContext) JSONContains() antlr.TerminalNode {
return s.GetToken(PlanParserJSONContains, 0)
}
func (s *JSONContainsContext) AllExpr() []IExprContext {
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem())
var tst = make([]IExprContext, len(ts))
@ -1213,6 +1261,14 @@ func (s *JSONContainsContext) Expr(i int) IExprContext {
return t.(IExprContext)
}
func (s *JSONContainsContext) JSONContains() antlr.TerminalNode {
return s.GetToken(PlanParserJSONContains, 0)
}
func (s *JSONContainsContext) ArrayContains() antlr.TerminalNode {
return s.GetToken(PlanParserArrayContains, 0)
}
func (s *JSONContainsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case PlanVisitor:
@ -1468,10 +1524,6 @@ func (s *JSONContainsAnyContext) GetRuleContext() antlr.RuleContext {
return s
}
func (s *JSONContainsAnyContext) JSONContainsAny() antlr.TerminalNode {
return s.GetToken(PlanParserJSONContainsAny, 0)
}
func (s *JSONContainsAnyContext) AllExpr() []IExprContext {
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExprContext)(nil)).Elem())
var tst = make([]IExprContext, len(ts))
@ -1495,6 +1547,14 @@ func (s *JSONContainsAnyContext) Expr(i int) IExprContext {
return t.(IExprContext)
}
func (s *JSONContainsAnyContext) JSONContainsAny() antlr.TerminalNode {
return s.GetToken(PlanParserJSONContainsAny, 0)
}
func (s *JSONContainsAnyContext) ArrayContainsAny() antlr.TerminalNode {
return s.GetToken(PlanParserArrayContainsAny, 0)
}
func (s *JSONContainsAnyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) {
case PlanVisitor:
@ -1800,7 +1860,7 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
var _alt int
p.EnterOuterAlt(localctx, 1)
p.SetState(52)
p.SetState(56)
p.GetErrorHandler().Sync(p)
switch p.GetTokenStream().LA(1) {
@ -1948,16 +2008,23 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
{
p.SetState(28)
p.expr(19)
p.expr(20)
}
case PlanParserJSONContains:
case PlanParserJSONContains, PlanParserArrayContains:
localctx = NewJSONContainsContext(p, localctx)
p.SetParserRuleContext(localctx)
_prevctx = localctx
{
p.SetState(29)
p.Match(PlanParserJSONContains)
_la = p.GetTokenStream().LA(1)
if !(_la == PlanParserJSONContains || _la == PlanParserArrayContains) {
p.GetErrorHandler().RecoverInline(p)
} else {
p.GetErrorHandler().ReportMatch(p)
p.Consume()
}
}
{
p.SetState(30)
@ -1980,13 +2047,20 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
p.Match(PlanParserT__1)
}
case PlanParserJSONContainsAll:
case PlanParserJSONContainsAll, PlanParserArrayContainsAll:
localctx = NewJSONContainsAllContext(p, localctx)
p.SetParserRuleContext(localctx)
_prevctx = localctx
{
p.SetState(36)
p.Match(PlanParserJSONContainsAll)
_la = p.GetTokenStream().LA(1)
if !(_la == PlanParserJSONContainsAll || _la == PlanParserArrayContainsAll) {
p.GetErrorHandler().RecoverInline(p)
} else {
p.GetErrorHandler().ReportMatch(p)
p.Consume()
}
}
{
p.SetState(37)
@ -2009,13 +2083,20 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
p.Match(PlanParserT__1)
}
case PlanParserJSONContainsAny:
case PlanParserJSONContainsAny, PlanParserArrayContainsAny:
localctx = NewJSONContainsAnyContext(p, localctx)
p.SetParserRuleContext(localctx)
_prevctx = localctx
{
p.SetState(43)
p.Match(PlanParserJSONContainsAny)
_la = p.GetTokenStream().LA(1)
if !(_la == PlanParserJSONContainsAny || _la == PlanParserArrayContainsAny) {
p.GetErrorHandler().RecoverInline(p)
} else {
p.GetErrorHandler().ReportMatch(p)
p.Consume()
}
}
{
p.SetState(44)
@ -2038,16 +2119,44 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
p.Match(PlanParserT__1)
}
case PlanParserArrayLength:
localctx = NewArrayLengthContext(p, localctx)
p.SetParserRuleContext(localctx)
_prevctx = localctx
{
p.SetState(50)
p.Match(PlanParserArrayLength)
}
{
p.SetState(51)
p.Match(PlanParserT__0)
}
{
p.SetState(52)
_la = p.GetTokenStream().LA(1)
if !(_la == PlanParserIdentifier || _la == PlanParserJSONIdentifier) {
p.GetErrorHandler().RecoverInline(p)
} else {
p.GetErrorHandler().ReportMatch(p)
p.Consume()
}
}
{
p.SetState(53)
p.Match(PlanParserT__1)
}
case PlanParserEXISTS:
localctx = NewExistsContext(p, localctx)
p.SetParserRuleContext(localctx)
_prevctx = localctx
{
p.SetState(50)
p.SetState(54)
p.Match(PlanParserEXISTS)
}
{
p.SetState(51)
p.SetState(55)
p.expr(1)
}
@ -2055,7 +2164,7 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
}
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
p.SetState(121)
p.SetState(125)
p.GetErrorHandler().Sync(p)
_alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 6, p.GetParserRuleContext())
@ -2065,36 +2174,36 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
p.TriggerExitRuleEvent()
}
_prevctx = localctx
p.SetState(119)
p.SetState(123)
p.GetErrorHandler().Sync(p)
switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 5, p.GetParserRuleContext()) {
case 1:
localctx = NewPowerContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(54)
p.SetState(58)
if !(p.Precpred(p.GetParserRuleContext(), 20)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 20)", ""))
if !(p.Precpred(p.GetParserRuleContext(), 21)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 21)", ""))
}
{
p.SetState(55)
p.SetState(59)
p.Match(PlanParserPOW)
}
{
p.SetState(56)
p.expr(21)
p.SetState(60)
p.expr(22)
}
case 2:
localctx = NewMulDivModContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(57)
p.SetState(61)
if !(p.Precpred(p.GetParserRuleContext(), 18)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 18)", ""))
if !(p.Precpred(p.GetParserRuleContext(), 19)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 19)", ""))
}
{
p.SetState(58)
p.SetState(62)
var _lt = p.GetTokenStream().LT(1)
@ -2112,20 +2221,20 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(59)
p.expr(19)
p.SetState(63)
p.expr(20)
}
case 3:
localctx = NewAddSubContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(60)
p.SetState(64)
if !(p.Precpred(p.GetParserRuleContext(), 17)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 17)", ""))
if !(p.Precpred(p.GetParserRuleContext(), 18)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 18)", ""))
}
{
p.SetState(61)
p.SetState(65)
var _lt = p.GetTokenStream().LT(1)
@ -2143,20 +2252,20 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(62)
p.expr(18)
p.SetState(66)
p.expr(19)
}
case 4:
localctx = NewShiftContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(63)
p.SetState(67)
if !(p.Precpred(p.GetParserRuleContext(), 16)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 16)", ""))
if !(p.Precpred(p.GetParserRuleContext(), 17)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 17)", ""))
}
{
p.SetState(64)
p.SetState(68)
var _lt = p.GetTokenStream().LT(1)
@ -2174,20 +2283,20 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(65)
p.expr(17)
p.SetState(69)
p.expr(18)
}
case 5:
localctx = NewRangeContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(66)
p.SetState(70)
if !(p.Precpred(p.GetParserRuleContext(), 10)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 10)", ""))
}
{
p.SetState(67)
p.SetState(71)
var _lt = p.GetTokenStream().LT(1)
@ -2205,7 +2314,7 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(68)
p.SetState(72)
_la = p.GetTokenStream().LA(1)
if !(_la == PlanParserIdentifier || _la == PlanParserJSONIdentifier) {
@ -2216,7 +2325,7 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(69)
p.SetState(73)
var _lt = p.GetTokenStream().LT(1)
@ -2234,20 +2343,20 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(70)
p.SetState(74)
p.expr(11)
}
case 6:
localctx = NewReverseRangeContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(71)
p.SetState(75)
if !(p.Precpred(p.GetParserRuleContext(), 9)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 9)", ""))
}
{
p.SetState(72)
p.SetState(76)
var _lt = p.GetTokenStream().LT(1)
@ -2265,7 +2374,7 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(73)
p.SetState(77)
_la = p.GetTokenStream().LA(1)
if !(_la == PlanParserIdentifier || _la == PlanParserJSONIdentifier) {
@ -2276,7 +2385,7 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(74)
p.SetState(78)
var _lt = p.GetTokenStream().LT(1)
@ -2294,20 +2403,20 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(75)
p.SetState(79)
p.expr(10)
}
case 7:
localctx = NewRelationalContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(76)
p.SetState(80)
if !(p.Precpred(p.GetParserRuleContext(), 8)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 8)", ""))
}
{
p.SetState(77)
p.SetState(81)
var _lt = p.GetTokenStream().LT(1)
@ -2325,20 +2434,20 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(78)
p.SetState(82)
p.expr(9)
}
case 8:
localctx = NewEqualityContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(79)
p.SetState(83)
if !(p.Precpred(p.GetParserRuleContext(), 7)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 7)", ""))
}
{
p.SetState(80)
p.SetState(84)
var _lt = p.GetTokenStream().LT(1)
@ -2356,122 +2465,122 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(81)
p.SetState(85)
p.expr(8)
}
case 9:
localctx = NewBitAndContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(82)
p.SetState(86)
if !(p.Precpred(p.GetParserRuleContext(), 6)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", ""))
}
{
p.SetState(83)
p.SetState(87)
p.Match(PlanParserBAND)
}
{
p.SetState(84)
p.SetState(88)
p.expr(7)
}
case 10:
localctx = NewBitXorContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(85)
p.SetState(89)
if !(p.Precpred(p.GetParserRuleContext(), 5)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", ""))
}
{
p.SetState(86)
p.SetState(90)
p.Match(PlanParserBXOR)
}
{
p.SetState(87)
p.SetState(91)
p.expr(6)
}
case 11:
localctx = NewBitOrContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(88)
p.SetState(92)
if !(p.Precpred(p.GetParserRuleContext(), 4)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", ""))
}
{
p.SetState(89)
p.SetState(93)
p.Match(PlanParserBOR)
}
{
p.SetState(90)
p.SetState(94)
p.expr(5)
}
case 12:
localctx = NewLogicalAndContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(91)
p.SetState(95)
if !(p.Precpred(p.GetParserRuleContext(), 3)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", ""))
}
{
p.SetState(92)
p.SetState(96)
p.Match(PlanParserAND)
}
{
p.SetState(93)
p.SetState(97)
p.expr(4)
}
case 13:
localctx = NewLogicalOrContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(94)
p.SetState(98)
if !(p.Precpred(p.GetParserRuleContext(), 2)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
}
{
p.SetState(95)
p.SetState(99)
p.Match(PlanParserOR)
}
{
p.SetState(96)
p.SetState(100)
p.expr(3)
}
case 14:
localctx = NewLikeContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(97)
p.SetState(101)
if !(p.Precpred(p.GetParserRuleContext(), 21)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 21)", ""))
if !(p.Precpred(p.GetParserRuleContext(), 22)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 22)", ""))
}
{
p.SetState(98)
p.SetState(102)
p.Match(PlanParserLIKE)
}
{
p.SetState(99)
p.SetState(103)
p.Match(PlanParserStringLiteral)
}
case 15:
localctx = NewTermContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(100)
p.SetState(104)
if !(p.Precpred(p.GetParserRuleContext(), 15)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 15)", ""))
if !(p.Precpred(p.GetParserRuleContext(), 16)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 16)", ""))
}
{
p.SetState(101)
p.SetState(105)
var _lt = p.GetTokenStream().LT(1)
@ -2490,59 +2599,59 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
{
p.SetState(102)
p.SetState(106)
p.Match(PlanParserT__2)
}
{
p.SetState(103)
p.SetState(107)
p.expr(0)
}
p.SetState(108)
p.SetState(112)
p.GetErrorHandler().Sync(p)
_alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext())
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
p.SetState(104)
p.SetState(108)
p.Match(PlanParserT__3)
}
{
p.SetState(105)
p.SetState(109)
p.expr(0)
}
}
p.SetState(110)
p.SetState(114)
p.GetErrorHandler().Sync(p)
_alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext())
}
p.SetState(112)
p.SetState(116)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
if _la == PlanParserT__3 {
{
p.SetState(111)
p.SetState(115)
p.Match(PlanParserT__3)
}
}
{
p.SetState(114)
p.SetState(118)
p.Match(PlanParserT__4)
}
case 16:
localctx = NewEmptyTermContext(p, NewExprContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, PlanParserRULE_expr)
p.SetState(116)
p.SetState(120)
if !(p.Precpred(p.GetParserRuleContext(), 14)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 14)", ""))
if !(p.Precpred(p.GetParserRuleContext(), 15)) {
panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 15)", ""))
}
{
p.SetState(117)
p.SetState(121)
var _lt = p.GetTokenStream().LT(1)
@ -2560,14 +2669,14 @@ func (p *PlanParser) expr(_p int) (localctx IExprContext) {
}
}
{
p.SetState(118)
p.SetState(122)
p.Match(PlanParserEmptyTerm)
}
}
}
p.SetState(123)
p.SetState(127)
p.GetErrorHandler().Sync(p)
_alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 6, p.GetParserRuleContext())
}
@ -2592,16 +2701,16 @@ func (p *PlanParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex in
func (p *PlanParser) Expr_Sempred(localctx antlr.RuleContext, predIndex int) bool {
switch predIndex {
case 0:
return p.Precpred(p.GetParserRuleContext(), 20)
return p.Precpred(p.GetParserRuleContext(), 21)
case 1:
return p.Precpred(p.GetParserRuleContext(), 18)
return p.Precpred(p.GetParserRuleContext(), 19)
case 2:
return p.Precpred(p.GetParserRuleContext(), 17)
return p.Precpred(p.GetParserRuleContext(), 18)
case 3:
return p.Precpred(p.GetParserRuleContext(), 16)
return p.Precpred(p.GetParserRuleContext(), 17)
case 4:
return p.Precpred(p.GetParserRuleContext(), 10)
@ -2631,13 +2740,13 @@ func (p *PlanParser) Expr_Sempred(localctx antlr.RuleContext, predIndex int) boo
return p.Precpred(p.GetParserRuleContext(), 2)
case 13:
return p.Precpred(p.GetParserRuleContext(), 21)
return p.Precpred(p.GetParserRuleContext(), 22)
case 14:
return p.Precpred(p.GetParserRuleContext(), 15)
return p.Precpred(p.GetParserRuleContext(), 16)
case 15:
return p.Precpred(p.GetParserRuleContext(), 14)
return p.Precpred(p.GetParserRuleContext(), 15)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))

View File

@ -58,6 +58,9 @@ type PlanVisitor interface {
// Visit a parse tree produced by PlanParser#Relational.
VisitRelational(ctx *RelationalContext) interface{}
// Visit a parse tree produced by PlanParser#ArrayLength.
VisitArrayLength(ctx *ArrayLengthContext) interface{}
// Visit a parse tree produced by PlanParser#Term.
VisitTerm(ctx *TermContext) interface{}

View File

@ -49,6 +49,7 @@ func (v *ParserVisitor) translateIdentifier(identifier string) (*ExprWithType, e
IsAutoID: field.AutoID,
NestedPath: nestedPath,
IsPartitionKey: field.IsPartitionKey,
ElementType: field.GetElementType(),
},
},
},
@ -147,6 +148,13 @@ func (v *ParserVisitor) VisitString(ctx *parser.StringContext) interface{} {
}
}
func checkDirectComparisonBinaryField(columnInfo *planpb.ColumnInfo) error {
if typeutil.IsArrayType(columnInfo.GetDataType()) && len(columnInfo.GetNestedPath()) == 0 {
return fmt.Errorf("can not comparisons array fields directly")
}
return nil
}
// VisitAddSub translates expr to arithmetic plan.
func (v *ParserVisitor) VisitAddSub(ctx *parser.AddSubContext) interface{} {
left := ctx.Expr(0).Accept(v)
@ -191,12 +199,13 @@ func (v *ParserVisitor) VisitAddSub(ctx *parser.AddSubContext) interface{} {
return fmt.Errorf("invalid arithmetic expression, left: %s, op: %s, right: %s", ctx.Expr(0).GetText(), ctx.GetOp(), ctx.Expr(1).GetText())
}
if typeutil.IsArrayType(leftExpr.dataType) || typeutil.IsArrayType(rightExpr.dataType) {
return fmt.Errorf("invalid expression, array is not supported for AddSub")
if err := checkDirectComparisonBinaryField(toColumnInfo(leftExpr)); err != nil {
return err
}
if (!typeutil.IsArithmetic(leftExpr.dataType) && !typeutil.IsJSONType(leftExpr.dataType)) ||
(!typeutil.IsArithmetic(rightExpr.dataType) && !typeutil.IsJSONType(rightExpr.dataType)) {
if err := checkDirectComparisonBinaryField(toColumnInfo(rightExpr)); err != nil {
return err
}
if !canArithmetic(leftExpr, rightExpr) {
return fmt.Errorf("'%s' can only be used between integer or floating or json field expressions", arithNameMap[ctx.GetOp().GetTokenType()])
}
@ -274,19 +283,19 @@ func (v *ParserVisitor) VisitMulDivMod(ctx *parser.MulDivModContext) interface{}
return fmt.Errorf("invalid arithmetic expression, left: %s, op: %s, right: %s", ctx.Expr(0).GetText(), ctx.GetOp(), ctx.Expr(1).GetText())
}
if typeutil.IsArrayType(leftExpr.dataType) || typeutil.IsArrayType(rightExpr.dataType) {
return fmt.Errorf("invalid expression, array is not supported for MulDivMod")
if err := checkDirectComparisonBinaryField(toColumnInfo(leftExpr)); err != nil {
return err
}
if (!typeutil.IsArithmetic(leftExpr.dataType) && !typeutil.IsJSONType(leftExpr.dataType)) ||
(!typeutil.IsArithmetic(rightExpr.dataType) && !typeutil.IsJSONType(rightExpr.dataType)) {
return fmt.Errorf("'%s' can only be used between integer or floating expressions", arithNameMap[ctx.GetOp().GetTokenType()])
if err := checkDirectComparisonBinaryField(toColumnInfo(rightExpr)); err != nil {
return err
}
if !canArithmetic(leftExpr, rightExpr) {
return fmt.Errorf("'%s' can only be used between integer or floating or json field expressions", arithNameMap[ctx.GetOp().GetTokenType()])
}
switch ctx.GetOp().GetTokenType() {
case parser.PlanParserMOD:
if (!typeutil.IsIntegerType(leftExpr.dataType) && !typeutil.IsJSONType(leftExpr.dataType)) ||
(!typeutil.IsIntegerType(rightExpr.dataType) && !typeutil.IsJSONType(rightExpr.dataType)) {
if !isIntegerColumn(toColumnInfo(leftExpr)) && !isIntegerColumn(toColumnInfo(rightExpr)) {
return fmt.Errorf("modulo can only apply on integer types")
}
default:
@ -349,10 +358,6 @@ func (v *ParserVisitor) VisitEquality(ctx *parser.EqualityContext) interface{} {
rightExpr = getExpr(right)
}
if typeutil.IsArrayType(leftExpr.dataType) || typeutil.IsArrayType(rightExpr.dataType) {
return fmt.Errorf("invalid expression, array is not supported for Equality")
}
expr, err := HandleCompare(ctx.GetOp().GetTokenType(), leftExpr, rightExpr)
if err != nil {
return err
@ -405,9 +410,11 @@ func (v *ParserVisitor) VisitRelational(ctx *parser.RelationalContext) interface
} else {
rightExpr = getExpr(right)
}
if typeutil.IsArrayType(leftExpr.dataType) || typeutil.IsArrayType(rightExpr.dataType) {
return fmt.Errorf("invalid expression, array is not supported for Relational")
if err := checkDirectComparisonBinaryField(toColumnInfo(leftExpr)); err != nil {
return err
}
if err := checkDirectComparisonBinaryField(toColumnInfo(rightExpr)); err != nil {
return err
}
expr, err := HandleCompare(ctx.GetOp().GetTokenType(), leftExpr, rightExpr)
@ -433,14 +440,19 @@ func (v *ParserVisitor) VisitLike(ctx *parser.LikeContext) interface{} {
return fmt.Errorf("the left operand of like is invalid")
}
if !typeutil.IsStringType(leftExpr.dataType) && !typeutil.IsJSONType(leftExpr.dataType) {
return fmt.Errorf("like operation on non-string or no-json field is unsupported")
}
column := toColumnInfo(leftExpr)
if column == nil {
return fmt.Errorf("like operation on complicated expr is unsupported")
}
if err := checkDirectComparisonBinaryField(column); err != nil {
return err
}
if !typeutil.IsStringType(leftExpr.dataType) && !typeutil.IsJSONType(leftExpr.dataType) &&
!(typeutil.IsArrayType(leftExpr.dataType) && typeutil.IsStringType(column.GetElementType())) {
return fmt.Errorf("like operation on non-string or no-json field is unsupported")
}
pattern, err := convertEscapeSingle(ctx.StringLiteral().GetText())
if err != nil {
return err
@ -482,6 +494,10 @@ func (v *ParserVisitor) VisitTerm(ctx *parser.TermContext) interface{} {
return fmt.Errorf("'term' can only be used on single field, but got: %s", ctx.Expr(0).GetText())
}
dataType := columnInfo.GetDataType()
if typeutil.IsArrayType(dataType) && len(columnInfo.GetNestedPath()) != 0 {
dataType = columnInfo.GetElementType()
}
allExpr := ctx.AllExpr()
lenOfAllExpr := len(allExpr)
values := make([]*planpb.GenericValue, 0, lenOfAllExpr)
@ -494,9 +510,9 @@ func (v *ParserVisitor) VisitTerm(ctx *parser.TermContext) interface{} {
if n == nil {
return fmt.Errorf("value '%s' in list cannot be a non-const expression", ctx.Expr(i).GetText())
}
castedValue, err := castValue(childExpr.dataType, n)
castedValue, err := castValue(dataType, n)
if err != nil {
return fmt.Errorf("value '%s' in list cannot be casted to %s", ctx.Expr(i).GetText(), childExpr.dataType.String())
return fmt.Errorf("value '%s' in list cannot be casted to %s", ctx.Expr(i).GetText(), dataType.String())
}
values = append(values, castedValue)
}
@ -543,6 +559,9 @@ func (v *ParserVisitor) VisitEmptyTerm(ctx *parser.EmptyTermContext) interface{}
if columnInfo == nil {
return fmt.Errorf("'term' can only be used on single field, but got: %s", ctx.Expr().GetText())
}
if err := checkDirectComparisonBinaryField(columnInfo); err != nil {
return err
}
expr := &planpb.Expr{
Expr: &planpb.Expr_TermExpr{
@ -589,6 +608,9 @@ func (v *ParserVisitor) VisitRange(ctx *parser.RangeContext) interface{} {
if columnInfo == nil {
return fmt.Errorf("range operations are only supported on single fields now, got: %s", ctx.Expr(1).GetText())
}
if err := checkDirectComparisonBinaryField(columnInfo); err != nil {
return err
}
lower := ctx.Expr(0).Accept(v)
upper := ctx.Expr(1).Accept(v)
@ -608,7 +630,12 @@ func (v *ParserVisitor) VisitRange(ctx *parser.RangeContext) interface{} {
return fmt.Errorf("upperbound cannot be a non-const expression: %s", ctx.Expr(1).GetText())
}
switch columnInfo.GetDataType() {
fieldDataType := columnInfo.GetDataType()
if typeutil.IsArrayType(columnInfo.GetDataType()) {
fieldDataType = columnInfo.GetElementType()
}
switch fieldDataType {
case schemapb.DataType_String, schemapb.DataType_VarChar:
if !IsString(lowerValue) || !IsString(upperValue) {
return fmt.Errorf("invalid range operations")
@ -671,6 +698,10 @@ func (v *ParserVisitor) VisitReverseRange(ctx *parser.ReverseRangeContext) inter
return fmt.Errorf("range operations are only supported on single fields now, got: %s", ctx.Expr(1).GetText())
}
if err := checkDirectComparisonBinaryField(columnInfo); err != nil {
return err
}
lower := ctx.Expr(1).Accept(v)
upper := ctx.Expr(0).Accept(v)
if err := getError(lower); err != nil {
@ -767,6 +798,9 @@ func (v *ParserVisitor) VisitUnary(ctx *parser.UnaryContext) interface{} {
if childExpr == nil {
return fmt.Errorf("failed to parse unary expressions")
}
if err := checkDirectComparisonBinaryField(toColumnInfo(childExpr)); err != nil {
return err
}
switch ctx.GetOp().GetTokenType() {
case parser.PlanParserADD:
return childExpr
@ -983,25 +1017,25 @@ func (v *ParserVisitor) getColumnInfoFromJSONIdentifier(identifier string) (*pla
if path == "" {
return nil, fmt.Errorf("invalid identifier: %s", identifier)
}
if typeutil.IsArrayType(field.DataType) {
return nil, fmt.Errorf("can only access array field with integer index")
}
} else if _, err := strconv.ParseInt(path, 10, 64); err != nil {
return nil, fmt.Errorf("json key must be enclosed in double quotes or single quotes: \"%s\"", path)
}
nestedPath = append(nestedPath, path)
}
if typeutil.IsJSONType(field.DataType) && len(nestedPath) == 0 {
return nil, fmt.Errorf("can not comparisons jsonField directly")
}
return &planpb.ColumnInfo{
FieldId: field.FieldID,
DataType: field.DataType,
NestedPath: nestedPath,
FieldId: field.FieldID,
DataType: field.DataType,
NestedPath: nestedPath,
ElementType: field.GetElementType(),
}, nil
}
func (v *ParserVisitor) VisitJSONIdentifier(ctx *parser.JSONIdentifierContext) interface{} {
jsonField, err := v.getColumnInfoFromJSONIdentifier(ctx.JSONIdentifier().GetText())
field, err := v.getColumnInfoFromJSONIdentifier(ctx.JSONIdentifier().GetText())
if err != nil {
return err
}
@ -1010,14 +1044,15 @@ func (v *ParserVisitor) VisitJSONIdentifier(ctx *parser.JSONIdentifierContext) i
Expr: &planpb.Expr_ColumnExpr{
ColumnExpr: &planpb.ColumnExpr{
Info: &planpb.ColumnInfo{
FieldId: jsonField.GetFieldId(),
DataType: jsonField.GetDataType(),
NestedPath: jsonField.GetNestedPath(),
FieldId: field.GetFieldId(),
DataType: field.GetDataType(),
NestedPath: field.GetNestedPath(),
ElementType: field.GetElementType(),
},
},
},
},
dataType: jsonField.GetDataType(),
dataType: field.GetDataType(),
nodeDependent: true,
}
}
@ -1037,6 +1072,7 @@ func (v *ParserVisitor) VisitExists(ctx *parser.ExistsContext) interface{} {
return fmt.Errorf(
"exists oerations are only supportted on json field, got:%s", columnInfo.GetDataType())
}
return &ExprWithType{
expr: &planpb.Expr{
Expr: &planpb.Expr_ExistsExpr{
@ -1053,6 +1089,53 @@ func (v *ParserVisitor) VisitExists(ctx *parser.ExistsContext) interface{} {
}
}
func (v *ParserVisitor) VisitArray(ctx *parser.ArrayContext) interface{} {
allExpr := ctx.AllExpr()
array := make([]*planpb.GenericValue, 0, len(allExpr))
dType := schemapb.DataType_None
sameType := true
for i := 0; i < len(allExpr); i++ {
element := allExpr[i].Accept(v)
if err := getError(element); err != nil {
return err
}
elementValue := getGenericValue(element)
if elementValue == nil {
return fmt.Errorf("array element type must be generic value, but got: %s", allExpr[i].GetText())
}
array = append(array, elementValue)
if dType == schemapb.DataType_None {
dType = element.(*ExprWithType).dataType
} else if dType != element.(*ExprWithType).dataType {
sameType = false
}
}
if !sameType {
dType = schemapb.DataType_None
}
return &ExprWithType{
dataType: schemapb.DataType_Array,
expr: &planpb.Expr{
Expr: &planpb.Expr_ValueExpr{
ValueExpr: &planpb.ValueExpr{
Value: &planpb.GenericValue{
Val: &planpb.GenericValue_ArrayVal{
ArrayVal: &planpb.Array{
Array: array,
SameType: sameType,
ElementType: dType,
},
},
},
},
},
},
nodeDependent: true,
}
}
func (v *ParserVisitor) VisitJSONContains(ctx *parser.JSONContainsContext) interface{} {
field := ctx.Expr(0).Accept(v)
if err := getError(field); err != nil {
@ -1060,9 +1143,10 @@ func (v *ParserVisitor) VisitJSONContains(ctx *parser.JSONContainsContext) inter
}
columnInfo := toColumnInfo(field.(*ExprWithType))
if columnInfo == nil || !typeutil.IsJSONType(columnInfo.GetDataType()) {
if columnInfo == nil ||
(!typeutil.IsJSONType(columnInfo.GetDataType()) && !typeutil.IsArrayType(columnInfo.GetDataType())) {
return fmt.Errorf(
"json_contains operation are only supported on json fields now, got: %s", ctx.Expr(0).GetText())
"contains operation are only supported on json or array fields now, got: %s", ctx.Expr(0).GetText())
}
element := ctx.Expr(1).Accept(v)
@ -1072,7 +1156,15 @@ func (v *ParserVisitor) VisitJSONContains(ctx *parser.JSONContainsContext) inter
elementValue := getGenericValue(element)
if elementValue == nil {
return fmt.Errorf(
"json_contains operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
"contains operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
}
if typeutil.IsArrayType(columnInfo.GetDataType()) {
valExpr := toValueExpr(elementValue)
if !canBeCompared(field.(*ExprWithType), valExpr) {
return fmt.Errorf("contains operation can't compare between array element type: %s and %s",
columnInfo.GetElementType(),
valExpr.dataType)
}
}
elements := make([]*planpb.GenericValue, 1)
@ -1094,49 +1186,6 @@ func (v *ParserVisitor) VisitJSONContains(ctx *parser.JSONContainsContext) inter
}
}
func (v *ParserVisitor) VisitArray(ctx *parser.ArrayContext) interface{} {
allExpr := ctx.AllExpr()
array := make([]*planpb.GenericValue, 0, len(allExpr))
dType := schemapb.DataType_None
sameType := true
for i := 0; i < len(allExpr); i++ {
element := allExpr[i].Accept(v)
if err := getError(element); err != nil {
return err
}
elementValue := getGenericValue(element)
if elementValue == nil {
return fmt.Errorf("array element type must be generic value, but got: %s", allExpr[i].GetText())
}
array = append(array, getGenericValue(element))
if dType == schemapb.DataType_None {
dType = element.(*ExprWithType).dataType
} else if dType != element.(*ExprWithType).dataType {
sameType = false
}
}
return &ExprWithType{
dataType: schemapb.DataType_Array,
expr: &planpb.Expr{
Expr: &planpb.Expr_ValueExpr{
ValueExpr: &planpb.ValueExpr{
Value: &planpb.GenericValue{
Val: &planpb.GenericValue_ArrayVal{
ArrayVal: &planpb.Array{
Array: array,
SameType: sameType,
},
},
},
},
},
},
nodeDependent: true,
}
}
func (v *ParserVisitor) VisitJSONContainsAll(ctx *parser.JSONContainsAllContext) interface{} {
field := ctx.Expr(0).Accept(v)
if err := getError(field); err != nil {
@ -1144,9 +1193,10 @@ func (v *ParserVisitor) VisitJSONContainsAll(ctx *parser.JSONContainsAllContext)
}
columnInfo := toColumnInfo(field.(*ExprWithType))
if columnInfo == nil || !typeutil.IsJSONType(columnInfo.GetDataType()) {
if columnInfo == nil ||
(!typeutil.IsJSONType(columnInfo.GetDataType()) && !typeutil.IsArrayType(columnInfo.GetDataType())) {
return fmt.Errorf(
"json_contains_all operation are only supported on json fields now, got: %s", ctx.Expr(0).GetText())
"contains_all operation are only supported on json or array fields now, got: %s", ctx.Expr(0).GetText())
}
element := ctx.Expr(1).Accept(v)
@ -1156,11 +1206,22 @@ func (v *ParserVisitor) VisitJSONContainsAll(ctx *parser.JSONContainsAllContext)
elementValue := getGenericValue(element)
if elementValue == nil {
return fmt.Errorf(
"json_contains_all operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
"contains_all operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
}
if elementValue.GetArrayVal() == nil {
return fmt.Errorf("json_contains_all operation element must be an array")
return fmt.Errorf("contains_all operation element must be an array")
}
if typeutil.IsArrayType(columnInfo.GetDataType()) {
for _, value := range elementValue.GetArrayVal().GetArray() {
valExpr := toValueExpr(value)
if !canBeCompared(field.(*ExprWithType), valExpr) {
return fmt.Errorf("contains_all operation can't compare between array element type: %s and %s",
columnInfo.GetElementType(),
valExpr.dataType)
}
}
}
expr := &planpb.Expr{
@ -1186,9 +1247,10 @@ func (v *ParserVisitor) VisitJSONContainsAny(ctx *parser.JSONContainsAnyContext)
}
columnInfo := toColumnInfo(field.(*ExprWithType))
if columnInfo == nil || !typeutil.IsJSONType(columnInfo.GetDataType()) {
if columnInfo == nil ||
(!typeutil.IsJSONType(columnInfo.GetDataType()) && !typeutil.IsArrayType(columnInfo.GetDataType())) {
return fmt.Errorf(
"json_contains_any operation are only supported on json fields now, got: %s", ctx.Expr(0).GetText())
"contains_any operation are only supported on json or array fields now, got: %s", ctx.Expr(0).GetText())
}
element := ctx.Expr(1).Accept(v)
@ -1198,11 +1260,22 @@ func (v *ParserVisitor) VisitJSONContainsAny(ctx *parser.JSONContainsAnyContext)
elementValue := getGenericValue(element)
if elementValue == nil {
return fmt.Errorf(
"json_contains_any operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
"contains_any operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
}
if elementValue.GetArrayVal() == nil {
return fmt.Errorf("json_contains_any operation element must be an array")
return fmt.Errorf("contains_any operation element must be an array")
}
if typeutil.IsArrayType(columnInfo.GetDataType()) {
for _, value := range elementValue.GetArrayVal().GetArray() {
valExpr := toValueExpr(value)
if !canBeCompared(field.(*ExprWithType), valExpr) {
return fmt.Errorf("contains_any operation can't compare between array element type: %s and %s",
columnInfo.GetElementType(),
valExpr.dataType)
}
}
}
expr := &planpb.Expr{
@ -1220,3 +1293,36 @@ func (v *ParserVisitor) VisitJSONContainsAny(ctx *parser.JSONContainsAnyContext)
dataType: schemapb.DataType_Bool,
}
}
func (v *ParserVisitor) VisitArrayLength(ctx *parser.ArrayLengthContext) interface{} {
columnInfo, err := v.getChildColumnInfo(ctx.Identifier(), ctx.JSONIdentifier())
if err != nil {
return err
}
if columnInfo == nil ||
(!typeutil.IsJSONType(columnInfo.GetDataType()) && !typeutil.IsArrayType(columnInfo.GetDataType())) {
return fmt.Errorf(
"array_length operation are only supported on json or array fields now, got: %s", ctx.GetText())
}
expr := &planpb.Expr{
Expr: &planpb.Expr_BinaryArithExpr{
BinaryArithExpr: &planpb.BinaryArithExpr{
Left: &planpb.Expr{
Expr: &planpb.Expr_ColumnExpr{
ColumnExpr: &planpb.ColumnExpr{
Info: columnInfo,
},
},
},
Right: nil,
Op: planpb.ArithOpType_ArrayLength,
},
},
}
return &ExprWithType{
expr: expr,
dataType: schemapb.DataType_Int64,
nodeDependent: true,
}
}

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,9 @@ import (
"strconv"
"strings"
"github.com/milvus-io/milvus/pkg/util/typeutil"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
func IsBool(n *planpb.GenericValue) bool {
@ -47,6 +46,14 @@ func IsString(n *planpb.GenericValue) bool {
return false
}
func IsArray(n *planpb.GenericValue) bool {
switch n.GetVal().(type) {
case *planpb.GenericValue_ArrayVal:
return true
}
return false
}
func NewBool(value bool) *planpb.GenericValue {
return &planpb.GenericValue{
Val: &planpb.GenericValue_BoolVal{
@ -119,33 +126,47 @@ func toValueExpr(n *planpb.GenericValue) *ExprWithType {
}
}
func getSameType(a, b schemapb.DataType) (schemapb.DataType, error) {
if hasJSONField(a, b) {
return schemapb.DataType_JSON, nil
func getSameType(left, right *ExprWithType) (schemapb.DataType, error) {
lDataType, rDataType := left.dataType, right.dataType
if typeutil.IsArrayType(lDataType) {
lDataType = toColumnInfo(left).GetElementType()
}
if typeutil.IsFloatingType(a) && typeutil.IsArithmetic(b) {
return schemapb.DataType_Double, nil
if typeutil.IsArrayType(rDataType) {
rDataType = toColumnInfo(right).GetElementType()
}
if typeutil.IsJSONType(lDataType) {
if typeutil.IsJSONType(rDataType) {
return schemapb.DataType_JSON, nil
}
if typeutil.IsFloatingType(rDataType) {
return schemapb.DataType_Double, nil
}
if typeutil.IsIntegerType(rDataType) {
return schemapb.DataType_Int64, nil
}
}
if typeutil.IsFloatingType(lDataType) {
if typeutil.IsJSONType(rDataType) || typeutil.IsArithmetic(rDataType) {
return schemapb.DataType_Double, nil
}
}
if typeutil.IsIntegerType(lDataType) {
if typeutil.IsFloatingType(rDataType) {
return schemapb.DataType_Double, nil
}
if typeutil.IsIntegerType(rDataType) || typeutil.IsJSONType(rDataType) {
return schemapb.DataType_Int64, nil
}
}
if typeutil.IsIntegerType(a) && typeutil.IsIntegerType(b) {
return schemapb.DataType_Int64, nil
}
return schemapb.DataType_None, fmt.Errorf("incompatible data type, %s, %s", a.String(), b.String())
}
func hasJSONField(a, b schemapb.DataType) bool {
if typeutil.IsJSONType(a) || typeutil.IsJSONType(b) {
return true
}
return false
return schemapb.DataType_None, fmt.Errorf("incompatible data type, %s, %s", lDataType.String(), rDataType.String())
}
func calcDataType(left, right *ExprWithType, reverse bool) (schemapb.DataType, error) {
if reverse {
return getSameType(right.dataType, left.dataType)
return getSameType(right, left)
}
return getSameType(left.dataType, right.dataType)
return getSameType(left, right)
}
func reverseOrder(op planpb.OpType) (planpb.OpType, error) {
@ -175,6 +196,9 @@ func castValue(dataType schemapb.DataType, value *planpb.GenericValue) (*planpb.
if typeutil.IsJSONType(dataType) {
return value, nil
}
if typeutil.IsArrayType(dataType) && IsArray(value) {
return value, nil
}
if typeutil.IsStringType(dataType) && IsString(value) {
return value, nil
}
@ -192,17 +216,19 @@ func castValue(dataType schemapb.DataType, value *planpb.GenericValue) (*planpb.
}
}
if typeutil.IsIntegerType(dataType) {
if IsInteger(value) {
return value, nil
}
if typeutil.IsIntegerType(dataType) && IsInteger(value) {
return value, nil
}
return nil, fmt.Errorf("cannot cast value to %s, value: %s", dataType.String(), value)
}
func combineBinaryArithExpr(op planpb.OpType, arithOp planpb.ArithOpType, columnInfo *planpb.ColumnInfo, operand *planpb.GenericValue, value *planpb.GenericValue) *planpb.Expr {
castedValue, err := castValue(columnInfo.GetDataType(), operand)
dataType := columnInfo.GetDataType()
if typeutil.IsArrayType(dataType) && len(columnInfo.GetNestedPath()) != 0 {
dataType = columnInfo.GetElementType()
}
castedValue, err := castValue(dataType, operand)
if err != nil {
return nil
}
@ -219,6 +245,19 @@ func combineBinaryArithExpr(op planpb.OpType, arithOp planpb.ArithOpType, column
}
}
func combineArrayLengthExpr(op planpb.OpType, arithOp planpb.ArithOpType, columnInfo *planpb.ColumnInfo, value *planpb.GenericValue) (*planpb.Expr, error) {
return &planpb.Expr{
Expr: &planpb.Expr_BinaryArithOpEvalRangeExpr{
BinaryArithOpEvalRangeExpr: &planpb.BinaryArithOpEvalRangeExpr{
ColumnInfo: columnInfo,
ArithOp: arithOp,
Op: op,
Value: value,
},
},
}, nil
}
func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr, valueExpr *planpb.ValueExpr) (*planpb.Expr, error) {
switch op {
case planpb.OpType_Equal, planpb.OpType_NotEqual:
@ -230,6 +269,10 @@ func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr,
leftExpr, leftValue := arithExpr.Left.GetColumnExpr(), arithExpr.Left.GetValueExpr()
rightExpr, rightValue := arithExpr.Right.GetColumnExpr(), arithExpr.Right.GetValueExpr()
arithOp := arithExpr.GetOp()
if arithOp == planpb.ArithOpType_ArrayLength {
return combineArrayLengthExpr(op, arithOp, leftExpr.GetInfo(), valueExpr.GetValue())
}
if leftExpr != nil && rightExpr != nil {
// a + b == 3
@ -247,7 +290,7 @@ func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr,
// a * 2 == 3
// a / 2 == 3
// a % 2 == 3
return combineBinaryArithExpr(op, arithExpr.GetOp(), leftExpr.GetInfo(), rightValue.GetValue(), valueExpr.GetValue()), nil
return combineBinaryArithExpr(op, arithOp, leftExpr.GetInfo(), rightValue.GetValue(), valueExpr.GetValue()), nil
} else if rightExpr != nil && leftValue != nil {
// 2 + a == 3
// 2 - a == 3
@ -257,9 +300,9 @@ func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr,
switch arithExpr.GetOp() {
case planpb.ArithOpType_Add, planpb.ArithOpType_Mul:
return combineBinaryArithExpr(op, arithExpr.GetOp(), rightExpr.GetInfo(), leftValue.GetValue(), valueExpr.GetValue()), nil
return combineBinaryArithExpr(op, arithOp, rightExpr.GetInfo(), leftValue.GetValue(), valueExpr.GetValue()), nil
default:
return nil, fmt.Errorf("todo")
return nil, fmt.Errorf("module field is not yet supported")
}
} else {
// (a + b) / 2 == 3
@ -268,7 +311,11 @@ func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr,
}
func handleCompareRightValue(op planpb.OpType, left *ExprWithType, right *planpb.ValueExpr) (*planpb.Expr, error) {
castedValue, err := castValue(left.dataType, right.GetValue())
dataType := left.dataType
if typeutil.IsArrayType(dataType) && len(toColumnInfo(left).GetNestedPath()) != 0 {
dataType = toColumnInfo(left).GetElementType()
}
castedValue, err := castValue(dataType, right.GetValue())
if err != nil {
return nil, err
}
@ -281,7 +328,6 @@ func handleCompareRightValue(op planpb.OpType, left *ExprWithType, right *planpb
if columnInfo == nil {
return nil, fmt.Errorf("not supported to combine multiple fields")
}
expr := &planpb.Expr{
Expr: &planpb.Expr_UnaryRangeExpr{
UnaryRangeExpr: &planpb.UnaryRangeExpr{
@ -332,9 +378,49 @@ func relationalCompatible(t1, t2 schemapb.DataType) bool {
return both || neither
}
func canBeComparedDataType(left, right schemapb.DataType) bool {
switch left {
case schemapb.DataType_Bool:
return typeutil.IsBoolType(right) || typeutil.IsJSONType(right)
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32, schemapb.DataType_Int64,
schemapb.DataType_Float, schemapb.DataType_Double:
return typeutil.IsArithmetic(right) || typeutil.IsJSONType(right)
case schemapb.DataType_String, schemapb.DataType_VarChar:
return typeutil.IsStringType(right) || typeutil.IsJSONType(right)
case schemapb.DataType_JSON:
return true
default:
return false
}
}
func getArrayElementType(expr *ExprWithType) schemapb.DataType {
if columnInfo := toColumnInfo(expr); columnInfo != nil {
return columnInfo.GetElementType()
}
if valueExpr := expr.expr.GetValueExpr(); valueExpr != nil {
return valueExpr.GetValue().GetArrayVal().GetElementType()
}
return schemapb.DataType_None
}
func canBeCompared(left, right *ExprWithType) bool {
if !typeutil.IsArrayType(left.dataType) && !typeutil.IsArrayType(right.dataType) {
return canBeComparedDataType(left.dataType, right.dataType)
}
if typeutil.IsArrayType(left.dataType) && typeutil.IsArrayType(right.dataType) {
return canBeComparedDataType(getArrayElementType(left), getArrayElementType(right))
}
if typeutil.IsArrayType(left.dataType) {
return canBeComparedDataType(getArrayElementType(left), right.dataType)
}
return canBeComparedDataType(left.dataType, getArrayElementType(right))
}
func HandleCompare(op int, left, right *ExprWithType) (*planpb.Expr, error) {
if !relationalCompatible(left.dataType, right.dataType) {
return nil, fmt.Errorf("comparisons between string and non-string are not supported")
if !canBeCompared(left, right) {
return nil, fmt.Errorf("comparisons between %s, element_type: %s and %s elementType: %s are not supported",
left.dataType, getArrayElementType(left), right.dataType, getArrayElementType(right))
}
cmpOp := cmpOpMap[op]
@ -424,3 +510,34 @@ func convertEscapeSingle(literal string) (string, error) {
b.WriteString(`"`)
return strconv.Unquote(b.String())
}
func canArithmeticDataType(left, right schemapb.DataType) bool {
switch left {
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32, schemapb.DataType_Int64,
schemapb.DataType_Float, schemapb.DataType_Double:
return typeutil.IsArithmetic(right) || typeutil.IsJSONType(right)
case schemapb.DataType_JSON:
return typeutil.IsArithmetic(right)
default:
return false
}
}
func canArithmetic(left *ExprWithType, right *ExprWithType) bool {
if !typeutil.IsArrayType(left.dataType) && !typeutil.IsArrayType(right.dataType) {
return canArithmeticDataType(left.dataType, right.dataType)
}
if typeutil.IsArrayType(left.dataType) && typeutil.IsArrayType(right.dataType) {
return canArithmeticDataType(getArrayElementType(left), getArrayElementType(right))
}
if typeutil.IsArrayType(left.dataType) {
return canArithmeticDataType(getArrayElementType(left), right.dataType)
}
return canArithmeticDataType(left.dataType, getArrayElementType(right))
}
func isIntegerColumn(col *planpb.ColumnInfo) bool {
return typeutil.IsIntegerType(col.GetDataType()) ||
(typeutil.IsArrayType(col.GetDataType()) && typeutil.IsIntegerType(col.GetElementType())) ||
typeutil.IsJSONType(col.GetDataType())
}

View File

@ -209,3 +209,115 @@ func Test_convertEscapeSingle(t *testing.T) {
assert.Equal(t, c.expected, actual)
}
}
func Test_canBeComparedDataType(t *testing.T) {
type testCases struct {
left schemapb.DataType
right schemapb.DataType
expected bool
}
cases := []testCases{
{schemapb.DataType_Bool, schemapb.DataType_Bool, true},
{schemapb.DataType_Bool, schemapb.DataType_JSON, true},
{schemapb.DataType_Bool, schemapb.DataType_Int8, false},
{schemapb.DataType_Bool, schemapb.DataType_Int16, false},
{schemapb.DataType_Bool, schemapb.DataType_Int32, false},
{schemapb.DataType_Bool, schemapb.DataType_Int64, false},
{schemapb.DataType_Bool, schemapb.DataType_Float, false},
{schemapb.DataType_Bool, schemapb.DataType_Double, false},
{schemapb.DataType_Bool, schemapb.DataType_String, false},
{schemapb.DataType_Int8, schemapb.DataType_Int16, true},
{schemapb.DataType_Int16, schemapb.DataType_Int32, true},
{schemapb.DataType_Int32, schemapb.DataType_Int64, true},
{schemapb.DataType_Int64, schemapb.DataType_Float, true},
{schemapb.DataType_Float, schemapb.DataType_Double, true},
{schemapb.DataType_Double, schemapb.DataType_Int32, true},
{schemapb.DataType_Double, schemapb.DataType_String, false},
{schemapb.DataType_Int64, schemapb.DataType_String, false},
{schemapb.DataType_Int64, schemapb.DataType_JSON, true},
{schemapb.DataType_Double, schemapb.DataType_JSON, true},
{schemapb.DataType_String, schemapb.DataType_Double, false},
{schemapb.DataType_String, schemapb.DataType_Int64, false},
{schemapb.DataType_String, schemapb.DataType_JSON, true},
{schemapb.DataType_String, schemapb.DataType_String, true},
{schemapb.DataType_String, schemapb.DataType_VarChar, true},
{schemapb.DataType_VarChar, schemapb.DataType_VarChar, true},
{schemapb.DataType_VarChar, schemapb.DataType_JSON, true},
{schemapb.DataType_VarChar, schemapb.DataType_Int64, false},
{schemapb.DataType_Array, schemapb.DataType_Int64, false},
{schemapb.DataType_Array, schemapb.DataType_Array, false},
}
for _, c := range cases {
assert.Equal(t, c.expected, canBeComparedDataType(c.left, c.right))
}
}
func Test_getArrayElementType(t *testing.T) {
t.Run("array element", func(t *testing.T) {
expr := &ExprWithType{
expr: &planpb.Expr{
Expr: &planpb.Expr_ValueExpr{
ValueExpr: &planpb.ValueExpr{
Value: &planpb.GenericValue{
Val: &planpb.GenericValue_ArrayVal{
ArrayVal: &planpb.Array{
Array: nil,
ElementType: schemapb.DataType_Int64,
},
},
},
},
},
},
dataType: schemapb.DataType_Array,
nodeDependent: true,
}
assert.Equal(t, schemapb.DataType_Int64, getArrayElementType(expr))
})
t.Run("array field", func(t *testing.T) {
expr := &ExprWithType{
expr: &planpb.Expr{
Expr: &planpb.Expr_ColumnExpr{
ColumnExpr: &planpb.ColumnExpr{
Info: &planpb.ColumnInfo{
FieldId: 101,
DataType: schemapb.DataType_Array,
IsPrimaryKey: false,
IsAutoID: false,
NestedPath: nil,
IsPartitionKey: false,
ElementType: schemapb.DataType_Int64,
},
},
},
},
dataType: schemapb.DataType_Array,
nodeDependent: true,
}
assert.Equal(t, schemapb.DataType_Int64, getArrayElementType(expr))
})
t.Run("not array", func(t *testing.T) {
expr := &ExprWithType{
expr: &planpb.Expr{
Expr: &planpb.Expr_ColumnExpr{
ColumnExpr: &planpb.ColumnExpr{
Info: &planpb.ColumnInfo{
FieldId: 102,
DataType: schemapb.DataType_String,
},
},
},
},
dataType: schemapb.DataType_String,
nodeDependent: true,
}
assert.Equal(t, schemapb.DataType_None, getArrayElementType(expr))
})
}

View File

@ -27,6 +27,7 @@ enum ArithOpType {
Mul = 3;
Div = 4;
Mod = 5;
ArrayLength = 6;
};
enum VectorType {
@ -48,6 +49,7 @@ message GenericValue {
message Array {
repeated GenericValue array = 1;
bool same_type = 2;
schema.DataType element_type = 3;
}
message QueryInfo {
@ -64,6 +66,7 @@ message ColumnInfo {
bool is_autoID = 4;
repeated string nested_path = 5;
bool is_partition_key = 6;
schema.DataType element_type = 7;
}
message ColumnExpr {
@ -108,9 +111,9 @@ message JSONContainsExpr {
ColumnInfo column_info = 1;
repeated GenericValue elements = 2;
// 0: invalid
// 1: json_contains
// 2: json_contains_all
// 3: json_contains_any
// 1: json_contains | array_contains
// 2: json_contains_all | array_contains_all
// 3: json_contains_any | array_contains_any
enum JSONOp {
Invalid = 0;
Contains = 1;

View File

@ -82,12 +82,13 @@ func (OpType) EnumDescriptor() ([]byte, []int) {
type ArithOpType int32
const (
ArithOpType_Unknown ArithOpType = 0
ArithOpType_Add ArithOpType = 1
ArithOpType_Sub ArithOpType = 2
ArithOpType_Mul ArithOpType = 3
ArithOpType_Div ArithOpType = 4
ArithOpType_Mod ArithOpType = 5
ArithOpType_Unknown ArithOpType = 0
ArithOpType_Add ArithOpType = 1
ArithOpType_Sub ArithOpType = 2
ArithOpType_Mul ArithOpType = 3
ArithOpType_Div ArithOpType = 4
ArithOpType_Mod ArithOpType = 5
ArithOpType_ArrayLength ArithOpType = 6
)
var ArithOpType_name = map[int32]string{
@ -97,15 +98,17 @@ var ArithOpType_name = map[int32]string{
3: "Mul",
4: "Div",
5: "Mod",
6: "ArrayLength",
}
var ArithOpType_value = map[string]int32{
"Unknown": 0,
"Add": 1,
"Sub": 2,
"Mul": 3,
"Div": 4,
"Mod": 5,
"Unknown": 0,
"Add": 1,
"Sub": 2,
"Mul": 3,
"Div": 4,
"Mod": 5,
"ArrayLength": 6,
}
func (x ArithOpType) String() string {
@ -145,9 +148,9 @@ func (VectorType) EnumDescriptor() ([]byte, []int) {
}
// 0: invalid
// 1: json_contains
// 2: json_contains_all
// 3: json_contains_any
// 1: json_contains | array_contains
// 2: json_contains_all | array_contains_all
// 3: json_contains_any | array_contains_any
type JSONContainsExpr_JSONOp int32
const (
@ -359,11 +362,12 @@ func (*GenericValue) XXX_OneofWrappers() []interface{} {
}
type Array struct {
Array []*GenericValue `protobuf:"bytes,1,rep,name=array,proto3" json:"array,omitempty"`
SameType bool `protobuf:"varint,2,opt,name=same_type,json=sameType,proto3" json:"same_type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Array []*GenericValue `protobuf:"bytes,1,rep,name=array,proto3" json:"array,omitempty"`
SameType bool `protobuf:"varint,2,opt,name=same_type,json=sameType,proto3" json:"same_type,omitempty"`
ElementType schemapb.DataType `protobuf:"varint,3,opt,name=element_type,json=elementType,proto3,enum=milvus.proto.schema.DataType" json:"element_type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Array) Reset() { *m = Array{} }
@ -405,6 +409,13 @@ func (m *Array) GetSameType() bool {
return false
}
func (m *Array) GetElementType() schemapb.DataType {
if m != nil {
return m.ElementType
}
return schemapb.DataType_None
}
type QueryInfo struct {
Topk int64 `protobuf:"varint,1,opt,name=topk,proto3" json:"topk,omitempty"`
MetricType string `protobuf:"bytes,3,opt,name=metric_type,json=metricType,proto3" json:"metric_type,omitempty"`
@ -475,6 +486,7 @@ type ColumnInfo struct {
IsAutoID bool `protobuf:"varint,4,opt,name=is_autoID,json=isAutoID,proto3" json:"is_autoID,omitempty"`
NestedPath []string `protobuf:"bytes,5,rep,name=nested_path,json=nestedPath,proto3" json:"nested_path,omitempty"`
IsPartitionKey bool `protobuf:"varint,6,opt,name=is_partition_key,json=isPartitionKey,proto3" json:"is_partition_key,omitempty"`
ElementType schemapb.DataType `protobuf:"varint,7,opt,name=element_type,json=elementType,proto3,enum=milvus.proto.schema.DataType" json:"element_type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -547,6 +559,13 @@ func (m *ColumnInfo) GetIsPartitionKey() bool {
return false
}
func (m *ColumnInfo) GetElementType() schemapb.DataType {
if m != nil {
return m.ElementType
}
return schemapb.DataType_None
}
type ColumnExpr struct {
Info *ColumnInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -1787,118 +1806,120 @@ func init() {
func init() { proto.RegisterFile("plan.proto", fileDescriptor_2d655ab2f7683c23) }
var fileDescriptor_2d655ab2f7683c23 = []byte{
// 1796 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x73, 0xdc, 0x48,
0x15, 0x1f, 0x8d, 0xe6, 0x8f, 0xf4, 0x66, 0x3c, 0x56, 0x54, 0x54, 0xe1, 0x24, 0x6c, 0x6c, 0xb4,
0x5b, 0xac, 0x09, 0xc4, 0xa9, 0x64, 0x77, 0x13, 0x36, 0x5b, 0x0b, 0x1e, 0xff, 0x49, 0x66, 0xd8,
0x8d, 0x6d, 0x64, 0x6f, 0x0e, 0x70, 0x50, 0xf5, 0x48, 0x6d, 0x4f, 0x13, 0x4d, 0x4b, 0x91, 0x5a,
0x93, 0xcc, 0x17, 0xe0, 0xc0, 0x8d, 0x0f, 0xc0, 0x89, 0x03, 0x77, 0x8e, 0x5c, 0xe0, 0x4c, 0x71,
0xe0, 0xc8, 0x91, 0xaf, 0x40, 0xf1, 0x05, 0xa8, 0x7e, 0x2d, 0x8d, 0x66, 0xcc, 0x4c, 0x3c, 0x06,
0x57, 0x71, 0x6b, 0xbd, 0x7e, 0xef, 0xd7, 0xef, 0x5f, 0xbf, 0xf7, 0x5a, 0x00, 0x71, 0x48, 0xf8,
0x4e, 0x9c, 0x44, 0x22, 0xb2, 0x6f, 0x8d, 0x58, 0x38, 0xce, 0x52, 0xf5, 0xb5, 0x23, 0x37, 0xee,
0xb4, 0x53, 0x7f, 0x48, 0x47, 0x44, 0x91, 0x9c, 0xbf, 0x68, 0xd0, 0x7e, 0x41, 0x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 0x41, 0x44, 0x30, 0xb0, 0x9b, 0x12, 0xf8, 0x24, 0xce,
0xc4, 0x94, 0x62, 0x48, 0x59, 0xf5, 0x69, 0xca, 0x4f, 0x2c, 0x73, 0x36, 0x38, 0x0d, 0xa8, 0xf6,
0xb8, 0x6d, 0x49, 0xd2, 0x51, 0x2c, 0x7a, 0xdc, 0x6e, 0xdd, 0xfd, 0x05, 0x58, 0x33, 0xbd, 0x5e,
0x1a, 0xf0, 0x92, 0xbf, 0xe6, 0xf1, 0x5b, 0xae, 0x06, 0xdc, 0x4e, 0x28, 0x87, 0xc2, 0x26, 0xe8,
0xa7, 0x79, 0xdf, 0xae, 0xca, 0x8f, 0x17, 0x79, 0x64, 0xeb, 0xf2, 0xe3, 0x80, 0x8d, 0xec, 0x1a,
0x52, 0xe2, 0xd0, 0xae, 0x4b, 0xa5, 0xf0, 0xbf, 0xda, 0x73, 0xca, 0x2f, 0xc4, 0xc0, 0x6e, 0xdc,
0xdd, 0x9b, 0xdc, 0x47, 0x04, 0xb6, 0xa1, 0xa5, 0x6a, 0xa6, 0xa2, 0x29, 0xf7, 0x3c, 0xc5, 0xdf,
0x7e, 0x8a, 0xa0, 0x39, 0x37, 0x60, 0x0d, 0x09, 0x0f, 0x1e, 0x15, 0xa4, 0xea, 0xde, 0x67, 0xbf,
0x7c, 0x70, 0xc1, 0xc4, 0x20, 0xef, 0xef, 0x04, 0xf1, 0xf0, 0xbe, 0x8a, 0xe1, 0x3d, 0x16, 0x17,
0x5f, 0xf7, 0x19, 0x17, 0x34, 0xe5, 0x24, 0xba, 0x8f, 0x61, 0xbd, 0x2f, 0xc3, 0x9a, 0xf4, 0xfb,
0x0d, 0x5c, 0x7d, 0xf6, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, 0xa9, 0x51, 0x74, 0xe5, 0x14,
0x00, 0x00,
}

View File

@ -492,8 +492,6 @@ func TestExprBinaryArithOp_Str(t *testing.T) {
"(30 % age1) == 0",
// Modulo is not supported in the parser but the engine can handle it since fmod is used
"(FloatN % 2.1) == 0",
// Different data types are not supported
"(age1 + 20.16) == 35.16",
// Left operand of the function must be an identifier
"(10.5 / floatN) == 5.75",
}

View File

@ -273,12 +273,20 @@ func (cct *createCollectionTask) PreExecute(ctx context.Context) error {
}
// valid max length per row parameters
// if max_length not specified, return error
if field.DataType == schemapb.DataType_VarChar {
if field.DataType == schemapb.DataType_VarChar ||
(field.GetDataType() == schemapb.DataType_Array && field.GetElementType() == schemapb.DataType_VarChar) {
err = validateMaxLengthPerRow(cct.schema.Name, field)
if err != nil {
return err
}
}
// valid max capacity for array per row parameters
// if max_capacity not specified, return error
if field.DataType == schemapb.DataType_Array {
if err = validateMaxCapacityPerRow(cct.schema.Name, field); err != nil {
return err
}
}
}
if err := validateMultipleVectorFields(cct.schema); err != nil {

View File

@ -198,7 +198,7 @@ func (it *insertTask) PreExecute(ctx context.Context) error {
}
}
if err := newValidateUtil(withNANCheck(), withOverflowCheck(), withMaxLenCheck()).
if err := newValidateUtil(withNANCheck(), withOverflowCheck(), withMaxLenCheck(), withMaxCapCheck()).
Validate(it.insertMsg.GetFieldsData(), schema, it.insertMsg.NRows()); err != nil {
return err
}

View File

@ -59,6 +59,8 @@ const (
defaultMaxVarCharLength = 65535
defaultMaxArrayCapacity = 4096
// DefaultIndexType name of default index type for scalar field
DefaultIndexType = "STL_SORT"
@ -324,6 +326,30 @@ func validateMaxLengthPerRow(collectionName string, field *schemapb.FieldSchema)
return nil
}
func validateMaxCapacityPerRow(collectionName string, field *schemapb.FieldSchema) error {
exist := false
for _, param := range field.TypeParams {
if param.Key != common.MaxCapacityKey {
continue
}
maxCapacityPerRow, err := strconv.ParseInt(param.Value, 10, 64)
if err != nil {
return fmt.Errorf("the value of %s must be an integer", common.MaxCapacityKey)
}
if maxCapacityPerRow > defaultMaxArrayCapacity || maxCapacityPerRow <= 0 {
return fmt.Errorf("the maximum capacity specified for a Array shoule be in (0, 4096]")
}
exist = true
}
// if not exist type params max_length, return error
if !exist {
return fmt.Errorf("type param(max_capacity) should be specified for array field of collection %s", collectionName)
}
return nil
}
func validateVectorFieldMetricType(field *schemapb.FieldSchema) error {
if !isVectorType(field.DataType) {
return nil
@ -348,6 +374,19 @@ func validateDuplicatedFieldName(fields []*schemapb.FieldSchema) error {
return nil
}
func validateElementType(dataType schemapb.DataType) error {
switch dataType {
case schemapb.DataType_Bool, schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32,
schemapb.DataType_Int64, schemapb.DataType_Float, schemapb.DataType_Double, schemapb.DataType_VarChar:
return nil
case schemapb.DataType_String:
return errors.New("string data type not supported yet, please use VarChar type instead")
case schemapb.DataType_None:
return errors.New("element data type None is not valid")
}
return fmt.Errorf("element type %s is not supported", dataType.String())
}
func validateFieldType(schema *schemapb.CollectionSchema) error {
for _, field := range schema.GetFields() {
switch field.GetDataType() {
@ -355,6 +394,10 @@ func validateFieldType(schema *schemapb.CollectionSchema) error {
return errors.New("string data type not supported yet, please use VarChar type instead")
case schemapb.DataType_None:
return errors.New("data type None is not valid")
case schemapb.DataType_Array:
if err := validateElementType(field.GetElementType()); err != nil {
return err
}
}
}
return nil

View File

@ -349,6 +349,7 @@ func TestValidatePrimaryKey(t *testing.T) {
func TestValidateFieldType(t *testing.T) {
type testCase struct {
dt schemapb.DataType
et schemapb.DataType
validate bool
}
cases := []testCase{
@ -396,6 +397,80 @@ func TestValidateFieldType(t *testing.T) {
dt: schemapb.DataType_VarChar,
validate: true,
},
{
dt: schemapb.DataType_String,
validate: false,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_Bool,
validate: true,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_Int8,
validate: true,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_Int16,
validate: true,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_Int32,
validate: true,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_Int64,
validate: true,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_Float,
validate: true,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_Double,
validate: true,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_VarChar,
validate: true,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_String,
validate: false,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_None,
validate: false,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_JSON,
validate: false,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_Array,
validate: false,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_FloatVector,
validate: false,
},
{
dt: schemapb.DataType_Array,
et: schemapb.DataType_BinaryVector,
validate: false,
},
}
for _, tc := range cases {
@ -403,7 +478,8 @@ func TestValidateFieldType(t *testing.T) {
sch := &schemapb.CollectionSchema{
Fields: []*schemapb.FieldSchema{
{
DataType: tc.dt,
DataType: tc.dt,
ElementType: tc.et,
},
},
}
@ -1938,3 +2014,67 @@ func Test_CheckDynamicFieldData(t *testing.T) {
assert.NoError(t, err)
})
}
func Test_validateMaxCapacityPerRow(t *testing.T) {
t.Run("normal case", func(t *testing.T) {
arrayField := &schemapb.FieldSchema{
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_VarChar,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxLengthKey,
Value: "100",
},
{
Key: common.MaxCapacityKey,
Value: "10",
},
},
}
err := validateMaxCapacityPerRow("collection", arrayField)
assert.NoError(t, err)
})
t.Run("no max capacity", func(t *testing.T) {
arrayField := &schemapb.FieldSchema{
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
}
err := validateMaxCapacityPerRow("collection", arrayField)
assert.Error(t, err)
})
t.Run("max capacity not int", func(t *testing.T) {
arrayField := &schemapb.FieldSchema{
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "six",
},
},
}
err := validateMaxCapacityPerRow("collection", arrayField)
assert.Error(t, err)
})
t.Run("max capacity exceed max", func(t *testing.T) {
arrayField := &schemapb.FieldSchema{
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "4097",
},
},
}
err := validateMaxCapacityPerRow("collection", arrayField)
assert.Error(t, err)
})
}

View File

@ -18,6 +18,7 @@ type validateUtil struct {
checkNAN bool
checkMaxLen bool
checkOverflow bool
checkMaxCap bool
}
type validateOption func(*validateUtil)
@ -40,6 +41,12 @@ func withOverflowCheck() validateOption {
}
}
func withMaxCapCheck() validateOption {
return func(v *validateUtil) {
v.checkMaxCap = true
}
}
func (v *validateUtil) apply(opts ...validateOption) {
for _, opt := range opts {
opt(v)
@ -83,6 +90,11 @@ func (v *validateUtil) Validate(data []*schemapb.FieldData, schema *schemapb.Col
if err := v.checkIntegerFieldData(field, fieldSchema); err != nil {
return err
}
case schemapb.DataType_Array:
if err := v.checkArrayFieldData(field, fieldSchema); err != nil {
return err
}
default:
}
}
@ -351,6 +363,35 @@ func (v *validateUtil) checkIntegerFieldData(field *schemapb.FieldData, fieldSch
return nil
}
func (v *validateUtil) checkArrayFieldData(field *schemapb.FieldData, fieldSchema *schemapb.FieldSchema) error {
data := field.GetScalars().GetArrayData()
if data == nil {
msg := fmt.Sprintf("array field '%v' is illegal, array type mismatch", field.GetFieldName())
return merr.WrapErrParameterInvalid("need string array", "got nil", msg)
}
if v.checkMaxCap {
maxCapacity, err := parameterutil.GetMaxCapacity(fieldSchema)
if err != nil {
return err
}
if err := verifyCapacityPerRow(data.GetData(), maxCapacity, fieldSchema.GetElementType()); err != nil {
return err
}
}
if typeutil.IsStringType(data.GetElementType()) && v.checkMaxLen {
maxLength, err := parameterutil.GetMaxLength(fieldSchema)
if err != nil {
return err
}
for _, row := range data.GetData() {
if err := verifyLengthPerRow(row.GetStringData().GetData(), maxLength); err != nil {
return err
}
}
}
return nil
}
func verifyLengthPerRow[E interface{ ~string | ~[]byte }](strArr []E, maxLength int64) error {
for i, s := range strArr {
if int64(len(s)) > maxLength {
@ -362,6 +403,44 @@ func verifyLengthPerRow[E interface{ ~string | ~[]byte }](strArr []E, maxLength
return nil
}
func verifyCapacityPerRow(arrayArray []*schemapb.ScalarField, maxCapacity int64, elementType schemapb.DataType) error {
for i, array := range arrayArray {
switch elementType {
case schemapb.DataType_Bool:
if int64(len(array.GetBoolData().GetData())) <= maxCapacity {
continue
}
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32:
if int64(len(array.GetIntData().GetData())) <= maxCapacity {
continue
}
case schemapb.DataType_Int64:
if int64(len(array.GetLongData().GetData())) <= maxCapacity {
continue
}
case schemapb.DataType_String, schemapb.DataType_VarChar:
if int64(len(array.GetStringData().GetData())) <= maxCapacity {
continue
}
case schemapb.DataType_Float:
if int64(len(array.GetFloatData().GetData())) <= maxCapacity {
continue
}
case schemapb.DataType_Double:
if int64(len(array.GetDoubleData().GetData())) <= maxCapacity {
continue
}
default:
msg := fmt.Sprintf("array element type: %s is not supported", elementType.String())
return merr.WrapErrParameterInvalid("valid array element type", "array element type is not supported", msg)
}
msg := fmt.Sprintf("the length (%d) of %dth array exceeds max capacity (%d)", len(arrayArray), i, maxCapacity)
return merr.WrapErrParameterInvalid("valid length array", "array length exceeds max capacity", msg)
}
return nil
}
func verifyOverflowByRange(arr []int32, lb int64, ub int64) error {
for idx, e := range arr {
if lb > int64(e) || ub < int64(e) {

View File

@ -1071,6 +1071,236 @@ func Test_validateUtil_Validate(t *testing.T) {
assert.Error(t, err)
})
t.Run("array data nil", func(t *testing.T) {
data := []*schemapb.FieldData{
{
FieldName: "test",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: nil,
},
},
},
},
}
schema := &schemapb.CollectionSchema{
Fields: []*schemapb.FieldSchema{
{
Name: "test",
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "8",
},
},
},
},
}
v := newValidateUtil()
err := v.Validate(data, schema, 100)
assert.Error(t, err)
})
t.Run("exceed max capacity", func(t *testing.T) {
data := []*schemapb.FieldData{
{
FieldName: "test",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_LongData{
LongData: &schemapb.LongArray{
Data: []int64{1, 2, 3, 4, 5, 6, 7, 8, 9},
},
},
},
},
},
},
},
},
},
}
schema := &schemapb.CollectionSchema{
Fields: []*schemapb.FieldSchema{
{
Name: "test",
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "2",
},
},
},
},
}
v := newValidateUtil(withMaxCapCheck())
err := v.Validate(data, schema, 1)
assert.Error(t, err)
})
t.Run("string element exceed max length", func(t *testing.T) {
data := []*schemapb.FieldData{
{
FieldName: "test",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_StringData{
StringData: &schemapb.StringArray{
Data: []string{"abcdefghijkl", "ajsgfuioabaxyaefilagskjfhgka"},
},
},
},
},
ElementType: schemapb.DataType_VarChar,
},
},
},
},
},
}
schema := &schemapb.CollectionSchema{
Fields: []*schemapb.FieldSchema{
{
Name: "test",
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_VarChar,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "10",
},
{
Key: common.MaxLengthKey,
Value: "5",
},
},
},
},
}
v := newValidateUtil(withMaxCapCheck(), withMaxLenCheck())
err := v.Validate(data, schema, 1)
assert.Error(t, err)
})
t.Run("no max capacity", func(t *testing.T) {
data := []*schemapb.FieldData{
{
FieldName: "test",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_LongData{
LongData: &schemapb.LongArray{
Data: []int64{1, 2, 3, 4, 5, 6, 7, 8, 9},
},
},
},
},
},
},
},
},
},
}
schema := &schemapb.CollectionSchema{
Fields: []*schemapb.FieldSchema{
{
Name: "test",
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
TypeParams: []*commonpb.KeyValuePair{},
},
},
}
v := newValidateUtil(withMaxCapCheck())
err := v.Validate(data, schema, 1)
assert.Error(t, err)
})
t.Run("unsupported element type", func(t *testing.T) {
data := []*schemapb.FieldData{
{
FieldName: "test",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_LongData{
LongData: &schemapb.LongArray{
Data: []int64{1, 2, 3, 4, 5, 6, 7, 8, 9},
},
},
},
},
},
},
},
},
},
}
schema := &schemapb.CollectionSchema{
Fields: []*schemapb.FieldSchema{
{
Name: "test",
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_JSON,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "8",
},
},
},
},
}
v := newValidateUtil(withMaxCapCheck())
err := v.Validate(data, schema, 1)
assert.Error(t, err)
})
t.Run("normal case", func(t *testing.T) {
data := []*schemapb.FieldData{
{
@ -1136,6 +1366,174 @@ func Test_validateUtil_Validate(t *testing.T) {
},
},
},
{
FieldName: "bool_array",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_BoolData{
BoolData: &schemapb.BoolArray{
Data: []bool{true, true},
},
},
},
{
Data: &schemapb.ScalarField_BoolData{
BoolData: &schemapb.BoolArray{
Data: []bool{false, false},
},
},
},
},
},
},
},
},
},
{
FieldName: "int_array",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_IntData{
IntData: &schemapb.IntArray{
Data: []int32{1, 2, 3},
},
},
},
{
Data: &schemapb.ScalarField_IntData{
IntData: &schemapb.IntArray{
Data: []int32{4, 5, 6},
},
},
},
},
},
},
},
},
},
{
FieldName: "long_array",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_LongData{
LongData: &schemapb.LongArray{
Data: []int64{1, 2, 3},
},
},
},
{
Data: &schemapb.ScalarField_LongData{
LongData: &schemapb.LongArray{
Data: []int64{4, 5, 6},
},
},
},
},
},
},
},
},
},
{
FieldName: "string_array",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_StringData{
StringData: &schemapb.StringArray{
Data: []string{"abc", "def"},
},
},
},
{
Data: &schemapb.ScalarField_StringData{
StringData: &schemapb.StringArray{
Data: []string{"hij", "jkl"},
},
},
},
},
},
},
},
},
},
{
FieldName: "float_array",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_FloatData{
FloatData: &schemapb.FloatArray{
Data: []float32{1.1, 2.2, 3.3},
},
},
},
{
Data: &schemapb.ScalarField_FloatData{
FloatData: &schemapb.FloatArray{
Data: []float32{4.4, 5.5, 6.6},
},
},
},
},
},
},
},
},
},
{
FieldName: "double_array",
Type: schemapb.DataType_Array,
Field: &schemapb.FieldData_Scalars{
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_DoubleData{
DoubleData: &schemapb.DoubleArray{
Data: []float64{1.2, 2.3, 3.4},
},
},
},
{
Data: &schemapb.ScalarField_DoubleData{
DoubleData: &schemapb.DoubleArray{
Data: []float64{4.5, 5.6, 6.7},
},
},
},
},
},
},
},
},
},
}
schema := &schemapb.CollectionSchema{
@ -1183,10 +1581,86 @@ func Test_validateUtil_Validate(t *testing.T) {
FieldID: 105,
DataType: schemapb.DataType_Int8,
},
{
Name: "bool_array",
FieldID: 106,
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Bool,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "10",
},
},
},
{
Name: "int_array",
FieldID: 107,
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int16,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "10",
},
},
},
{
Name: "long_array",
FieldID: 108,
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "10",
},
},
},
{
Name: "string_array",
FieldID: 109,
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_VarChar,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "10",
},
{
Key: common.MaxLengthKey,
Value: "10",
},
},
},
{
Name: "float_array",
FieldID: 110,
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Float,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "10",
},
},
},
{
Name: "double_array",
FieldID: 111,
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Double,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "10",
},
},
},
},
}
v := newValidateUtil(withNANCheck(), withMaxLenCheck(), withOverflowCheck())
v := newValidateUtil(withNANCheck(), withMaxLenCheck(), withOverflowCheck(), withMaxCapCheck())
err := v.Validate(data, schema, 2)

View File

@ -94,6 +94,7 @@ const (
MetricTypeKey = "metric_type"
DimKey = "dim"
MaxLengthKey = "max_length"
MaxCapacityKey = "max_capacity"
)
// Collection properties key

View File

@ -12,7 +12,7 @@ import (
// GetMaxLength get max length of field. Maybe also helpful outside.
func GetMaxLength(field *schemapb.FieldSchema) (int64, error) {
if !typeutil.IsStringType(field.GetDataType()) {
if !typeutil.IsStringType(field.GetDataType()) && !typeutil.IsStringType(field.GetElementType()) {
msg := fmt.Sprintf("%s is not of string type", field.GetDataType())
return 0, merr.WrapErrParameterInvalid(schemapb.DataType_VarChar, field.GetDataType(), msg)
}
@ -29,3 +29,23 @@ func GetMaxLength(field *schemapb.FieldSchema) (int64, error) {
}
return int64(maxLength), nil
}
// GetMaxCapacity get max capacity of array field. Maybe also helpful outside.
func GetMaxCapacity(field *schemapb.FieldSchema) (int64, error) {
if !typeutil.IsArrayType(field.GetDataType()) {
msg := fmt.Sprintf("%s is not of array type", field.GetDataType())
return 0, merr.WrapErrParameterInvalid(schemapb.DataType_Array, field.GetDataType(), msg)
}
h := typeutil.NewKvPairs(append(field.GetIndexParams(), field.GetTypeParams()...))
maxCapacityStr, err := h.Get(common.MaxCapacityKey)
if err != nil {
msg := "max capacity not found"
return 0, merr.WrapErrParameterInvalid("max capacity key in type parameters", "not found", msg)
}
maxCapacity, err := strconv.Atoi(maxCapacityStr)
if err != nil {
msg := fmt.Sprintf("invalid max capacity: %s", maxCapacityStr)
return 0, merr.WrapErrParameterInvalid("value of max length should be of int", maxCapacityStr, msg)
}
return int64(maxCapacity), nil
}

View File

@ -57,3 +57,53 @@ func TestGetMaxLength(t *testing.T) {
assert.Equal(t, int64(100), maxLength)
})
}
func TestGetMaxCapacity(t *testing.T) {
t.Run("not array type", func(t *testing.T) {
f := &schemapb.FieldSchema{
DataType: schemapb.DataType_Bool,
}
_, err := GetMaxCapacity(f)
assert.Error(t, err)
})
t.Run("max capacity not found", func(t *testing.T) {
f := &schemapb.FieldSchema{
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Double,
}
_, err := GetMaxCapacity(f)
assert.Error(t, err)
})
t.Run("max capacity not int", func(t *testing.T) {
f := &schemapb.FieldSchema{
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "not_int_aha",
},
},
}
_, err := GetMaxCapacity(f)
assert.Error(t, err)
})
t.Run("normal case", func(t *testing.T) {
f := &schemapb.FieldSchema{
DataType: schemapb.DataType_Array,
ElementType: schemapb.DataType_Int64,
TypeParams: []*commonpb.KeyValuePair{
{
Key: common.MaxCapacityKey,
Value: "100",
},
},
}
maxCap, err := GetMaxCapacity(f)
assert.NoError(t, err)
assert.Equal(t, int64(100), maxCap)
})
}

View File

@ -476,7 +476,8 @@ func AppendFieldData(dst []*schemapb.FieldData, src []*schemapb.FieldData, idx i
if dstScalar.GetArrayData() == nil {
dstScalar.Data = &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{srcScalar.ArrayData.Data[idx]},
Data: []*schemapb.ScalarField{srcScalar.ArrayData.Data[idx]},
ElementType: srcScalar.ArrayData.ElementType,
},
}
} else {

View File

@ -603,7 +603,6 @@ func genFieldData(fieldName string, fieldID int64, fieldType schemapb.DataType,
FieldId: fieldID,
}
case schemapb.DataType_Array:
data := fieldValue.([][]int32)
fieldData = &schemapb.FieldData{
Type: schemapb.DataType_Array,
FieldName: fieldName,
@ -611,7 +610,7 @@ func genFieldData(fieldName string, fieldID int64, fieldType schemapb.DataType,
Scalars: &schemapb.ScalarField{
Data: &schemapb.ScalarField_ArrayData{
ArrayData: &schemapb.ArrayArray{
Data: []*schemapb.ScalarField{},
Data: fieldValue.([]*schemapb.ScalarField),
ElementType: schemapb.DataType_Int32,
},
},
@ -619,17 +618,6 @@ func genFieldData(fieldName string, fieldID int64, fieldType schemapb.DataType,
},
}
for _, list := range data {
arrayList := fieldData.GetScalars().GetArrayData()
arrayList.Data = append(arrayList.Data, &schemapb.ScalarField{
Data: &schemapb.ScalarField_IntData{
IntData: &schemapb.IntArray{
Data: list,
},
},
})
}
case schemapb.DataType_JSON:
fieldData = &schemapb.FieldData{
Type: schemapb.DataType_JSON,
@ -663,6 +651,7 @@ func TestAppendFieldData(t *testing.T) {
BinaryVectorFieldName = "BinaryVectorField"
FloatVectorFieldName = "FloatVectorField"
Float16VectorFieldName = "Float16VectorField"
ArrayFieldName = "ArrayField"
BoolFieldID = common.StartOfUserFieldID + 1
Int32FieldID = common.StartOfUserFieldID + 2
Int64FieldID = common.StartOfUserFieldID + 3
@ -671,6 +660,7 @@ func TestAppendFieldData(t *testing.T) {
BinaryVectorFieldID = common.StartOfUserFieldID + 6
FloatVectorFieldID = common.StartOfUserFieldID + 7
Float16VectorFieldID = common.StartOfUserFieldID + 8
ArrayFieldID = common.StartOfUserFieldID + 9
)
BoolArray := []bool{true, false}
Int32Array := []int32{1, 2}
@ -681,8 +671,24 @@ func TestAppendFieldData(t *testing.T) {
FloatVector := []float32{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 11.0, 22.0, 33.0, 44.0, 55.0, 66.0, 77.0, 88.0}
Float16Vector := []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff,
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}
ArrayArray := []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_IntData{
IntData: &schemapb.IntArray{
Data: []int32{1, 2, 3},
},
},
},
{
Data: &schemapb.ScalarField_IntData{
IntData: &schemapb.IntArray{
Data: []int32{4, 5, 6},
},
},
},
}
result := make([]*schemapb.FieldData, 8)
result := make([]*schemapb.FieldData, 9)
var fieldDataArray1 []*schemapb.FieldData
fieldDataArray1 = append(fieldDataArray1, genFieldData(BoolFieldName, BoolFieldID, schemapb.DataType_Bool, BoolArray[0:1], 1))
fieldDataArray1 = append(fieldDataArray1, genFieldData(Int32FieldName, Int32FieldID, schemapb.DataType_Int32, Int32Array[0:1], 1))
@ -692,6 +698,7 @@ func TestAppendFieldData(t *testing.T) {
fieldDataArray1 = append(fieldDataArray1, genFieldData(BinaryVectorFieldName, BinaryVectorFieldID, schemapb.DataType_BinaryVector, BinaryVector[0:Dim/8], Dim))
fieldDataArray1 = append(fieldDataArray1, genFieldData(FloatVectorFieldName, FloatVectorFieldID, schemapb.DataType_FloatVector, FloatVector[0:Dim], Dim))
fieldDataArray1 = append(fieldDataArray1, genFieldData(Float16VectorFieldName, Float16VectorFieldID, schemapb.DataType_Float16Vector, Float16Vector[0:Dim*2], Dim))
fieldDataArray1 = append(fieldDataArray1, genFieldData(ArrayFieldName, ArrayFieldID, schemapb.DataType_Array, ArrayArray[0:1], 1))
var fieldDataArray2 []*schemapb.FieldData
fieldDataArray2 = append(fieldDataArray2, genFieldData(BoolFieldName, BoolFieldID, schemapb.DataType_Bool, BoolArray[1:2], 1))
@ -702,6 +709,7 @@ func TestAppendFieldData(t *testing.T) {
fieldDataArray2 = append(fieldDataArray2, genFieldData(BinaryVectorFieldName, BinaryVectorFieldID, schemapb.DataType_BinaryVector, BinaryVector[Dim/8:2*Dim/8], Dim))
fieldDataArray2 = append(fieldDataArray2, genFieldData(FloatVectorFieldName, FloatVectorFieldID, schemapb.DataType_FloatVector, FloatVector[Dim:2*Dim], Dim))
fieldDataArray2 = append(fieldDataArray2, genFieldData(Float16VectorFieldName, Float16VectorFieldID, schemapb.DataType_Float16Vector, Float16Vector[2*Dim:4*Dim], Dim))
fieldDataArray2 = append(fieldDataArray2, genFieldData(ArrayFieldName, ArrayFieldID, schemapb.DataType_Array, ArrayArray[1:2], 1))
AppendFieldData(result, fieldDataArray1, 0)
AppendFieldData(result, fieldDataArray2, 0)
@ -714,6 +722,7 @@ func TestAppendFieldData(t *testing.T) {
assert.Equal(t, BinaryVector, result[5].GetVectors().Data.(*schemapb.VectorField_BinaryVector).BinaryVector)
assert.Equal(t, FloatVector, result[6].GetVectors().GetFloatVector().Data)
assert.Equal(t, Float16Vector, result[7].GetVectors().Data.(*schemapb.VectorField_Float16Vector).Float16Vector)
assert.Equal(t, ArrayArray, result[8].GetScalars().GetArrayData().Data)
}
func TestDeleteFieldData(t *testing.T) {
@ -997,7 +1006,22 @@ func TestCalcColumnSize(t *testing.T) {
105: []float64{0, 1},
106: []string{"0", "1"},
107: []float32{0, 1, 2, 3},
109: [][]int32{{1, 2, 3}, {4, 5, 6}},
109: []*schemapb.ScalarField{
{
Data: &schemapb.ScalarField_IntData{
IntData: &schemapb.IntArray{
Data: []int32{1, 2, 3},
},
},
},
{
Data: &schemapb.ScalarField_IntData{
IntData: &schemapb.IntArray{
Data: []int32{4, 5, 6},
},
},
},
},
110: [][]byte{[]byte(`{"key":"value"}`), []byte(`{"hello":"world"}`)},
}
schema := &schemapb.CollectionSchema{
@ -1085,9 +1109,9 @@ func TestCalcColumnSize(t *testing.T) {
expected += len(v)
}
case schemapb.DataType_Array:
data := values.([][]int32)
data := values.([]*schemapb.ScalarField)
for _, v := range data {
expected += binary.Size(v)
expected += binary.Size(v.GetIntData().GetData())
}
case schemapb.DataType_JSON:
data := values.([][]byte)