Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
1446cd54
M
milvus
项目概览
milvus
/
milvus
大约 1 年 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1446cd54
编写于
4月 07, 2021
作者:
F
FluorineDog
提交者:
yefu.chen
4月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix flat unsupported bug
Signed-off-by:
N
FluorineDog
<
guilin.gou@zilliz.com
>
上级
bfb7ca0d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
13 addition
and
12 deletion
+13
-12
internal/core/src/common/Schema.cpp
internal/core/src/common/Schema.cpp
+8
-8
internal/core/src/common/Schema.h
internal/core/src/common/Schema.h
+5
-1
internal/core/src/common/Types.cpp
internal/core/src/common/Types.cpp
+0
-3
未找到文件。
internal/core/src/common/Schema.cpp
浏览文件 @
1446cd54
...
@@ -11,8 +11,10 @@
...
@@ -11,8 +11,10 @@
#include "common/Schema.h"
#include "common/Schema.h"
#include <google/protobuf/text_format.h>
#include <google/protobuf/text_format.h>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/lexical_cast.hpp>
#include "common/SystemProperty.h"
#include "common/SystemProperty.h"
#include <optional>
namespace
milvus
{
namespace
milvus
{
...
@@ -57,17 +59,15 @@ Schema::ParseFrom(const milvus::proto::schema::CollectionSchema& schema_proto) {
...
@@ -57,17 +59,15 @@ Schema::ParseFrom(const milvus::proto::schema::CollectionSchema& schema_proto) {
if
(
datatype_is_vector
(
data_type
))
{
if
(
datatype_is_vector
(
data_type
))
{
auto
type_map
=
RepeatedKeyValToMap
(
child
.
type_params
());
auto
type_map
=
RepeatedKeyValToMap
(
child
.
type_params
());
auto
index_map
=
RepeatedKeyValToMap
(
child
.
index_params
());
auto
index_map
=
RepeatedKeyValToMap
(
child
.
index_params
());
if
(
!
index_map
.
count
(
"metric_type"
))
{
auto
default_metric_type
=
data_type
==
DataType
::
VECTOR_FLOAT
?
MetricType
::
METRIC_L2
:
MetricType
::
METRIC_Jaccard
;
index_map
[
"metric_type"
]
=
MetricTypeToName
(
default_metric_type
);
}
AssertInfo
(
type_map
.
count
(
"dim"
),
"dim not found"
);
AssertInfo
(
type_map
.
count
(
"dim"
),
"dim not found"
);
auto
dim
=
boost
::
lexical_cast
<
int64_t
>
(
type_map
.
at
(
"dim"
));
auto
dim
=
boost
::
lexical_cast
<
int64_t
>
(
type_map
.
at
(
"dim"
));
AssertInfo
(
index_map
.
count
(
"metric_type"
),
"index not found"
);
if
(
!
index_map
.
count
(
"metric_type"
))
{
schema
->
AddField
(
name
,
field_id
,
data_type
,
dim
,
std
::
nullopt
);
}
else
{
auto
metric_type
=
GetMetricType
(
index_map
.
at
(
"metric_type"
));
auto
metric_type
=
GetMetricType
(
index_map
.
at
(
"metric_type"
));
schema
->
AddField
(
name
,
field_id
,
data_type
,
dim
,
metric_type
);
schema
->
AddField
(
name
,
field_id
,
data_type
,
dim
,
metric_type
);
}
}
else
{
}
else
{
schema
->
AddField
(
name
,
field_id
,
data_type
);
schema
->
AddField
(
name
,
field_id
,
data_type
);
}
}
...
...
internal/core/src/common/Schema.h
浏览文件 @
1446cd54
...
@@ -52,7 +52,11 @@ class Schema {
...
@@ -52,7 +52,11 @@ class Schema {
// vector type
// vector type
void
void
AddField
(
const
FieldName
&
name
,
const
FieldId
id
,
DataType
data_type
,
int64_t
dim
,
MetricType
metric_type
)
{
AddField
(
const
FieldName
&
name
,
const
FieldId
id
,
DataType
data_type
,
int64_t
dim
,
std
::
optional
<
MetricType
>
metric_type
)
{
auto
field_meta
=
FieldMeta
(
name
,
id
,
data_type
,
dim
,
metric_type
);
auto
field_meta
=
FieldMeta
(
name
,
id
,
data_type
,
dim
,
metric_type
);
this
->
AddField
(
std
::
move
(
field_meta
));
this
->
AddField
(
std
::
move
(
field_meta
));
}
}
...
...
internal/core/src/common/Types.cpp
浏览文件 @
1446cd54
...
@@ -9,9 +9,6 @@
...
@@ -9,9 +9,6 @@
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// 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
// or implied. See the License for the specific language governing permissions and limitations under the License
//
// Created by mike on 12/3/20.
//
#include "common/Types.h"
#include "common/Types.h"
#include <knowhere/index/vector_index/helpers/IndexParameter.h>
#include <knowhere/index/vector_index/helpers/IndexParameter.h>
#include "exceptions/EasyAssert.h"
#include "exceptions/EasyAssert.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录