|
3 | 3 | #include "knn-distance.h" |
4 | 4 |
|
5 | 5 | #include <ydb/library/yql/public/udf/udf_helpers.h> |
| 6 | +#include <ydb/library/yql/public/udf/udf_type_printer.h> |
6 | 7 |
|
7 | 8 | #include <util/generic/buffer.h> |
8 | 9 | #include <util/generic/queue.h> |
@@ -164,7 +165,11 @@ class TToBinaryStringBit: public TMultiSignatureBase<TToBinaryStringBit> { |
164 | 165 | } |
165 | 166 | } |
166 | 167 | if (type == EType::None) { |
167 | | - builder.SetError("'List<Double|Float|Uint8|Int8>' is expected"); |
| 168 | + TStringBuilder sb; |
| 169 | + sb << "'List<Double|Float|Uint8|Int8>' is expected but got '"; |
| 170 | + TTypePrinter(*typeInfoHelper, argsTuple.GetElementType(0)).Out(sb.Out); |
| 171 | + sb << "'"; |
| 172 | + builder.SetError(std::move(sb)); |
168 | 173 | return true; |
169 | 174 | } |
170 | 175 |
|
@@ -229,7 +234,11 @@ class TFloatFromBinaryString: public TMultiSignatureBase<TFloatFromBinaryString> |
229 | 234 | auto argType = argsTuple.GetElementType(0); |
230 | 235 | auto argTag = GetArg(*typeInfoHelper, argType, builder); |
231 | 236 | if (!ValidTag(argTag, {TagStoredVector, TagFloatVector, TagInt8Vector, TagUint8Vector})) { |
232 | | - builder.SetError("A result from 'ToBinaryString[Float|Int8|Uint8]' is expected as an argument"); |
| 237 | + TStringBuilder sb; |
| 238 | + sb << "A result from 'ToBinaryString[Float|Int8|Uint8]' is expected as an argument but got '"; |
| 239 | + TTypePrinter(*typeInfoHelper, argsTuple.GetElementType(0)).Out(sb.Out); |
| 240 | + sb << "'"; |
| 241 | + builder.SetError(std::move(sb)); |
233 | 242 | return true; |
234 | 243 | } |
235 | 244 |
|
@@ -279,7 +288,13 @@ class TDistanceBase: public TMultiSignatureBase<Derived> { |
279 | 288 |
|
280 | 289 | if (!Base::ValidTag(arg0Tag, {TagStoredVector, TagFloatVector, TagInt8Vector, TagUint8Vector, TagBitVector}) || |
281 | 290 | !Base::ValidTag(arg1Tag, {TagStoredVector, TagFloatVector, TagInt8Vector, TagUint8Vector, TagBitVector})) { |
282 | | - builder.SetError("A result from 'ToBinaryString[Float|Int8|Uint8]' is expected as an argument"); |
| 291 | + TStringBuilder sb; |
| 292 | + sb << "Both arguments are expected to be results from 'ToBinaryString[Float|Int8|Uint8]' but got '"; |
| 293 | + TTypePrinter(*typeInfoHelper, argsTuple.GetElementType(0)).Out(sb.Out); |
| 294 | + sb << "' and '"; |
| 295 | + TTypePrinter(*typeInfoHelper, argsTuple.GetElementType(1)).Out(sb.Out); |
| 296 | + sb << "'"; |
| 297 | + builder.SetError(std::move(sb)); |
283 | 298 | return true; |
284 | 299 | } |
285 | 300 |
|
|
0 commit comments