diff options
author | imunkin <imunkin@yandex-team.com> | 2025-03-06 12:05:40 +0300 |
---|---|---|
committer | imunkin <imunkin@yandex-team.com> | 2025-03-06 14:41:23 +0300 |
commit | 37bbd18372fbadb71de7d0ed6eb6de6caa8cc94c (patch) | |
tree | a8af3f77abe6e0239770d3e6bf28ffeb27f16cdc | |
parent | ce42f378a8120fbfcc2ccf08ff7616e8c02068d2 (diff) | |
download | ydb-37bbd18372fbadb71de7d0ed6eb6de6caa8cc94c.tar.gz |
YQL-19623: Drop MKQL support for runtime versions <40
commit_hash:aa64eee443012fcb60cd00896f6f1b30d515048e
8 files changed, 5 insertions, 94 deletions
diff --git a/yql/essentials/minikql/comp_nodes/mkql_discard.cpp b/yql/essentials/minikql/comp_nodes/mkql_discard.cpp index 969f029731..580a2761fe 100644 --- a/yql/essentials/minikql/comp_nodes/mkql_discard.cpp +++ b/yql/essentials/minikql/comp_nodes/mkql_discard.cpp @@ -226,7 +226,7 @@ IComputationNode* WrapDiscard(TCallable& callable, const TComputationNodeFactory if (type->IsFlow()) { if (const auto wide = dynamic_cast<IComputationWideFlowNode*>(flow)) { auto flowType = AS_TYPE(TFlowType, callable.GetInput(0U).GetStaticType()); - if (RuntimeVersion > 35 && flowType->GetItemType()->IsMulti() || flowType->GetItemType()->IsTuple()) { + if (flowType->GetItemType()->IsMulti() || flowType->GetItemType()->IsTuple()) { return new TDiscardWideFlowWrapper(wide, GetWideComponentsCount(flowType)); } return new TDiscardWideFlowWrapper(wide, 0U); diff --git a/yql/essentials/minikql/comp_nodes/ut/mkql_block_top_sort_ut.cpp b/yql/essentials/minikql/comp_nodes/ut/mkql_block_top_sort_ut.cpp index 2066594e3d..5a0f737ec6 100644 --- a/yql/essentials/minikql/comp_nodes/ut/mkql_block_top_sort_ut.cpp +++ b/yql/essentials/minikql/comp_nodes/ut/mkql_block_top_sort_ut.cpp @@ -8,7 +8,6 @@ namespace NKikimr { namespace NMiniKQL { -#if !defined(MKQL_RUNTIME_VERSION) || MKQL_RUNTIME_VERSION >= 33u Y_UNIT_TEST_SUITE(TMiniKQLBlockTopTest) { Y_UNIT_TEST_LLVM(TopByFirstKeyAsc) { TSetup<LLVM> setup; @@ -555,9 +554,7 @@ Y_UNIT_TEST_SUITE(TMiniKQLBlockTopTest) { UNIT_ASSERT(!iterator.Next(item)); } } -#endif -#if !defined(MKQL_RUNTIME_VERSION) || MKQL_RUNTIME_VERSION >= 34u Y_UNIT_TEST_SUITE(TMiniKQLBlockSortTest) { Y_UNIT_TEST_LLVM(SortByFirstKeyAsc) { TSetup<LLVM> setup; @@ -641,7 +638,6 @@ Y_UNIT_TEST_SUITE(TMiniKQLBlockSortTest) { UNIT_ASSERT(!iterator.Next(item)); } } -#endif } } diff --git a/yql/essentials/minikql/comp_nodes/ut/mkql_grace_join_ut.cpp b/yql/essentials/minikql/comp_nodes/ut/mkql_grace_join_ut.cpp index e8fbd575a9..3bedebe1c8 100644 --- a/yql/essentials/minikql/comp_nodes/ut/mkql_grace_join_ut.cpp +++ b/yql/essentials/minikql/comp_nodes/ut/mkql_grace_join_ut.cpp @@ -886,7 +886,6 @@ Y_UNIT_TEST_SUITE(TMiniKQLGraceSelfJoinTest) { } } -#if !defined(MKQL_RUNTIME_VERSION) || MKQL_RUNTIME_VERSION >= 40u Y_UNIT_TEST_SUITE(TMiniKQLSelfJoinTest) { Y_UNIT_TEST_LLVM_SPILLING(TestInner1) { @@ -1044,7 +1043,6 @@ Y_UNIT_TEST_SUITE(TMiniKQLSelfJoinTest) { } -#endif Y_UNIT_TEST_SUITE(TMiniKQLGraceJoinTest) { diff --git a/yql/essentials/minikql/comp_nodes/ut/mkql_wide_stream_ut.cpp b/yql/essentials/minikql/comp_nodes/ut/mkql_wide_stream_ut.cpp index 89582bf31f..d869069997 100644 --- a/yql/essentials/minikql/comp_nodes/ut/mkql_wide_stream_ut.cpp +++ b/yql/essentials/minikql/comp_nodes/ut/mkql_wide_stream_ut.cpp @@ -5,7 +5,6 @@ namespace NKikimr { namespace NMiniKQL { -#if !defined(MKQL_RUNTIME_VERSION) || MKQL_RUNTIME_VERSION >= 36u Y_UNIT_TEST_SUITE(TMiniKQLWideStreamTest) { Y_UNIT_TEST_LLVM(TestSimple) { @@ -52,7 +51,5 @@ Y_UNIT_TEST_LLVM(TestSimple) { } } -#endif - } } diff --git a/yql/essentials/minikql/comp_nodes/ut/mkql_wide_top_sort_ut.cpp b/yql/essentials/minikql/comp_nodes/ut/mkql_wide_top_sort_ut.cpp index 0608a3be45..b26c538aeb 100644 --- a/yql/essentials/minikql/comp_nodes/ut/mkql_wide_top_sort_ut.cpp +++ b/yql/essentials/minikql/comp_nodes/ut/mkql_wide_top_sort_ut.cpp @@ -8,7 +8,6 @@ namespace NKikimr { namespace NMiniKQL { -#if !defined(MKQL_RUNTIME_VERSION) || MKQL_RUNTIME_VERSION >= 33u Y_UNIT_TEST_SUITE(TMiniKQLWideTopTest) { Y_UNIT_TEST_LLVM(TopByFirstKeyAsc) { TSetup<LLVM> setup; @@ -562,9 +561,7 @@ Y_UNIT_TEST_SUITE(TMiniKQLWideTopTest) { UNIT_ASSERT(!iterator.Next(item)); } } -#endif -#if !defined(MKQL_RUNTIME_VERSION) || MKQL_RUNTIME_VERSION >= 34u Y_UNIT_TEST_SUITE(TMiniKQLWideSortTest) { Y_UNIT_TEST_LLVM(SortByFirstKeyAsc) { TSetup<LLVM> setup; @@ -644,7 +641,6 @@ Y_UNIT_TEST_SUITE(TMiniKQLWideSortTest) { UNIT_ASSERT(!iterator.Next(item)); } } -#endif } } diff --git a/yql/essentials/minikql/mkql_node.cpp b/yql/essentials/minikql/mkql_node.cpp index 82772bb923..cee619ae07 100644 --- a/yql/essentials/minikql/mkql_node.cpp +++ b/yql/essentials/minikql/mkql_node.cpp @@ -656,7 +656,7 @@ static const THashSet<TStringBuf> PG_SUPPORTED_PRESORT = { }; TPgType::TPgType(ui32 typeId, const TTypeEnvironment& env) - : TType(EKind::Pg, env.GetTypeOfTypeLazy(), + : TType(EKind::Pg, env.GetTypeOfTypeLazy(), NYql::NPg::HasType(typeId) && PG_SUPPORTED_PRESORT.contains(NYql::NPg::LookupType(typeId).Name)) , TypeId(typeId) { @@ -2518,7 +2518,6 @@ TArrayRef<TType* const> GetWideComponents(const TFlowType* type) { } TArrayRef<TType* const> GetWideComponents(const TStreamType* type) { - MKQL_ENSURE(RuntimeVersion > 35, "Wide stream is not supported in runtime version " << RuntimeVersion); return AS_TYPE(TMultiType, type->GetItemType())->GetElements(); } diff --git a/yql/essentials/minikql/mkql_program_builder.cpp b/yql/essentials/minikql/mkql_program_builder.cpp index da5e77b4fc..825f46dd94 100644 --- a/yql/essentials/minikql/mkql_program_builder.cpp +++ b/yql/essentials/minikql/mkql_program_builder.cpp @@ -20,7 +20,7 @@ using namespace std::string_view_literals; namespace NKikimr { namespace NMiniKQL { -static_assert(RuntimeVersion >= 30); +static_assert(RuntimeVersion >= 40); namespace { @@ -1726,20 +1726,12 @@ TRuntimeNode TProgramBuilder::BlockAsTuple(const TArrayRef<const TRuntimeNode>& } TRuntimeNode TProgramBuilder::BlockToPg(TRuntimeNode input, TType* returnType) { - if constexpr (RuntimeVersion < 37U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - TCallableBuilder callableBuilder(Env, __func__, returnType); callableBuilder.Add(input); return TRuntimeNode(callableBuilder.Build(), false); } TRuntimeNode TProgramBuilder::BlockFromPg(TRuntimeNode input, TType* returnType) { - if constexpr (RuntimeVersion < 37U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - TCallableBuilder callableBuilder(Env, __func__, returnType); callableBuilder.Add(input); return TRuntimeNode(callableBuilder.Build(), false); @@ -1888,16 +1880,6 @@ TRuntimeNode TProgramBuilder::WideSort(TRuntimeNode flow, const std::vector<std: } TRuntimeNode TProgramBuilder::BuildWideTopOrSort(const std::string_view& callableName, TRuntimeNode flow, TMaybe<TRuntimeNode> count, const std::vector<std::pair<ui32, TRuntimeNode>>& keys) { - if (count) { - if constexpr (RuntimeVersion < 33U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << callableName; - } - } else { - if constexpr (RuntimeVersion < 34U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << callableName; - } - } - const auto width = GetWideComponentsCount(AS_TYPE(TFlowType, flow.GetStaticType())); MKQL_ENSURE(!keys.empty() && keys.size() <= width, "Unexpected keys count: " << keys.size()); @@ -2151,10 +2133,6 @@ TRuntimeNode TProgramBuilder::GraceJoin(TRuntimeNode flowLeft, TRuntimeNode flow TRuntimeNode TProgramBuilder::GraceSelfJoin(TRuntimeNode flowLeft, EJoinKind joinKind, const TArrayRef<const ui32>& leftKeyColumns, const TArrayRef<const ui32>& rightKeyColumns, const TArrayRef<const ui32>& leftRenames, const TArrayRef<const ui32>& rightRenames, TType* returnType, EAnyJoinSettings anyJoinSettings ) { - if constexpr (RuntimeVersion < 40U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - return GraceJoinCommon(__func__, flowLeft, {}, joinKind, leftKeyColumns, rightKeyColumns, leftRenames, rightRenames, returnType, anyJoinSettings); } @@ -4292,25 +4270,6 @@ TRuntimeNode TProgramBuilder::StringContains(TRuntimeNode string, TRuntimeNode p type1->GetSchemeType() == NUdf::TDataType<char*>::Id, "Expecting string as first argument"); MKQL_ENSURE(type2->GetSchemeType() == NUdf::TDataType<NUdf::TUtf8>::Id || type2->GetSchemeType() == NUdf::TDataType<char*>::Id, "Expecting string as second argument"); - if constexpr (RuntimeVersion < 32U) { - auto stringCasted = (type1->GetSchemeType() == NUdf::TDataType<NUdf::TUtf8>::Id) ? ToString(string) : string; - auto patternCasted = (type2->GetSchemeType() == NUdf::TDataType<NUdf::TUtf8>::Id) ? ToString(pattern) : pattern; - auto found = Exists(Find(stringCasted, patternCasted, NewDataLiteral(ui32(0)))); - if (!isOpt1 && !isOpt2) { - return found; - } - TVector<TRuntimeNode> predicates; - if (isOpt1) { - predicates.push_back(Exists(string)); - } - if (isOpt2) { - predicates.push_back(Exists(pattern)); - } - - TRuntimeNode argsNotNull = (predicates.size() == 1) ? predicates.front() : And(predicates); - return If(argsNotNull, NewOptional(found), NewEmptyOptionalDataLiteral(NUdf::TDataType<bool>::Id)); - } - return DataCompare(__func__, string, pattern); } @@ -5369,10 +5328,6 @@ TRuntimeNode TProgramBuilder::NextValue(TRuntimeNode value) { } TRuntimeNode TProgramBuilder::Nop(TRuntimeNode value, TType* returnType) { - if constexpr (RuntimeVersion < 35U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - TCallableBuilder callableBuilder(Env, __func__, returnType); callableBuilder.Add(value); return TRuntimeNode(callableBuilder.Build(), false); @@ -5508,10 +5463,6 @@ TRuntimeNode TProgramBuilder::ToPg(TRuntimeNode input, TType* returnType) { } TRuntimeNode TProgramBuilder::PgClone(TRuntimeNode input, const TArrayRef<const TRuntimeNode>& dependentNodes) { - if constexpr (RuntimeVersion < 38U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - TCallableBuilder callableBuilder(Env, __func__, input.GetStaticType()); callableBuilder.Add(input); for (const auto& node : dependentNodes) { @@ -5604,10 +5555,6 @@ TRuntimeNode TProgramBuilder::BuildBlockCombineAll(const std::string_view& calla TRuntimeNode TProgramBuilder::BlockCombineAll(TRuntimeNode stream, std::optional<ui32> filterColumn, const TArrayRef<const TAggInfo>& aggs, TType* returnType) { - if constexpr (RuntimeVersion < 31U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - MKQL_ENSURE(stream.GetStaticType()->IsStream(), "Expected stream as input type"); MKQL_ENSURE(returnType->IsStream(), "Expected stream as return type"); @@ -5657,10 +5604,6 @@ TRuntimeNode TProgramBuilder::BuildBlockCombineHashed(const std::string_view& ca TRuntimeNode TProgramBuilder::BlockCombineHashed(TRuntimeNode stream, std::optional<ui32> filterColumn, const TArrayRef<ui32>& keys, const TArrayRef<const TAggInfo>& aggs, TType* returnType) { - if constexpr (RuntimeVersion < 31U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - MKQL_ENSURE(stream.GetStaticType()->IsStream(), "Expected stream as input type"); MKQL_ENSURE(returnType->IsStream(), "Expected stream as return type"); @@ -5704,10 +5647,6 @@ TRuntimeNode TProgramBuilder::BuildBlockMergeFinalizeHashed(const std::string_vi TRuntimeNode TProgramBuilder::BlockMergeFinalizeHashed(TRuntimeNode stream, const TArrayRef<ui32>& keys, const TArrayRef<const TAggInfo>& aggs, TType* returnType) { - if constexpr (RuntimeVersion < 31U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - MKQL_ENSURE(stream.GetStaticType()->IsStream(), "Expected stream as input type"); MKQL_ENSURE(returnType->IsStream(), "Expected stream as return type"); @@ -5763,10 +5702,6 @@ TRuntimeNode TProgramBuilder::BuildBlockMergeManyFinalizeHashed(const std::strin TRuntimeNode TProgramBuilder::BlockMergeManyFinalizeHashed(TRuntimeNode stream, const TArrayRef<ui32>& keys, const TArrayRef<const TAggInfo>& aggs, ui32 streamIndex, const TVector<TVector<ui32>>& streams, TType* returnType) { - if constexpr (RuntimeVersion < 31U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - MKQL_ENSURE(stream.GetStaticType()->IsStream(), "Expected stream as input type"); MKQL_ENSURE(returnType->IsStream(), "Expected stream as return type"); @@ -5779,10 +5714,6 @@ TRuntimeNode TProgramBuilder::BlockMergeManyFinalizeHashed(TRuntimeNode stream, } TRuntimeNode TProgramBuilder::ScalarApply(const TArrayRef<const TRuntimeNode>& args, const TArrayLambda& handler) { - if constexpr (RuntimeVersion < 39U) { - THROW yexception() << "Runtime version (" << RuntimeVersion << ") too old for " << __func__; - } - MKQL_ENSURE(!args.empty(), "Required at least one argument"); TVector<TRuntimeNode> lambdaArgs; bool scalarOnly = true; diff --git a/yql/essentials/minikql/mkql_type_builder.cpp b/yql/essentials/minikql/mkql_type_builder.cpp index 231231eee7..e6ed5fd8d0 100644 --- a/yql/essentials/minikql/mkql_type_builder.cpp +++ b/yql/essentials/minikql/mkql_type_builder.cpp @@ -2742,17 +2742,11 @@ TType* TTypeBuilder::NewArrayType(const TArrayRef<TType* const>& elements) const } TType* TTypeBuilder::NewEmptyMultiType() const { - if (RuntimeVersion > 35) { - return TMultiType::Create(0, nullptr, Env); - } - return Env.GetEmptyTupleLazy()->GetGenericType(); + return TMultiType::Create(0, nullptr, Env); } TType* TTypeBuilder::NewMultiType(const TArrayRef<TType* const>& elements) const { - if (RuntimeVersion > 35) { - return TMultiType::Create(elements.size(), elements.data(), Env); - } - return TTupleType::Create(elements.size(), elements.data(), Env); + return TMultiType::Create(elements.size(), elements.data(), Env); } TType* TTypeBuilder::NewResourceType(const std::string_view& tag) const { |