@@ -31,24 +31,24 @@ using namespace NUdf;
31
31
32
32
namespace {
33
33
34
- #define STRING_UDF (udfName, function ) \
35
- BEGIN_SIMPLE_STRICT_ARROW_UDF (T##udfName, char *(TAutoMap<char *>)) { \
36
- const TString input (args[0 ].AsStringRef ()); \
37
- const auto & result = function (input); \
38
- return valueBuilder->NewString (result); \
39
- } \
40
- \
41
- struct T ##udfName##KernelExec \
42
- : public TUnaryKernelExec<T##udfName##KernelExec> \
43
- { \
44
- template <typename TSink> \
45
- static void Process (TBlockItem arg1, const TSink& sink) { \
46
- const TString input (arg1.AsStringRef ()); \
47
- const auto & result = function (input); \
48
- sink (TBlockItem (result)); \
49
- } \
50
- }; \
51
- \
34
+ #define STRING_UDF (udfName, function ) \
35
+ BEGIN_SIMPLE_STRICT_ARROW_UDF (T##udfName, char *(TAutoMap<char *>)) { \
36
+ const TString input (args[0 ].AsStringRef ()); \
37
+ const auto & result = function (input); \
38
+ return valueBuilder->NewString (result); \
39
+ } \
40
+ \
41
+ struct T ##udfName##KernelExec \
42
+ : public TUnaryKernelExec<T##udfName##KernelExec> \
43
+ { \
44
+ template <typename TSink> \
45
+ static void Process (TBlockItem arg1, const IValueBuilder&, const TSink& sink) { \
46
+ const TString input (arg1.AsStringRef ()); \
47
+ const auto & result = function (input); \
48
+ sink (TBlockItem (result)); \
49
+ } \
50
+ }; \
51
+ \
52
52
END_SIMPLE_ARROW_UDF (T##udfName, T##udfName##KernelExec::Do)
53
53
54
54
@@ -69,7 +69,7 @@ namespace {
69
69
: public TUnaryKernelExec<T##udfName##KernelExec> \
70
70
{ \
71
71
template <typename TSink> \
72
- static void Process (TBlockItem arg1, const TSink& sink) { \
72
+ static void Process (TBlockItem arg1, const IValueBuilder&, const TSink& sink) { \
73
73
if (!arg1) { \
74
74
return sink (TBlockItem ()); \
75
75
} \
@@ -126,7 +126,7 @@ namespace {
126
126
: public TUnaryKernelExec<T##udfName##KernelExec> \
127
127
{ \
128
128
template <typename TSink> \
129
- static void Process (TBlockItem arg1, const TSink& sink) { \
129
+ static void Process (TBlockItem arg1, const IValueBuilder&, const TSink& sink) { \
130
130
TString input (arg1.AsStringRef ()); \
131
131
if (input.function ()) { \
132
132
sink (TBlockItem (input)); \
@@ -185,7 +185,7 @@ namespace {
185
185
: public TUnaryKernelExec<T##function##KernelExec> \
186
186
{ \
187
187
template <typename TSink> \
188
- static void Process (TBlockItem arg1, const TSink& sink) { \
188
+ static void Process (TBlockItem arg1, const IValueBuilder&, const TSink& sink) { \
189
189
if (arg1) { \
190
190
const TStringBuf input (arg1.AsStringRef ()); \
191
191
bool result = true ; \
@@ -231,7 +231,7 @@ namespace {
231
231
: public TGenericKernelExec<T##function##KernelExec, 3 > \
232
232
{ \
233
233
template <typename TSink> \
234
- static void Process (TBlockItem args, const TSink& sink) { \
234
+ static void Process (TBlockItem args, const IValueBuilder&, const TSink& sink) { \
235
235
TStringStream result; \
236
236
const TStringBuf input (args.GetElement (0 ).AsStringRef ()); \
237
237
char paddingSymbol = ' ' ; \
@@ -264,7 +264,7 @@ namespace {
264
264
: public TUnaryKernelExec<T##function##KernelExec> \
265
265
{ \
266
266
template <typename TSink> \
267
- static void Process (TBlockItem arg1, const TSink& sink) { \
267
+ static void Process (TBlockItem arg1, const IValueBuilder&, const TSink& sink) { \
268
268
TStringStream result; \
269
269
result << function (arg1.Get <argType>()); \
270
270
sink (TBlockItem (TStringRef (result.Data (), result.Size ()))); \
@@ -285,7 +285,7 @@ namespace {
285
285
: public TUnaryKernelExec<T##function##KernelExec> \
286
286
{ \
287
287
template <typename TSink> \
288
- static void Process (TBlockItem arg1, const TSink& sink) { \
288
+ static void Process (TBlockItem arg1, const IValueBuilder&, const TSink& sink) { \
289
289
TStringStream result; \
290
290
const TStringBuf input (arg1.AsStringRef ()); \
291
291
result << function (input); \
@@ -307,7 +307,7 @@ namespace {
307
307
: public TUnaryKernelExec<T##udfName##KernelExec> \
308
308
{ \
309
309
template <typename TSink> \
310
- static void Process (TBlockItem arg1, const TSink& sink) { \
310
+ static void Process (TBlockItem arg1, const IValueBuilder&, const TSink& sink) { \
311
311
TStringStream result; \
312
312
result << HumanReadableSize (arg1.Get <ui64>(), hrSize); \
313
313
sink (TBlockItem (TStringRef (result.Data (), result.Size ()))); \
@@ -414,7 +414,7 @@ namespace {
414
414
: public TBinaryKernelExec<TCollapseTextKernelExec>
415
415
{
416
416
template <typename TSink>
417
- static void Process (TBlockItem arg1, TBlockItem arg2, const TSink& sink) {
417
+ static void Process (TBlockItem arg1, TBlockItem arg2, const IValueBuilder&, const TSink& sink) {
418
418
TString input (arg1.AsStringRef ());
419
419
ui64 maxLength = arg2.Get <ui64>();
420
420
CollapseText (input, maxLength);
@@ -437,7 +437,7 @@ namespace {
437
437
438
438
struct TContainsKernelExec : public TBinaryKernelExec <TContainsKernelExec> {
439
439
template <typename TSink>
440
- static void Process (TBlockItem arg1, TBlockItem arg2, const TSink& sink) {
440
+ static void Process (TBlockItem arg1, TBlockItem arg2, const IValueBuilder&, const TSink& sink) {
441
441
if (!arg1)
442
442
return sink (TBlockItem (false ));
443
443
@@ -461,7 +461,7 @@ namespace {
461
461
: public TGenericKernelExec<TReplaceAllKernelExec, 3 >
462
462
{
463
463
template <typename TSink>
464
- static void Process (TBlockItem args, const TSink& sink) {
464
+ static void Process (TBlockItem args, const IValueBuilder&, const TSink& sink) {
465
465
TString result (args.GetElement (0 ).AsStringRef ());
466
466
const TStringBuf what (args.GetElement (1 ).AsStringRef ());
467
467
const TStringBuf with (args.GetElement (2 ).AsStringRef ());
@@ -490,7 +490,7 @@ namespace {
490
490
: public TGenericKernelExec<TReplaceFirstKernelExec, 3 >
491
491
{
492
492
template <typename TSink>
493
- static void Process (TBlockItem args, const TSink& sink) {
493
+ static void Process (TBlockItem args, const IValueBuilder&, const TSink& sink) {
494
494
std::string result (args.GetElement (0 ).AsStringRef ());
495
495
const std::string_view what (args.GetElement (1 ).AsStringRef ());
496
496
const std::string_view with (args.GetElement (2 ).AsStringRef ());
@@ -519,7 +519,7 @@ namespace {
519
519
: public TGenericKernelExec<TReplaceLastKernelExec, 3 >
520
520
{
521
521
template <typename TSink>
522
- static void Process (TBlockItem args, const TSink& sink) {
522
+ static void Process (TBlockItem args, const IValueBuilder&, const TSink& sink) {
523
523
std::string result (args.GetElement (0 ).AsStringRef ());
524
524
const std::string_view what (args.GetElement (1 ).AsStringRef ());
525
525
const std::string_view with (args.GetElement (2 ).AsStringRef ());
@@ -558,7 +558,7 @@ namespace {
558
558
: public TBinaryKernelExec<TRemoveAllKernelExec>
559
559
{
560
560
template <typename TSink>
561
- static void Process (TBlockItem arg1, TBlockItem arg2, const TSink& sink) {
561
+ static void Process (TBlockItem arg1, TBlockItem arg2, const IValueBuilder&, const TSink& sink) {
562
562
std::string input (arg1.AsStringRef ());
563
563
const std::string_view remove (arg2.AsStringRef ());
564
564
std::array<bool , 256 > chars{};
@@ -602,7 +602,7 @@ namespace {
602
602
: public TBinaryKernelExec<TRemoveFirstKernelExec>
603
603
{
604
604
template <typename TSink>
605
- static void Process (TBlockItem arg1, TBlockItem arg2, const TSink& sink) {
605
+ static void Process (TBlockItem arg1, TBlockItem arg2, const IValueBuilder&, const TSink& sink) {
606
606
std::string input (arg1.AsStringRef ());
607
607
const std::string_view remove (arg2.AsStringRef ());
608
608
std::array<bool , 256 > chars{};
@@ -642,7 +642,7 @@ namespace {
642
642
: public TBinaryKernelExec<TRemoveLastKernelExec>
643
643
{
644
644
template <typename TSink>
645
- static void Process (TBlockItem arg1, TBlockItem arg2, const TSink& sink) {
645
+ static void Process (TBlockItem arg1, TBlockItem arg2, const IValueBuilder&, const TSink& sink) {
646
646
std::string input (arg1.AsStringRef ());
647
647
const std::string_view remove (arg2.AsStringRef ());
648
648
std::array<bool , 256 > chars{};
@@ -789,7 +789,7 @@ namespace {
789
789
790
790
struct TLevensteinDistanceKernelExec : public TBinaryKernelExec <TLevensteinDistanceKernelExec> {
791
791
template <typename TSink>
792
- static void Process (TBlockItem arg1, TBlockItem arg2, const TSink& sink) {
792
+ static void Process (TBlockItem arg1, TBlockItem arg2, const IValueBuilder&, const TSink& sink) {
793
793
const std::string_view left (arg1.AsStringRef ());
794
794
const std::string_view right (arg2.AsStringRef ());
795
795
const ui64 result = NLevenshtein::Distance (left, right);
@@ -811,7 +811,7 @@ namespace {
811
811
: public TUnaryKernelExec<THumanReadableDurationKernelExec>
812
812
{
813
813
template <typename TSink>
814
- static void Process (TBlockItem arg1, const TSink& sink) {
814
+ static void Process (TBlockItem arg1, const IValueBuilder&, const TSink& sink) {
815
815
TStringStream result;
816
816
result << HumanReadable (TDuration::MicroSeconds (arg1.Get <ui64>()));
817
817
sink (TBlockItem (TStringRef (result.Data (), result.Size ())));
@@ -829,7 +829,7 @@ namespace {
829
829
830
830
struct TPrecKernelExec : public TBinaryKernelExec <TPrecKernelExec> {
831
831
template <typename TSink>
832
- static void Process (TBlockItem arg1, TBlockItem arg2, const TSink& sink) {
832
+ static void Process (TBlockItem arg1, TBlockItem arg2, const IValueBuilder&, const TSink& sink) {
833
833
TStringStream result;
834
834
result << Prec (arg1.Get <double >(), arg2.Get <ui64>());
835
835
sink (TBlockItem (TStringRef (result.Data (), result.Size ())));
0 commit comments