diff options
author | imunkin <imunkin@yandex-team.com> | 2025-07-25 14:36:33 +0300 |
---|---|---|
committer | imunkin <imunkin@yandex-team.com> | 2025-07-25 15:25:21 +0300 |
commit | 835b6519eb8e218bb0c84d8d7827bf9fbe7893c8 (patch) | |
tree | 24c4778644641d8c2be1aa8f1333269d683db984 | |
parent | c439c8555866bacd34054603e87433b69becd631 (diff) | |
download | ydb-835b6519eb8e218bb0c84d8d7827bf9fbe7893c8.tar.gz |
YQL-20241: Use ASCIIZ strings for UdfTerminate (essential udfs)
commit_hash:1a11133ec66e71b6c798178453a5ab43cdc6761c
24 files changed, 158 insertions, 158 deletions
diff --git a/yql/essentials/udfs/common/datetime2/datetime_udf.cpp b/yql/essentials/udfs/common/datetime2/datetime_udf.cpp index 952b369d094..acc42ad2cbe 100644 --- a/yql/essentials/udfs/common/datetime2/datetime_udf.cpp +++ b/yql/essentials/udfs/common/datetime2/datetime_udf.cpp @@ -783,7 +783,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: Split(arg, Reference<TMResourceName>(res), *valueBuilder); sink(res); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << e.what()).data()); + UdfTerminate((TStringBuilder() << e.what()).c_str()); } } }; @@ -928,7 +928,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromDate(builder, args[0].Get<ui16>()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -945,7 +945,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromDate32(valueBuilder->GetDateBuilder(), args[0].Get<i32>()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -963,7 +963,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromDatetime(builder, args[0].Get<ui32>()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -980,7 +980,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromDatetime64(valueBuilder->GetDateBuilder(), args[0].Get<i64>()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -998,7 +998,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromTimestamp(builder, args[0].Get<ui64>()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -1015,7 +1015,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromTimestamp64(valueBuilder->GetDateBuilder(), args[0].Get<i64>()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -1033,7 +1033,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromDate(builder, args[0].Get<ui16>(), args[0].GetTimezoneId()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -1051,7 +1051,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromDate32(builder, args[0].Get<i32>(), args[0].GetTimezoneId()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -1070,7 +1070,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromDatetime(builder, args[0].Get<ui32>(), args[0].GetTimezoneId()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -1088,7 +1088,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromDatetime64(builder, args[0].Get<i64>(), args[0].GetTimezoneId()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -1107,7 +1107,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromTimestamp(builder, args[0].Get<ui64>(), args[0].GetTimezoneId()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -1125,7 +1125,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: storage.FromTimestamp64(builder, args[0].Get<i64>(), args[0].GetTimezoneId()); return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -1212,7 +1212,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: UdfTerminate((TStringBuilder() << Pos_ << "Timestamp " << storage.ToString() << " cannot be casted to TzDate" - ).data()); + ).c_str()); } } END_SIMPLE_ARROW_UDF(TMakeTzDate, TMakeDateKernelExec<TTzDate>::Do); @@ -1271,7 +1271,7 @@ TUnboxedValuePod DoAddYears(const TUnboxedValuePod& date, i64 years, const NUdf: UdfTerminate((TStringBuilder() << Pos_ << "Timestamp " << storage.ToString() << " cannot be casted to TzDate32" - ).data()); + ).c_str()); } } @@ -2780,7 +2780,7 @@ private: return TUnboxedValuePod(new TImpl(Pos_, args[0], alwaysWriteFractionalSeconds)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } class TImpl : public TBoxedValue { @@ -2812,7 +2812,7 @@ private: return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -3076,7 +3076,7 @@ private: TUnboxedValue Run(const IValueBuilder*, const TUnboxedValuePod* args) const final try { return TUnboxedValuePod(new TParse(args[0], Pos_)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } const TSourcePosition Pos_; @@ -3153,7 +3153,7 @@ private: } return result; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/file/file_udf.cpp b/yql/essentials/udfs/common/file/file_udf.cpp index ee09b2af20d..d499e85529e 100644 --- a/yql/essentials/udfs/common/file/file_udf.cpp +++ b/yql/essentials/udfs/common/file/file_udf.cpp @@ -379,11 +379,11 @@ namespace { TStreamMeta::TPtr metaPtr(new TStreamMeta(filePath)); auto pos = Pos_; auto terminateFunc = [pos](const TString& message) { - UdfTerminate((TStringBuilder() << pos << " " << message).data()); + UdfTerminate((TStringBuilder() << pos << " " << message).c_str()); }; return TUnboxedValuePod(new TListByLineBoxedValue<TUserType>(metaPtr, *valueBuilder, terminateFunc)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -437,7 +437,7 @@ namespace { items[IndexA_] = ValueBuilder_.NewString(attrs); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } return true; } @@ -534,7 +534,7 @@ namespace { TString filePath(args[0].AsStringRef()); return TUnboxedValuePod(new TList(IndexP_, IndexT_, IndexA_, *valueBuilder, Pos_, filePath)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/histogram/histogram_udf.cpp b/yql/essentials/udfs/common/histogram/histogram_udf.cpp index 1242c60927f..731b5956ed8 100644 --- a/yql/essentials/udfs/common/histogram/histogram_udf.cpp +++ b/yql/essentials/udfs/common/histogram/histogram_udf.cpp @@ -136,7 +136,7 @@ namespace { histogram->Get()->Add(args[0].Get<double>(), args[1].Get<double>()); return TUnboxedValuePod(histogram.Release()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -187,7 +187,7 @@ namespace { resource->Get()->Add(args[1].Get<double>(), args[2].Get<double>()); return TUnboxedValuePod(args[0]); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -239,7 +239,7 @@ namespace { Y_PROTOBUF_SUPPRESS_NODISCARD proto.SerializeToString(&result); return valueBuilder->NewString(result); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -292,7 +292,7 @@ namespace { histogram->Get()->FromProto(proto); return TUnboxedValuePod(histogram.Release()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -344,7 +344,7 @@ namespace { static_cast<THistogramResource*>(args[1].AsBoxed().Get())->Get()->Merge(proto, 1.0); return TUnboxedValuePod(args[1]); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -483,7 +483,7 @@ namespace { histogram->Get()->Add(args[0].Get<double>(), 1.0); return TUnboxedValuePod(histogram.Release()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -519,7 +519,7 @@ namespace { histogram->Get()->FromProto(proto); return TUnboxedValuePod(histogram.Release()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -553,7 +553,7 @@ namespace { histogram->Get()->Add(args[0].Get<double>(), 1.0); return TUnboxedValuePod(histogram.Release()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -589,7 +589,7 @@ namespace { histogram->Get()->FromProto(proto); return TUnboxedValuePod(histogram.Release()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -903,7 +903,7 @@ namespace { return GetResult(histogram, args); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/hyperloglog/hyperloglog_udf.cpp b/yql/essentials/udfs/common/hyperloglog/hyperloglog_udf.cpp index 744c25feac6..39d17f2ec44 100644 --- a/yql/essentials/udfs/common/hyperloglog/hyperloglog_udf.cpp +++ b/yql/essentials/udfs/common/hyperloglog/hyperloglog_udf.cpp @@ -149,7 +149,7 @@ namespace { hll->Get()->Update(args[0].Get<ui64>()); return TUnboxedValuePod(hll.Release()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -196,7 +196,7 @@ namespace { resource->Get()->Update(args[1].Get<ui64>()); return TUnboxedValuePod(args[0]); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -244,7 +244,7 @@ namespace { static_cast<THyperLogLogResource*>(args[0].AsBoxed().Get())->Get()->Save(result); return valueBuilder->NewString(result.Str()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -292,7 +292,7 @@ namespace { THolder<THyperLogLogResource> hll(new THyperLogLogResource(THybridHyperLogLog::Load(input))); return TUnboxedValuePod(hll.Release()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -339,7 +339,7 @@ namespace { static_cast<THyperLogLogResource*>(args[1].AsBoxed().Get())->Get()->Merge(*left); return TUnboxedValuePod(args[1]); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/hyperscan/hyperscan_udf.cpp b/yql/essentials/udfs/common/hyperscan/hyperscan_udf.cpp index 45c64e73a70..c641407bc4c 100644 --- a/yql/essentials/udfs/common/hyperscan/hyperscan_udf.cpp +++ b/yql/essentials/udfs/common/hyperscan/hyperscan_udf.cpp @@ -181,7 +181,7 @@ namespace { } Scratch_ = MakeScratch(Database_); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -223,7 +223,7 @@ namespace { return Mode_ == THyperscanMatch::EMode::MULTI ? tuple : TUnboxedValue(TUnboxedValuePod(false)); } } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } private: @@ -249,7 +249,7 @@ namespace { const TUnboxedValuePod* args) const final try { return TUnboxedValuePod(new THyperscanCapture(args[0], Pos_)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } private: @@ -293,7 +293,7 @@ namespace { return TUnboxedValue(); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } TSourcePosition Pos_; @@ -315,7 +315,7 @@ namespace { const TUnboxedValuePod* args) const final try { return TUnboxedValuePod(new THyperscanReplace(args[0], Pos_)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } private: @@ -370,7 +370,7 @@ namespace { return TUnboxedValue(); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } TSourcePosition Pos_; diff --git a/yql/essentials/udfs/common/json2/as_json_node.h b/yql/essentials/udfs/common/json2/as_json_node.h index 12937f4351a..6060f03bea8 100644 --- a/yql/essentials/udfs/common/json2/as_json_node.h +++ b/yql/essentials/udfs/common/json2/as_json_node.h @@ -63,7 +63,7 @@ namespace NJson2Udf { } return Interpret(args[0], valueBuilder); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/json2/compile_path.h b/yql/essentials/udfs/common/json2/compile_path.h index 3d7eba01cb5..220bd4fbaf6 100644 --- a/yql/essentials/udfs/common/json2/compile_path.h +++ b/yql/essentials/udfs/common/json2/compile_path.h @@ -60,7 +60,7 @@ namespace NJson2Udf { return TUnboxedValuePod(new TJsonPathResource(jsonPath)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/json2/parse.h b/yql/essentials/udfs/common/json2/parse.h index 0020c164c2b..6df4bce9b0a 100644 --- a/yql/essentials/udfs/common/json2/parse.h +++ b/yql/essentials/udfs/common/json2/parse.h @@ -56,7 +56,7 @@ namespace NJson2Udf { const auto json = args[0].AsStringRef(); return TryParseJsonDom(json, valueBuilder); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/json2/serialize.h b/yql/essentials/udfs/common/json2/serialize.h index a7077cb6e6d..cda95e77f5a 100644 --- a/yql/essentials/udfs/common/json2/serialize.h +++ b/yql/essentials/udfs/common/json2/serialize.h @@ -67,7 +67,7 @@ namespace NJson2Udf { return valueBuilder->NewString(TStringBuf(binaryJson.Data(), binaryJson.Size())); } } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/json2/sql_exists.h b/yql/essentials/udfs/common/json2/sql_exists.h index 8a049b49d42..cb89f20ec21 100644 --- a/yql/essentials/udfs/common/json2/sql_exists.h +++ b/yql/essentials/udfs/common/json2/sql_exists.h @@ -105,7 +105,7 @@ namespace NJson2Udf { return TUnboxedValuePod(!result.GetNodes().empty()); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/json2/sql_query.h b/yql/essentials/udfs/common/json2/sql_query.h index cb3bafd3b0b..1c2d610f923 100644 --- a/yql/essentials/udfs/common/json2/sql_query.h +++ b/yql/essentials/udfs/common/json2/sql_query.h @@ -144,7 +144,7 @@ namespace NJson2Udf { return nodes[0].ConvertToUnboxedValue(valueBuilder); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/json2/sql_value.h b/yql/essentials/udfs/common/json2/sql_value.h index 8d3318a8c54..53b451c6275 100644 --- a/yql/essentials/udfs/common/json2/sql_value.h +++ b/yql/essentials/udfs/common/json2/sql_value.h @@ -231,7 +231,7 @@ namespace NJson2Udf { return BuildSuccessfulResult(valueBuilder, std::move(convertedValue)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/pire/pire_udf.cpp b/yql/essentials/udfs/common/pire/pire_udf.cpp index b8a05b5d6dc..de2a75955e3 100644 --- a/yql/essentials/udfs/common/pire/pire_udf.cpp +++ b/yql/essentials/udfs/common/pire/pire_udf.cpp @@ -106,7 +106,7 @@ namespace { if (Fsm_) try { *Fsm_ = *Fsm_ | TFsm(TString(part), options); } catch (const yexception&) { - UdfTerminate((TStringBuilder() << Pos_ << " Failed to glue up regexes, probably the finite state machine appeared to be too large").data()); + UdfTerminate((TStringBuilder() << Pos_ << " Failed to glue up regexes, probably the finite state machine appeared to be too large").c_str()); } else { Fsm_.Reset(new TFsm(TString(part), options)); } @@ -116,7 +116,7 @@ namespace { Fsm_.Reset(new TFsm(TString(regex), options)); } } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -159,7 +159,7 @@ namespace { return MultiMode_ ? tuple : TUnboxedValue(TUnboxedValuePod(false)); } } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } private: @@ -181,7 +181,7 @@ namespace { TUnboxedValue Run(const IValueBuilder*, const TUnboxedValuePod* args) const final try { return TUnboxedValuePod(new TPireCapture(args[0], Pos_)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } }; @@ -217,7 +217,7 @@ namespace { return TUnboxedValue(); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } TUniquePtr<TSlowCapturingFsm> Fsm_; @@ -235,7 +235,7 @@ namespace { TUnboxedValue Run(const IValueBuilder*, const TUnboxedValuePod* args) const final try { return TUnboxedValuePod(new TPireReplace(args[0], Pos_)); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } }; @@ -275,7 +275,7 @@ namespace { return TUnboxedValue(); } } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } TUniquePtr<TSlowCapturingFsm> Fsm_; diff --git a/yql/essentials/udfs/common/python/bindings/py_callable.cpp b/yql/essentials/udfs/common/python/bindings/py_callable.cpp index c60403bdca2..e9b25606ed0 100644 --- a/yql/essentials/udfs/common/python/bindings/py_callable.cpp +++ b/yql/essentials/udfs/common/python/bindings/py_callable.cpp @@ -188,7 +188,7 @@ private: TPyObjectPtr resultObj = PyObject_CallObject(Function_.Get(), pyArgs.Get()); if (!resultObj) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Failed to execute:\n" << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Failed to execute:\n" << GetLastErrorAsString()).c_str()); } auto returnType = Inspector_.GetReturnType(); @@ -198,7 +198,7 @@ private: return FromPyObject(CastCtx_, returnType, resultObj.Get()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Failed to cast arguments or result\n" << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Failed to cast arguments or result\n" << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/python/bindings/py_cast.cpp b/yql/essentials/udfs/common/python/bindings/py_cast.cpp index 1a90773cd45..51b68f897dc 100644 --- a/yql/essentials/udfs/common/python/bindings/py_cast.cpp +++ b/yql/essentials/udfs/common/python/bindings/py_cast.cpp @@ -474,7 +474,7 @@ TPyObjectPtr ToPyData(const TPyCastContext::TPtr& ctx, if (!pyObj) { UdfTerminate((TStringBuilder() << ctx->PyCtx->Pos << "Failed to convert to unicode with _yql_bytes_decode_mode='strict':\n" << - GetLastErrorAsString()).data() + GetLastErrorAsString()).c_str() ); } return pyObj; @@ -487,7 +487,7 @@ TPyObjectPtr ToPyData(const TPyCastContext::TPtr& ctx, PyTuple_SET_ITEM(pyArgs.Get(), 0, pyObj.Release()); pyObj = PyObject_CallObject(ctx->YsonConverterIn.Get(), pyArgs.Get()); if (!pyObj) { - UdfTerminate((TStringBuilder() << ctx->PyCtx->Pos << "Failed to execute:\n" << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << ctx->PyCtx->Pos << "Failed to execute:\n" << GetLastErrorAsString()).c_str()); } } @@ -554,7 +554,7 @@ NUdf::TUnboxedValue FromPyData( PyTuple_SET_ITEM(pyArgs.Get(), 0, input.Release()); input.ResetSteal(PyObject_CallObject(ctx->YsonConverterOut.Get(), pyArgs.Get())); if (!input) { - UdfTerminate((TStringBuilder() << ctx->PyCtx->Pos << "Failed to execute:\n" << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << ctx->PyCtx->Pos << "Failed to execute:\n" << GetLastErrorAsString()).c_str()); } return ctx->ValueBuilder->NewString(PyCast<NUdf::TStringRef>(input.Get())); } @@ -927,7 +927,7 @@ TPyObjectPtr ToPyArgs( sb << "Failed to export "; NUdf::TTypePrinter(*ctx->PyCtx->TypeInfoHelper, argType).Out(sb.Out); sb << " given as args[" << i << "]: "; - UdfTerminate((sb << ctx->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((sb << ctx->PyCtx->Pos << GetLastErrorAsString()).c_str()); } PyTuple_SET_ITEM(tuple.Get(), i, arg.Release()); } diff --git a/yql/essentials/udfs/common/python/bindings/py_lazy_mkql_dict.cpp b/yql/essentials/udfs/common/python/bindings/py_lazy_mkql_dict.cpp index b9d90e49f9f..1408f185a75 100644 --- a/yql/essentials/udfs/common/python/bindings/py_lazy_mkql_dict.cpp +++ b/yql/essentials/udfs/common/python/bindings/py_lazy_mkql_dict.cpp @@ -41,12 +41,12 @@ protected: } if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return false; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool Next(NUdf::TUnboxedValue& value) override try { @@ -58,12 +58,12 @@ protected: } if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return false; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& payload) override { @@ -97,12 +97,12 @@ protected: } if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return false; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& pay) override try { @@ -115,12 +115,12 @@ protected: } if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return false; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } private: @@ -143,12 +143,12 @@ protected: const TPyGilLocker lock; const auto has = PyObject_IsTrue(PyObject_.Get()); if (has < 0) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return bool(has); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } const TPyCastContext::TPtr CastCtx_; @@ -173,11 +173,11 @@ private: const TPyGilLocker lock; const auto len = PyMapping_Size(PyObject_.Get()); if (len < 0) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return ui64(len); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetKeysIterator() const override try { @@ -187,9 +187,9 @@ private: return NUdf::TUnboxedValuePod(new TIterator(CastCtx_, ItemType_, std::move(pyIter))); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetPayloadsIterator() const override try { @@ -199,9 +199,9 @@ private: return NUdf::TUnboxedValuePod(new TIterator(CastCtx_, PayType_, std::move(pyIter))); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetDictIterator() const override try { @@ -211,9 +211,9 @@ private: return NUdf::TUnboxedValuePod(new TPairIterator(CastCtx_, ItemType_, PayType_, std::move(pyIter))); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override try { @@ -229,9 +229,9 @@ private: return NUdf::TUnboxedValue(); } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool Contains(const NUdf::TUnboxedValuePod& key) const override try { @@ -246,9 +246,9 @@ private: return bool(has); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } private: @@ -272,11 +272,11 @@ private: const TPyGilLocker lock; const auto len = PyDict_Size(PyObject_.Get()); if (len < 0) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return ui64(len); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetKeysIterator() const override try { @@ -286,9 +286,9 @@ private: return NUdf::TUnboxedValuePod(new TIterator(CastCtx_, ItemType_, std::move(pyIter))); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetPayloadsIterator() const override try { @@ -298,9 +298,9 @@ private: return NUdf::TUnboxedValuePod(new TIterator(CastCtx_, PayType_, std::move(pyIter))); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetDictIterator() const override try { @@ -310,9 +310,9 @@ private: return NUdf::TUnboxedValuePod(new TPairIterator(CastCtx_, ItemType_, PayType_, std::move(pyIter))); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override try { @@ -324,9 +324,9 @@ private: return NUdf::TUnboxedValue(); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool Contains(const NUdf::TUnboxedValuePod& key) const override try { @@ -337,9 +337,9 @@ private: return bool(has); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } private: @@ -363,11 +363,11 @@ private: const TPyGilLocker lock; const auto len = PySet_Size(PyObject_.Get()); if (len < 0) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return ui64(len); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override { @@ -382,9 +382,9 @@ private: return bool(has); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetKeysIterator() const override try { @@ -392,9 +392,9 @@ private: if (TPyObjectPtr pyIter = PyObject_GetIter(PyObject_.Get())) { return NUdf::TUnboxedValuePod(new TIterator(CastCtx_, ItemType_, std::move(pyIter))); } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetPayloadsIterator() const override { @@ -439,11 +439,11 @@ private: const TPyGilLocker lock; const auto len = PySequence_Size(PyObject_.Get()); if (len < 0) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return ui64(len); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue Lookup(const NUdf::TUnboxedValuePod& key) const override { @@ -458,9 +458,9 @@ private: return bool(has); } } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetKeysIterator() const override try { @@ -468,9 +468,9 @@ private: if (TPyObjectPtr pyIter = PyObject_GetIter(PyObject_.Get())) { return NUdf::TUnboxedValuePod(new TIterator(CastCtx_, ItemType_, std::move(pyIter))); } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetPayloadsIterator() const override { @@ -561,7 +561,7 @@ private: value = FromPyObject(CastCtx_, ItemType_, PySequence_Fast_GET_ITEM(PySeq_.Get(), Index_++)); return true; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool NextPair(NUdf::TUnboxedValue& key, NUdf::TUnboxedValue& pay) override try { @@ -573,7 +573,7 @@ private: pay = FromPyObject(CastCtx_, ItemType_, PySequence_Fast_GET_ITEM(PySeq_.Get(), Index_++)); return true; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } private: @@ -613,10 +613,10 @@ private: if (const auto item = PySequence_Fast_GET_ITEM(PySeq_.Get(), index >= 0 ? index : Size_ + index)) { return FromPyObject(CastCtx_, ItemType_, item).Release().MakeOptional(); } else if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } return NUdf::TUnboxedValue(); } @@ -699,7 +699,7 @@ NUdf::TUnboxedValue FromPySequence( Y_ABORT("Invalid key type."); } } - UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).c_str()); } } // namespace NPython diff --git a/yql/essentials/udfs/common/python/bindings/py_lazy_mkql_list.cpp b/yql/essentials/udfs/common/python/bindings/py_lazy_mkql_list.cpp index fe3b8892e66..ef135f3ba20 100644 --- a/yql/essentials/udfs/common/python/bindings/py_lazy_mkql_list.cpp +++ b/yql/essentials/udfs/common/python/bindings/py_lazy_mkql_list.cpp @@ -28,7 +28,7 @@ static ui64 CalculateIteratorLength(PyObject* iter, const TPyCastContext::TPtr& } if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return length; @@ -41,7 +41,7 @@ static bool IsIteratorHasItems(PyObject* iter, const TPyCastContext::TPtr& castC } if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return false; @@ -77,12 +77,12 @@ class TBaseLazyList: public NUdf::TBoxedValue } if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return false; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool Next(NUdf::TUnboxedValue& value) override try { @@ -94,12 +94,12 @@ class TBaseLazyList: public NUdf::TBoxedValue } if (PyErr_Occurred()) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return false; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } private: @@ -129,7 +129,7 @@ private: return static_cast<const TDerived*>(this)->GetIteratorImpl(); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool HasFastListLength() const override { @@ -149,7 +149,7 @@ private: return *Length_; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool HasListItems() const override try { @@ -165,7 +165,7 @@ private: return hasItems; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } NUdf::TUnboxedValue GetListIterator() const override try { @@ -174,7 +174,7 @@ private: auto* self = const_cast<TListSelf*>(this); return NUdf::TUnboxedValuePod(new TIterator(self->CastCtx_, self->ItemType_, std::move(pyIter))); } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } const NUdf::TOpaqueListRepresentation* GetListRepresentation() const override { @@ -240,7 +240,7 @@ public: UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Cannot get iterator from object: " << PyObjectRepr(PyObject_.Get()) << ", error: " - << GetLastErrorAsString()).data()); + << GetLastErrorAsString()).c_str()); } private: @@ -261,7 +261,7 @@ private: return *Length_; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } bool HasListItems() const override try { @@ -280,7 +280,7 @@ private: return hasItems; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } }; @@ -303,7 +303,7 @@ public: if (IteratorDrained_) { UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Lazy list was build under python iterator. " - "Iterator was already used.").data()); + "Iterator was already used.").c_str()); } IteratorDrained_ = true; return PyObject_; @@ -343,7 +343,7 @@ public: TPyObjectPtr GetIteratorImpl() const { TPyObjectPtr generator = PyObject_CallObject(PyObject_.Get(), nullptr); if (!generator || !PyGen_Check(generator.Get())) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Expected generator as a result of function call").data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Expected generator as a result of function call").c_str()); } return PyObject_GetIter(generator.Get()); } diff --git a/yql/essentials/udfs/common/python/bindings/py_stream.cpp b/yql/essentials/udfs/common/python/bindings/py_stream.cpp index 5be78e442aa..24f7e0eb45d 100644 --- a/yql/essentials/udfs/common/python/bindings/py_stream.cpp +++ b/yql/essentials/udfs/common/python/bindings/py_stream.cpp @@ -215,7 +215,7 @@ private: PyIter_.Reset(); TPyObjectPtr result(PyObject_CallObject(PyGeneratorCallable_.Get(), PyGeneratorCallableArgs_.Get())); if (!result) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Failed to execute:\n" << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Failed to execute:\n" << GetLastErrorAsString()).c_str()); } if (PyGen_Check(result.Get())) { @@ -223,7 +223,7 @@ private: } else if (PyIter_Check(result.Get())) { iter = std::move(result); } else { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Expected iterator or generator, but got " << PyObjectRepr(result.Get())).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << "Expected iterator or generator, but got " << PyObjectRepr(result.Get())).c_str()); } } else { return NUdf::EFetchStatus::Yield; @@ -232,7 +232,7 @@ private: if (!iter) { iter.ResetSteal(PyObject_GetIter(iterable.Get())); if (!iter) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } } @@ -240,13 +240,13 @@ private: return NUdf::EFetchStatus::Yield; } - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return NUdf::EFetchStatus::Finish; } catch (const yexception& e) { - UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).data()); + UdfTerminate((TStringBuilder() << CastCtx_->PyCtx->Pos << e.what()).c_str()); } } @@ -287,7 +287,7 @@ NKikimr::NUdf::TUnboxedValue FromPyStream( if (PyGen_Check(value.Get())) { TPyObjectPtr iter(PyObject_GetIter(value.Get())); if (!iter) { - UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return NUdf::TUnboxedValuePod(new TStreamOverPyIter(castCtx, itemType, std::move(iter), nullptr, originalCallable, originalCallableClosure, originalCallableArgs)); @@ -308,11 +308,11 @@ NKikimr::NUdf::TUnboxedValue FromPyStream( if (PyCallable_Check(value.Get())) { TPyObjectPtr generator(PyObject_CallObject(value.Get(), nullptr)); if (!generator || !PyGen_Check(generator.Get())) { - UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << "Expected generator as a result of function call").data()); + UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << "Expected generator as a result of function call").c_str()); } TPyObjectPtr iter(PyObject_GetIter(generator.Get())); if (!iter) { - UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).c_str()); } TPyObjectPtr callableClosure; @@ -331,13 +331,13 @@ NKikimr::NUdf::TUnboxedValue FromPyStream( if (PySequence_Check(value.Get()) || PyObject_HasAttrString(value.Get(), "__iter__")) { TPyObjectPtr iter(PyObject_GetIter(value.Get())); if (!iter) { - UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << GetLastErrorAsString()).c_str()); } return NUdf::TUnboxedValuePod(new TStreamOverPyIter(castCtx, itemType, std::move(iter), originalCallable ? value : nullptr, nullptr, nullptr, nullptr)); } UdfTerminate((TStringBuilder() << castCtx->PyCtx->Pos << "Expected iterator, generator, generator factory, " - "or iterable object, but got " << PyObjectRepr(value.Get())).data()); + "or iterable object, but got " << PyObjectRepr(value.Get())).c_str()); } } // namespace NPython diff --git a/yql/essentials/udfs/common/python/python_udf/python_function_factory.h b/yql/essentials/udfs/common/python/python_udf/python_function_factory.h index 657fb1f442b..7d96f67a083 100644 --- a/yql/essentials/udfs/common/python/python_udf/python_function_factory.h +++ b/yql/essentials/udfs/common/python/python_udf/python_function_factory.h @@ -58,23 +58,23 @@ private: TPyGilLocker lock; TPyObjectPtr module = CompileModule(FunctionName_, source); if (!module) { - UdfTerminate((TStringBuilder() << Ctx_->Pos << "Failed to compile module: " << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << Ctx_->Pos << "Failed to compile module: " << GetLastErrorAsString()).c_str()); } TPyObjectPtr function(PyObject_GetAttrString(module.Get(), FunctionName_.data())); if (!function) { - UdfTerminate((TStringBuilder() << Ctx_->Pos << "Failed to find entry point: " << GetLastErrorAsString()).data()); + UdfTerminate((TStringBuilder() << Ctx_->Pos << "Failed to find entry point: " << GetLastErrorAsString()).c_str()); } if (!PyCallable_Check(function.Get())) { - UdfTerminate((TStringBuilder() << Ctx_->Pos << "Entry point is not a callable").data()); + UdfTerminate((TStringBuilder() << Ctx_->Pos << "Entry point is not a callable").c_str()); } try { SetupCallableSettings(castCtx, function.Get()); } catch (const yexception& e) { UdfTerminate((TStringBuilder() << Ctx_->Pos << "Failed to setup callable settings: " - << e.what()).data()); + << e.what()).c_str()); } return FromPyCallable(castCtx, FunctionType_, function.Release()); } diff --git a/yql/essentials/udfs/common/re2/re2_udf.cpp b/yql/essentials/udfs/common/re2/re2_udf.cpp index baa3c6a3ec5..8e5079e6e42 100644 --- a/yql/essentials/udfs/common/re2/re2_udf.cpp +++ b/yql/essentials/udfs/common/re2/re2_udf.cpp @@ -209,7 +209,7 @@ namespace { } } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -248,7 +248,7 @@ namespace { const StringPiece rewrite(rewriteRef.data(), rewriteRef.size()); TString rewriteError; if (!Regexp_->CheckRewriteString(rewrite, &rewriteError)) { - UdfTerminate((TStringBuilder() << Pos_ << " [rewrite error] " << rewriteError).data()); + UdfTerminate((TStringBuilder() << Pos_ << " [rewrite error] " << rewriteError).c_str()); } std::string result(input); RE2::GlobalReplace(&result, *Regexp_, rewrite); @@ -289,7 +289,7 @@ namespace { Y_ABORT("Unexpected mode"); } } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } std::unique_ptr<RE2> Regexp_; @@ -392,7 +392,7 @@ namespace { if (hasEscape) { const std::string_view escapeRef(args[1].AsStringRef()); if (escapeRef.size() != 1U) { - UdfTerminate((TStringBuilder() << GetPos() << " Escape should be single character").data()); + UdfTerminate((TStringBuilder() << GetPos() << " Escape should be single character").c_str()); } escape = escapeRef.front(); } diff --git a/yql/essentials/udfs/common/stat/static/stat_udf.h b/yql/essentials/udfs/common/stat/static/stat_udf.h index 36a1bad7c4f..3ab6dbb20b4 100644 --- a/yql/essentials/udfs/common/stat/static/stat_udf.h +++ b/yql/essentials/udfs/common/stat/static/stat_udf.h @@ -19,7 +19,7 @@ namespace { const double delta = args[1].GetOrDefault<double>(0.01); const double K = args[2].GetOrDefault<double>(25.0); if (delta == 0 || K / delta < 1) { - UdfTerminate((TStringBuilder() << GetPos() << " Invalid combination of delta/K values").data()); + UdfTerminate((TStringBuilder() << GetPos() << " Invalid combination of delta/K values").c_str()); } return TUnboxedValuePod(new TDigestResource(delta, K, args[0].Get<double>(), true)); diff --git a/yql/essentials/udfs/common/streaming/streaming_udf.cpp b/yql/essentials/udfs/common/streaming/streaming_udf.cpp index dcae482b320..63fa55e9e80 100644 --- a/yql/essentials/udfs/common/streaming/streaming_udf.cpp +++ b/yql/essentials/udfs/common/streaming/streaming_udf.cpp @@ -279,7 +279,7 @@ namespace { ythrow yexception(); } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } @@ -564,7 +564,7 @@ namespace { return status; } catch (const std::exception& e) { - UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).data()); + UdfTerminate((TStringBuilder() << Pos_ << " " << e.what()).c_str()); } } diff --git a/yql/essentials/udfs/common/url_base/lib/url_query.cpp b/yql/essentials/udfs/common/url_base/lib/url_query.cpp index f449be22681..885dc3b16e9 100644 --- a/yql/essentials/udfs/common/url_base/lib/url_query.cpp +++ b/yql/essentials/udfs/common/url_base/lib/url_query.cpp @@ -33,7 +33,7 @@ namespace NUrlUdf { StringSplitter(query).SplitByString(sep).Collect(&parts); if (parts.size() > maxFieldCnt) { UdfTerminate((TStringBuilder() << Pos_ << "Max number of fields (" << maxFieldCnt - << ") exceeded: got " << parts.size()).data()); + << ") exceeded: got " << parts.size()).c_str()); } std::vector<std::pair<TString, TString>> pairs; @@ -45,7 +45,7 @@ namespace NUrlUdf { if (nvPair.size() != 2) { if (strict) { UdfTerminate((TStringBuilder() << Pos_ << "Bad query field: \"" - << nvPair[0] << "\"").data()); + << nvPair[0] << "\"").c_str()); } if (keepBlankValues) { nvPair.emplace_back(""); diff --git a/yql/essentials/udfs/common/yson2/yson2_udf.cpp b/yql/essentials/udfs/common/yson2/yson2_udf.cpp index 42f19d144e2..8fe6e17e366 100644 --- a/yql/essentials/udfs/common/yson2/yson2_udf.cpp +++ b/yql/essentials/udfs/common/yson2/yson2_udf.cpp @@ -331,7 +331,7 @@ template <TConverterPtr Converter = nullptr> TUnboxedValuePod YPathImpl(TUnboxedValuePod dict, const TUnboxedValuePod key, const IValueBuilder* valueBuilder, const TSourcePosition& pos) { const std::string_view path = key.AsStringRef(); if (path.size() < 2U || path.front() != '/' || path.back() == '/') { - UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(pos) << " Invalid YPath: '" << path << "'.").data()); + UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(pos) << " Invalid YPath: '" << path << "'.").c_str()); } for (const auto s : StringSplitter(path.substr(path[1U] == '/' ? 2U : 1U)).Split('/')) { @@ -676,7 +676,7 @@ SIMPLE_UDF_WITH_OPTIONAL_ARGS(TSerializeJson, TOptional<TJson>(TAutoMap<TNodeRes return valueBuilder->NewString(SerializeJsonDom(args[0], args[2].GetOrDefault(false), args[3].GetOrDefault(false), args[4].GetOrDefault(false))); } catch (const std::exception& e) { if (ParseOptions(args[1]).Strict) { - UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(GetPos()) << " " << e.what()).data()); + UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(GetPos()) << " " << e.what()).c_str()); } return {}; } @@ -1095,7 +1095,7 @@ TUnboxedValue TParse<TYson, false>::Run(const IValueBuilder* valueBuilder, const return TryParseYsonDom(args[0].AsStringRef(), valueBuilder); } catch (const std::exception& e) { if (StrictType_ || ParseOptions(args[1]).Strict) { - UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(Pos_) << " " << e.what()).data()); + UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(Pos_) << " " << e.what()).c_str()); } return TUnboxedValuePod(); } @@ -1105,7 +1105,7 @@ TUnboxedValue TParse<TJson, false>::Run(const IValueBuilder* valueBuilder, const return TryParseJsonDom(args[0].AsStringRef(), valueBuilder); } catch (const std::exception& e) { if (StrictType_ || ParseOptions(args[1]).Strict) { - UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(Pos_) << " " << e.what()).data()); + UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(Pos_) << " " << e.what()).c_str()); } return TUnboxedValuePod(); } @@ -1115,7 +1115,7 @@ TUnboxedValue TParse<TJson, true>::Run(const IValueBuilder* valueBuilder, const return TryParseJsonDom(args[0].AsStringRef(), valueBuilder, true); } catch (const std::exception& e) { if (StrictType_ || ParseOptions(args[1]).Strict) { - UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(Pos_) << " " << e.what()).data()); + UdfTerminate((::TStringBuilder() << valueBuilder->WithCalleePosition(Pos_) << " " << e.what()).c_str()); } return TUnboxedValuePod(); } |