Skip to content

Commit 5dc756d

Browse files
committed
Wrong format fix
1 parent 6aecd9a commit 5dc756d

File tree

8 files changed

+114
-14
lines changed

8 files changed

+114
-14
lines changed

packages.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[
2+
{
3+
"branch": "BitIndex",
4+
"package_name": "ydb",
5+
"package_path": "ydb/tools/ydbd_slice/image/pkg.json",
6+
"package_version": "azevaykin-latest",
7+
"revision": "6aecd9a9d6e9fab15f80e8340b1f0defc418750a",
8+
"sandbox_task_id": 0,
9+
"svn_revision": "-1",
10+
"package_full_name": "ydb.azevaykin-latest",
11+
"docker_image": "cr.yandex/crpbo4q9lbgkn85vr1rm/ydb:azevaykin-latest",
12+
"name": "ydb",
13+
"version": "azevaykin-latest",
14+
"path": "/home-big/azevaykin/github/ydb.azevaykin-latest.tar.gz",
15+
"debug_path": null
16+
}
17+
]

ydb.azevaykin-latest.tar.gz

125 Bytes
Binary file not shown.

ydb/library/yql/udfs/common/knn/knn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ using namespace NYql;
1212
using namespace NYql::NUdf;
1313

1414

15-
SIMPLE_STRICT_UDF_WITH_OPTIONAL_ARGS(TToBinaryString, char*(TAutoMap<TListType<float>>, TOptional<const char*>), 1) {
15+
SIMPLE_STRICT_UDF_WITH_OPTIONAL_ARGS(TToBinaryString, TOptional<char*>(TAutoMap<TListType<float>>, TOptional<const char*>), 1) {
1616
const TUnboxedValuePod x = args[0];
1717

1818
EFormat format = EFormat::FloatVector;
1919
if(args[1]) {
2020
const TStringRef formatStr = args[1].AsStringRef();
2121
if (formatStr == "float")
2222
format = EFormat::FloatVector;
23-
if (formatStr == "byte")
23+
else if (formatStr == "byte")
2424
format = EFormat::ByteVector;
2525
else if (formatStr == "bit")
2626
format = EFormat::BitVector;

ydb/library/yql/udfs/common/knn/test/canondata/test.test_DeserializationError_/results.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,63 @@
6262
]
6363
}
6464
]
65+
};
66+
{
67+
"Write" = [
68+
{
69+
"Type" = [
70+
"ListType";
71+
[
72+
"StructType";
73+
[
74+
[
75+
"column0";
76+
[
77+
"OptionalType";
78+
[
79+
"DataType";
80+
"String"
81+
]
82+
]
83+
]
84+
]
85+
]
86+
];
87+
"Data" = [
88+
[
89+
#
90+
]
91+
]
92+
}
93+
]
94+
};
95+
{
96+
"Write" = [
97+
{
98+
"Type" = [
99+
"ListType";
100+
[
101+
"StructType";
102+
[
103+
[
104+
"column0";
105+
[
106+
"OptionalType";
107+
[
108+
"DataType";
109+
"Float"
110+
]
111+
]
112+
]
113+
]
114+
]
115+
];
116+
"Data" = [
117+
[
118+
#
119+
]
120+
]
121+
}
122+
]
65123
}
66124
]

ydb/library/yql/udfs/common/knn/test/canondata/test.test_FloatByteSerialization_/results.txt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@
1010
[
1111
"column0";
1212
[
13-
"DataType";
14-
"String"
13+
"OptionalType";
14+
[
15+
"DataType";
16+
"String"
17+
]
1518
]
1619
]
1720
]
1821
]
1922
];
2023
"Data" = [
2124
[
22-
"\1\2\3\4\5\2"
25+
[
26+
"\1\2\3\4\5\2"
27+
]
2328
]
2429
]
2530
}
@@ -36,16 +41,21 @@
3641
[
3742
"column0";
3843
[
39-
"DataType";
40-
"Bool"
44+
"OptionalType";
45+
[
46+
"DataType";
47+
"Bool"
48+
]
4149
]
4250
]
4351
]
4452
]
4553
];
4654
"Data" = [
4755
[
48-
%true
56+
[
57+
%true
58+
]
4959
]
5060
]
5161
}

ydb/library/yql/udfs/common/knn/test/canondata/test.test_LazyListSerialization_/results.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
[
1111
"column0";
1212
[
13-
"DataType";
14-
"String"
13+
"OptionalType";
14+
[
15+
"DataType";
16+
"String"
17+
]
1518
]
1619
]
1720
]
@@ -20,7 +23,9 @@
2023
"Data" = [
2124
[
2225
[
23-
"AACAPwAAAEAAAEBAAACAQAAAoEAB"
26+
[
27+
"AACAPwAAAEAAAEBAAACAQAAAoEAB"
28+
]
2429
]
2530
]
2631
]

ydb/library/yql/udfs/common/knn/test/canondata/test.test_ListSerialization_/results.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
[
1111
"column0";
1212
[
13-
"DataType";
14-
"String"
13+
"OptionalType";
14+
[
15+
"DataType";
16+
"String"
17+
]
1518
]
1619
]
1720
]
@@ -20,7 +23,9 @@
2023
"Data" = [
2124
[
2225
[
23-
"mpmZPzMzE0CamVlAAACQQDMzs0AB"
26+
[
27+
"mpmZPzMzE0CamVlAAACQQDMzs0AB"
28+
]
2429
]
2530
]
2631
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
select Knn::FromBinaryString("");
22
select Knn::FromBinaryString("WrongString");
33

4+
--wrong format
5+
$vector_wrong_format = Knn::ToBinaryString([1.0f, 2.0f, 3.0f], "wrong format");
6+
select $vector_wrong_format;
7+
select Knn::CosineDistance($vector_wrong_format, $vector_wrong_format);
8+

0 commit comments

Comments
 (0)