diff options
| -rw-r--r-- | build/conf/ts/ts_test.conf | 6 | ||||
| -rw-r--r-- | build/plugins/nots.py | 6 | ||||
| -rw-r--r-- | library/python/testing/yatest_common/yatest/common/process.py | 1 | ||||
| -rw-r--r-- | yql/essentials/core/peephole_opt/yql_opt_peephole_physical.cpp | 34 | ||||
| -rw-r--r-- | yql/essentials/udfs/common/string/string_udf.cpp | 77 | ||||
| -rw-r--r-- | yt/cpp/mapreduce/http/helpers.cpp | 10 | ||||
| -rw-r--r-- | yt/cpp/mapreduce/http/helpers.h | 6 | ||||
| -rw-r--r-- | yt/yt/core/concurrency/execution_stack.cpp | 2 |
8 files changed, 97 insertions, 45 deletions
diff --git a/build/conf/ts/ts_test.conf b/build/conf/ts/ts_test.conf index a0a4bf7404a..3f750ab68f5 100644 --- a/build/conf/ts/ts_test.conf +++ b/build/conf/ts/ts_test.conf @@ -83,6 +83,7 @@ module TS_TEST_HERMIONE_FOR: _TS_TEST_BASE { } TS_TEST_PLAYWRIGHT_CMD=$TOUCH_UNIT \ + && $_TS_TEST_COPY_NODEJS_CMD \ && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS --nm-bundle yes create-node-modules \ --moddir $TS_TEST_FOR_PATH \ $_NODE_MODULES_INOUTS ${hide:PEERS} \ @@ -109,12 +110,13 @@ module TS_TEST_PLAYWRIGHT_FOR: _TS_TEST_BASE { SET(PEERDIR_TAGS TS TS_PROTO TS_PROTO_FROM_SCHEMA) # compatibility with old TS_TEST_SRCS - SET(TS_TEST_EXTENSION (playwright|spec).(ts|js)) + SET(TS_TEST_EXTENSION (playwright|spec|test).(ts|js)) _DEPENDS_ON_MOD() _TS_ADD_NODE_MODULES_FOR_BUILDER() - _PEERDIR_TS_RESOURCE(nodejs playwright) + # _PEERDIR_TS_RESOURCE(nodejs playwright) + _PEERDIR_TS_RESOURCE(nodejs) _TS_TEST_FOR_CONFIGURE(playwright playwright.config.ts workspace_node_modules.tar) } diff --git a/build/plugins/nots.py b/build/plugins/nots.py index 6a96b796ee0..73d48f7fa24 100644 --- a/build/plugins/nots.py +++ b/build/plugins/nots.py @@ -205,6 +205,7 @@ TS_TEST_SPECIFIC_FIELDS = { df.TsTestDataDirsRename.value, df.TsResources.value, df.TsTestForPath.value, + df.DockerImage.value, ), TsTestType.PLAYWRIGHT_LARGE: ( df.ConfigPath.value, @@ -947,7 +948,10 @@ def on_ts_test_for_configure( # noinspection PyUnusedLocal @_with_report_configure_error def on_validate_ts_test_for_args(unit: NotsUnitType, for_mod: str, root: str) -> None: - # FBP-1085 + if for_mod == "." or for_mod == "./": + ymake.report_configure_error(f"Tests should be for parent module but got path '{for_mod}'") + return + is_arc_root = root == "${ARCADIA_ROOT}" is_rel_for_mod = for_mod.startswith(".") diff --git a/library/python/testing/yatest_common/yatest/common/process.py b/library/python/testing/yatest_common/yatest/common/process.py index 748c5ad2ea2..14a1db8246a 100644 --- a/library/python/testing/yatest_common/yatest/common/process.py +++ b/library/python/testing/yatest_common/yatest/common/process.py @@ -733,6 +733,7 @@ def py_execute( def _format_error(error): + error, _ = _try_convert_bytes_to_string(error) return truncate(error, MAX_MESSAGE_LEN) diff --git a/yql/essentials/core/peephole_opt/yql_opt_peephole_physical.cpp b/yql/essentials/core/peephole_opt/yql_opt_peephole_physical.cpp index 0c9d875b95e..78a084422c7 100644 --- a/yql/essentials/core/peephole_opt/yql_opt_peephole_physical.cpp +++ b/yql/essentials/core/peephole_opt/yql_opt_peephole_physical.cpp @@ -22,6 +22,7 @@ #include <yql/essentials/utils/yql_paths.h> #include <util/generic/xrange.h> +#include <util/string/ascii.h> #include <library/cpp/svnversion/svnversion.h> #include <library/cpp/yson/writer.h> @@ -8645,7 +8646,39 @@ TExprNode::TPtr ExpandSqlCompare(const TExprNode::TPtr& node, TExprContext& ctx) } TExprNode::TPtr ExpandContainsIgnoreCase(const TExprNode::TPtr& node, TExprContext& ctx) { YQL_CLOG(DEBUG, CorePeepHole) << "Expand " << node->Content(); + const auto pos = node->Pos(); const TString part{node->Child(1)->Child(0)->Content()}; + if (node->Child(0)->GetTypeAnn()->GetKind() == ETypeAnnotationKind::Null) { + return MakeBool<false>(pos, ctx); + } + + if (AllOf(part, IsAscii)) { + TString func = "String._yql_"; + if (node->Content() == "EqualsIgnoreCase") { + func += "AsciiEqualsIgnoreCase"; + } else if (node->Content() == "StartsWithIgnoreCase") { + func += "AsciiStartsWithIgnoreCase"; + } else if (node->Content() == "EndsWithIgnoreCase") { + func += "AsciiEndsWithIgnoreCase"; + } else if (node->Content() == "StringContainsIgnoreCase") { + func += "AsciiContainsIgnoreCase"; + } else { + YQL_ENSURE(!"Unknown IngoreCase node"); + } + + return ctx.Builder(pos) + .Callable("Apply") + .Callable(0, "Udf") + .Atom(0, func) + .Seal() + .Add(1, node->ChildPtr(0)) + .Callable(2, "String") + .Atom(0, part) + .Seal() + .Seal() + .Build(); + } + TString pattern; if (node->Content() == "EqualsIgnoreCase") { pattern = part; @@ -8658,7 +8691,6 @@ TExprNode::TPtr ExpandContainsIgnoreCase(const TExprNode::TPtr& node, TExprConte } else { YQL_ENSURE(!"Unknown IngoreCase node"); } - const auto pos = node->Pos(); auto patternExpr = ctx.Builder(pos) .Callable("Apply") .Callable(0, "Udf") diff --git a/yql/essentials/udfs/common/string/string_udf.cpp b/yql/essentials/udfs/common/string/string_udf.cpp index 273e7617d5b..5c24485129d 100644 --- a/yql/essentials/udfs/common/string/string_udf.cpp +++ b/yql/essentials/udfs/common/string/string_udf.cpp @@ -186,11 +186,7 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>), } #define STRING_ASCII_CMP_IGNORE_CASE_UDF(udfName, function) \ - BEGIN_SIMPLE_STRICT_ARROW_UDF_OPTIONS(T##udfName, \ - bool(TOptional<char*>, char*), \ - builder.SetMinLangVer(NYql::MakeLangVersion(2025, 2))) \ - { \ - Y_UNUSED(valueBuilder); \ + TUnboxedValuePod udfName##Impl(const TUnboxedValuePod* args) { \ if (args[0]) { \ const TString haystack(args[0].AsStringRef()); \ const TString needle(args[1].AsStringRef()); \ @@ -217,9 +213,26 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>), } \ }; \ \ - END_SIMPLE_ARROW_UDF(T##udfName, T##udfName##KernelExec::Do) + BEGIN_SIMPLE_STRICT_ARROW_UDF_OPTIONS(T##udfName, \ + bool(TOptional<char*>, char*), \ + builder.SetMinLangVer(NYql::MakeLangVersion(2025, 2))) \ + { \ + Y_UNUSED(valueBuilder); \ + return udfName##Impl(args); \ + } \ + \ + END_SIMPLE_ARROW_UDF(T##udfName, T##udfName##KernelExec::Do) \ + \ + BEGIN_SIMPLE_STRICT_ARROW_UDF(T_yql_##udfName, \ + bool(TOptional<char*>, char*)) \ + { \ + Y_UNUSED(valueBuilder); \ + return udfName##Impl(args); \ + } \ + \ + END_SIMPLE_ARROW_UDF(T_yql_##udfName, T##udfName##KernelExec::Do) -#define IS_ASCII_UDF(function) \ +#define IS_ASCII_UDF(function) \ BEGIN_SIMPLE_STRICT_ARROW_UDF(T##function, bool(TOptional<char*>)) { \ Y_UNUSED(valueBuilder); \ if (args[0]) { \ @@ -516,24 +529,6 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>), return AsciiToUpper(a) == AsciiToUpper(b); } - BEGIN_SIMPLE_STRICT_ARROW_UDF_OPTIONS(TAsciiContainsIgnoreCase, bool(TOptional<char*>, char*), - builder.SetMinLangVer(NYql::MakeLangVersion(2025, 2))) - { - Y_UNUSED(valueBuilder); - if (!args[0]) { - return TUnboxedValuePod(false); - } - - const TString haystack(args[0].AsStringRef()); - const TString needle(args[1].AsStringRef()); - if (haystack.empty()) { - return TUnboxedValuePod(needle.empty()); - } - const auto found = std::search(haystack.cbegin(), haystack.cend(), - needle.cbegin(), needle.cend(), IgnoreCaseComparator); - return TUnboxedValuePod(found != haystack.cend()); - } - struct TAsciiContainsIgnoreCaseKernelExec : public TBinaryKernelExec<TAsciiContainsIgnoreCaseKernelExec> { @@ -554,8 +549,37 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>), } }; + TUnboxedValuePod AsciiContainsIgnoreCaseImpl(const TUnboxedValuePod* args) { + if (!args[0]) { + return TUnboxedValuePod(false); + } + + const TString haystack(args[0].AsStringRef()); + const TString needle(args[1].AsStringRef()); + if (haystack.empty()) { + return TUnboxedValuePod(needle.empty()); + } + const auto found = std::search(haystack.cbegin(), haystack.cend(), + needle.cbegin(), needle.cend(), IgnoreCaseComparator); + return TUnboxedValuePod(found != haystack.cend()); + } + + BEGIN_SIMPLE_STRICT_ARROW_UDF_OPTIONS(TAsciiContainsIgnoreCase, bool(TOptional<char*>, char*), + builder.SetMinLangVer(NYql::MakeLangVersion(2025, 2))) + { + Y_UNUSED(valueBuilder); + return AsciiContainsIgnoreCaseImpl(args); + } + END_SIMPLE_ARROW_UDF(TAsciiContainsIgnoreCase, TAsciiContainsIgnoreCaseKernelExec::Do); + BEGIN_SIMPLE_STRICT_ARROW_UDF(T_yql_AsciiContainsIgnoreCase, bool(TOptional<char*>, char*)) + { + Y_UNUSED(valueBuilder); + return AsciiContainsIgnoreCaseImpl(args); + } + + END_SIMPLE_ARROW_UDF(T_yql_AsciiContainsIgnoreCase, TAsciiContainsIgnoreCaseKernelExec::Do); BEGIN_SIMPLE_STRICT_ARROW_UDF(TReplaceAll, char*(TAutoMap<char*>, char*, char*)) { if (TString result(args[0].AsStringRef()); SubstGlobal(result, args[1].AsStringRef(), args[2].AsStringRef())) @@ -981,6 +1005,7 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>), } #define STRING_REGISTER_UDF(udfName, ...) T##udfName, +#define STRING_OPT_REGISTER_UDF(udfName, ...) T_yql_##udfName, STRING_UDF_MAP(STRING_UDF) STRING_UNSAFE_UDF_MAP(STRING_UNSAFE_UDF) @@ -1006,6 +1031,7 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>), STROKA_FIND_UDF_MAP(STRING_REGISTER_UDF) STRING_TWO_ARGS_UDF_MAP_DEPRECATED_2025_02(STRING_REGISTER_UDF) STRING_ASCII_CMP_IGNORE_CASE_UDF_MAP(STRING_REGISTER_UDF) + STRING_ASCII_CMP_IGNORE_CASE_UDF_MAP(STRING_OPT_REGISTER_UDF) IS_ASCII_UDF_MAP(STRING_REGISTER_UDF) STRING_STREAM_PAD_FORMATTER_UDF_MAP(STRING_REGISTER_UDF) STRING_STREAM_NUM_FORMATTER_UDF_MAP(STRING_REGISTER_UDF) @@ -1021,6 +1047,7 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>), TRemoveLast, TContains, TAsciiContainsIgnoreCase, + T_yql_AsciiContainsIgnoreCase, TFind, TReverseFind, TSubstring, diff --git a/yt/cpp/mapreduce/http/helpers.cpp b/yt/cpp/mapreduce/http/helpers.cpp index c819e515b87..0e34610ef1a 100644 --- a/yt/cpp/mapreduce/http/helpers.cpp +++ b/yt/cpp/mapreduce/http/helpers.cpp @@ -100,16 +100,6 @@ void LogRequest(const THttpHeader& header, const TString& url, bool includeParam GetLoggedAttributes(header, url, includeParameters, Max<size_t>())); } -void ExtendGenericError(TErrorResponse& errorResponse, int code, TString message) -{ - const auto& error = errorResponse.GetError(); - - auto inner = error.InnerErrors(); - inner.emplace_back(code, std::move(message)); - - errorResponse.SetError(TYtError(error.GetCode(), error.GetMessage(), std::move(inner), error.GetAttributes())); -} - //////////////////////////////////////////////////////////////////////////////// } // namespace NYT diff --git a/yt/cpp/mapreduce/http/helpers.h b/yt/cpp/mapreduce/http/helpers.h index 24f9f59e353..474813674ef 100644 --- a/yt/cpp/mapreduce/http/helpers.h +++ b/yt/cpp/mapreduce/http/helpers.h @@ -24,12 +24,6 @@ TString GetLoggedAttributes(const THttpHeader& header, const TString& url, bool void LogRequest(const THttpHeader& header, const TString& url, bool includeParameters, const TString& requestId, const TString& hostName); -// Sometimes errors may not include any specific inner errors and appear to be generic. -// To differentiate these errors and reduce reliance on HTTP status codes, we need to extend inner error information. -// -// XXX(hiddenpath): Remove this method when server will respond with specific errors. -void ExtendGenericError(TErrorResponse& errorResponse, int code, TString message); - //////////////////////////////////////////////////////////////////////////////// } // namespace NYT diff --git a/yt/yt/core/concurrency/execution_stack.cpp b/yt/yt/core/concurrency/execution_stack.cpp index 6c39fb10f77..c3e90809e84 100644 --- a/yt/yt/core/concurrency/execution_stack.cpp +++ b/yt/yt/core/concurrency/execution_stack.cpp @@ -46,12 +46,14 @@ TExecutionStackBase::TExecutionStackBase(size_t size) , Size_(RoundUpToPage(size)) { auto cookie = GetRefCountedTypeCookie<TExecutionStack>(); + TRefCountedTrackerFacade::AllocateInstance(cookie); TRefCountedTrackerFacade::AllocateSpace(cookie, Size_); } TExecutionStackBase::~TExecutionStackBase() { auto cookie = GetRefCountedTypeCookie<TExecutionStack>(); + TRefCountedTrackerFacade::FreeInstance(cookie); TRefCountedTrackerFacade::FreeSpace(cookie, Size_); } |
