Skip to content

Commit

Permalink
[Go & Cpp] Fix vector type check
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby committed Oct 8, 2023
1 parent c58990f commit bd92645
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cpp/src/storage/options.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "storage/options.h"
#include <arrow/type_fwd.h>
#include "arrow/type.h"
#include "common/status.h"

Expand Down Expand Up @@ -30,7 +31,7 @@ Status SchemaOptions::Validate(const arrow::Schema* schema) {
auto vector_field = schema->GetFieldByName(vector_column);
if (!vector_field) {
return Status::InvalidArgument("vector column is not exist");
} else if (vector_field->type()->id() != arrow::Type::FIXED_SIZE_BINARY) {
} else if (vector_field->type()->id() != arrow::Type::FIXED_SIZE_BINARY && vector_field->type()->id() != arrow::Type::FIXED_SIZE_LIST) {
return Status::InvalidArgument("vector column is not fixed size binary");
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion go/storage/schema/schema_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (o *SchemaOptions) Validate(schema *arrow.Schema) error {
vectorField, b := schema.FieldsByName(o.VectorColumn)
if !b {
return ErrVectorColumnNotFound
} else if vectorField[0].Type.ID() != arrow.FIXED_SIZE_BINARY {
} else if vectorField[0].Type.ID() != arrow.FIXED_SIZE_BINARY || vectorField[0].Type.ID() != arrow.FIXED_SIZE_LIST {
return ErrVectorColumnType
}
} else {
Expand Down

0 comments on commit bd92645

Please sign in to comment.