aboutsummaryrefslogtreecommitdiffstats
path: root/yql
diff options
context:
space:
mode:
authorvvvv <vvvv@yandex-team.com>2025-01-29 16:58:30 +0300
committervvvv <vvvv@yandex-team.com>2025-01-29 17:42:35 +0300
commit12394c9c74f3eef93303aefdfe3a2af02c48315a (patch)
treec6f6b0fe55ca949cc3af10b4e206e638c4befb80 /yql
parent13d12a0d4b3448c8956d46b7a0155d043f006acf (diff)
downloadydb-12394c9c74f3eef93303aefdfe3a2af02c48315a.tar.gz
drop BlockBitCast YQL-19494
commit_hash:1b627ad95e1026d9c67f004825ef1567504cc66e
Diffstat (limited to 'yql')
-rw-r--r--yql/essentials/core/type_ann/type_ann_blocks.cpp35
-rw-r--r--yql/essentials/core/type_ann/type_ann_blocks.h1
-rw-r--r--yql/essentials/core/type_ann/type_ann_core.cpp1
-rw-r--r--yql/essentials/minikql/comp_nodes/mkql_block_func.cpp35
-rw-r--r--yql/essentials/minikql/comp_nodes/mkql_block_func.h1
-rw-r--r--yql/essentials/minikql/comp_nodes/mkql_factory.cpp1
-rw-r--r--yql/essentials/minikql/mkql_program_builder.cpp11
-rw-r--r--yql/essentials/minikql/mkql_program_builder.h1
-rw-r--r--yql/essentials/providers/common/mkql/yql_provider_mkql.cpp6
9 files changed, 0 insertions, 92 deletions
diff --git a/yql/essentials/core/type_ann/type_ann_blocks.cpp b/yql/essentials/core/type_ann/type_ann_blocks.cpp
index 45335360b7..b53469fa1a 100644
--- a/yql/essentials/core/type_ann/type_ann_blocks.cpp
+++ b/yql/essentials/core/type_ann/type_ann_blocks.cpp
@@ -637,41 +637,6 @@ IGraphTransformer::TStatus BlockFuncWrapper(const TExprNode::TPtr& input, TExprN
return IGraphTransformer::TStatus::Ok;
}
-IGraphTransformer::TStatus BlockBitCastWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TExtContext& ctx) {
- Y_UNUSED(output);
- if (!EnsureArgsCount(*input, 2U, ctx.Expr)) {
- return IGraphTransformer::TStatus::Error;
- }
-
- if (!EnsureBlockOrScalarType(*input->Child(0), ctx.Expr)) {
- return IGraphTransformer::TStatus::Error;
- }
-
- if (auto status = EnsureTypeRewrite(input->ChildRef(1), ctx.Expr); status != IGraphTransformer::TStatus::Ok) {
- return status;
- }
-
- if (!ctx.Types.ArrowResolver) {
- ctx.Expr.AddError(TIssue(ctx.Expr.GetPosition(input->Pos()), "Arrow resolver isn't available"));
- return IGraphTransformer::TStatus::Error;
- }
-
- bool isScalar;
- auto inputType = GetBlockItemType(*input->Child(0)->GetTypeAnn(), isScalar);
- auto outputType = input->Child(1)->GetTypeAnn()->Cast<TTypeExprType>()->GetType();
-
- auto castStatus = ctx.Types.ArrowResolver->HasCast(ctx.Expr.GetPosition(input->Pos()), inputType, outputType, ctx.Expr);
- if (castStatus == IArrowResolver::ERROR) {
- return IGraphTransformer::TStatus::Error;
- } else if (castStatus == IArrowResolver::NOT_FOUND) {
- ctx.Expr.AddError(TIssue(ctx.Expr.GetPosition(input->Pos()), "No such cast"));
- return IGraphTransformer::TStatus::Error;
- }
-
- input->SetTypeAnn(MakeBlockOrScalarType(outputType, isScalar, ctx.Expr));
- return IGraphTransformer::TStatus::Ok;
-}
-
bool ValidateBlockKeys(TPositionHandle pos, const TTypeAnnotationNode::TListType& inputItems,
TExprNode& keys, TTypeAnnotationNode::TListType& retMultiType, TExprContext& ctx) {
if (!EnsureTupleMinSize(keys, 1, ctx)) {
diff --git a/yql/essentials/core/type_ann/type_ann_blocks.h b/yql/essentials/core/type_ann/type_ann_blocks.h
index 00ba126281..8a16376f9b 100644
--- a/yql/essentials/core/type_ann/type_ann_blocks.h
+++ b/yql/essentials/core/type_ann/type_ann_blocks.h
@@ -24,7 +24,6 @@ namespace NTypeAnnImpl {
IGraphTransformer::TStatus BlockToPgWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TContext& ctx);
IGraphTransformer::TStatus BlockFromPgWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TContext& ctx);
IGraphTransformer::TStatus BlockFuncWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TExtContext& ctx);
- IGraphTransformer::TStatus BlockBitCastWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TExtContext& ctx);
IGraphTransformer::TStatus BlockCombineAllWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TExtContext& ctx);
IGraphTransformer::TStatus BlockCombineHashedWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TExtContext& ctx);
IGraphTransformer::TStatus BlockMergeFinalizeHashedWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& output, TExtContext& ctx);
diff --git a/yql/essentials/core/type_ann/type_ann_core.cpp b/yql/essentials/core/type_ann/type_ann_core.cpp
index 6b87ac4343..879f2cbcc6 100644
--- a/yql/essentials/core/type_ann/type_ann_core.cpp
+++ b/yql/essentials/core/type_ann/type_ann_core.cpp
@@ -12952,7 +12952,6 @@ template <NKikimr::NUdf::EDataSlot DataSlot>
Functions["BlockDecimalDiv"] = &BlockDecimalBinaryWrapper;
ExtFunctions["BlockFunc"] = &BlockFuncWrapper;
- ExtFunctions["BlockBitCast"] = &BlockBitCastWrapper;
Functions["BlockMapJoinCore"] = &BlockMapJoinCoreWrapper;
diff --git a/yql/essentials/minikql/comp_nodes/mkql_block_func.cpp b/yql/essentials/minikql/comp_nodes/mkql_block_func.cpp
index 91008c7f38..d94f0ff400 100644
--- a/yql/essentials/minikql/comp_nodes/mkql_block_func.cpp
+++ b/yql/essentials/minikql/comp_nodes/mkql_block_func.cpp
@@ -36,30 +36,6 @@ const TKernel& ResolveKernel(const IBuiltinFunctionRegistry& builtins, const TSt
return *kernel;
}
-class TBlockBitCastWrapper : public TBlockFuncNode {
-public:
- TBlockBitCastWrapper(TComputationMutables& mutables, IComputationNode* arg, TType* argType, TType* to)
- : TBlockFuncNode(mutables, "BitCast", { arg }, { argType }, ResolveKernel(argType, to), {}, &CastOptions)
- , CastOptions(false)
- {
- }
-private:
- static const arrow::compute::ScalarKernel& ResolveKernel(TType* from, TType* to) {
- std::shared_ptr<arrow::DataType> type;
- MKQL_ENSURE(ConvertArrowType(to, type), "can't get arrow type");
-
- auto function = ARROW_RESULT(arrow::compute::GetCastFunction(type));
- MKQL_ENSURE(function != nullptr, "missing function");
- MKQL_ENSURE(function->kind() == arrow::compute::Function::SCALAR, "expected SCALAR function");
-
- std::vector<arrow::ValueDescr> args = { ToValueDescr(from) };
- const auto kernel = ARROW_RESULT(function->DispatchExact(args));
- return *static_cast<const arrow::compute::ScalarKernel*>(kernel);
- }
-
- const arrow::compute::CastOptions CastOptions;
-};
-
} // namespace
IComputationNode* WrapBlockFunc(TCallable& callable, const TComputationNodeFactoryContext& ctx) {
@@ -83,16 +59,5 @@ IComputationNode* WrapBlockFunc(TCallable& callable, const TComputationNodeFacto
}
}
-IComputationNode* WrapBlockBitCast(TCallable& callable, const TComputationNodeFactoryContext& ctx) {
- MKQL_ENSURE(callable.GetInputsCount() == 2, "Expected 2 args");
- auto argNode = LocateNode(ctx.NodeLocator, callable, 0);
- MKQL_ENSURE(callable.GetInput(1).GetStaticType()->IsType(), "Expected type");
- return new TBlockBitCastWrapper(ctx.Mutables,
- argNode,
- callable.GetType()->GetArgumentType(0),
- static_cast<TType*>(callable.GetInput(1).GetNode())
- );
-}
-
}
}
diff --git a/yql/essentials/minikql/comp_nodes/mkql_block_func.h b/yql/essentials/minikql/comp_nodes/mkql_block_func.h
index f777a848b0..3cebf3b160 100644
--- a/yql/essentials/minikql/comp_nodes/mkql_block_func.h
+++ b/yql/essentials/minikql/comp_nodes/mkql_block_func.h
@@ -6,7 +6,6 @@ namespace NKikimr {
namespace NMiniKQL {
IComputationNode* WrapBlockFunc(TCallable& callable, const TComputationNodeFactoryContext& ctx);
-IComputationNode* WrapBlockBitCast(TCallable& callable, const TComputationNodeFactoryContext& ctx);
}
}
diff --git a/yql/essentials/minikql/comp_nodes/mkql_factory.cpp b/yql/essentials/minikql/comp_nodes/mkql_factory.cpp
index eea027ceb4..7f5550a46f 100644
--- a/yql/essentials/minikql/comp_nodes/mkql_factory.cpp
+++ b/yql/essentials/minikql/comp_nodes/mkql_factory.cpp
@@ -284,7 +284,6 @@ struct TCallableComputationNodeBuilderFuncMapFiller {
{"ToBlocks", &WrapToBlocks},
{"WideToBlocks", &WrapWideToBlocks},
{"BlockFunc", &WrapBlockFunc},
- {"BlockBitCast", &WrapBlockBitCast},
{"FromBlocks", &WrapFromBlocks},
{"WideFromBlocks", &WrapWideFromBlocks},
{"WideSkipBlocks", &WrapWideSkipBlocks},
diff --git a/yql/essentials/minikql/mkql_program_builder.cpp b/yql/essentials/minikql/mkql_program_builder.cpp
index ee9812c4f9..d7df4981b3 100644
--- a/yql/essentials/minikql/mkql_program_builder.cpp
+++ b/yql/essentials/minikql/mkql_program_builder.cpp
@@ -5756,17 +5756,6 @@ TRuntimeNode TProgramBuilder::BlockFunc(const std::string_view& funcName, TType*
return TRuntimeNode(builder.Build(), false);
}
-TRuntimeNode TProgramBuilder::BlockBitCast(TRuntimeNode value, TType* targetType) {
- MKQL_ENSURE(value.GetStaticType()->IsBlock(), "Expected Block type");
-
- auto returnType = TBlockType::Create(targetType, AS_TYPE(TBlockType, value.GetStaticType())->GetShape(), Env);
- TCallableBuilder builder(Env, __func__, returnType);
- builder.Add(value);
- builder.Add(TRuntimeNode(targetType, true));
-
- return TRuntimeNode(builder.Build(), false);
-}
-
TRuntimeNode TProgramBuilder::BuildBlockCombineAll(const std::string_view& callableName, TRuntimeNode input, std::optional<ui32> filterColumn,
const TArrayRef<const TAggInfo>& aggs, TType* returnType) {
const auto inputType = input.GetStaticType();
diff --git a/yql/essentials/minikql/mkql_program_builder.h b/yql/essentials/minikql/mkql_program_builder.h
index 6b24bf2e0c..22ca659cae 100644
--- a/yql/essentials/minikql/mkql_program_builder.h
+++ b/yql/essentials/minikql/mkql_program_builder.h
@@ -272,7 +272,6 @@ public:
TRuntimeNode BlockJust(TRuntimeNode data);
TRuntimeNode BlockFunc(const std::string_view& funcName, TType* returnType, const TArrayRef<const TRuntimeNode>& args);
- TRuntimeNode BlockBitCast(TRuntimeNode value, TType* targetType);
TRuntimeNode BlockCombineAll(TRuntimeNode flow, std::optional<ui32> filterColumn,
const TArrayRef<const TAggInfo>& aggs, TType* returnType);
TRuntimeNode BlockCombineHashed(TRuntimeNode flow, std::optional<ui32> filterColumn, const TArrayRef<ui32>& keys,
diff --git a/yql/essentials/providers/common/mkql/yql_provider_mkql.cpp b/yql/essentials/providers/common/mkql/yql_provider_mkql.cpp
index cc24af5924..5d7e22fa2f 100644
--- a/yql/essentials/providers/common/mkql/yql_provider_mkql.cpp
+++ b/yql/essentials/providers/common/mkql/yql_provider_mkql.cpp
@@ -2794,12 +2794,6 @@ TMkqlCommonCallableCompiler::TShared::TShared() {
return ctx.ProgramBuilder.BlockFunc(node.Child(0)->Content(), returnType, args);
});
- AddCallable("BlockBitCast", [](const TExprNode& node, TMkqlBuildContext& ctx) {
- auto arg = MkqlBuildExpr(*node.Child(0), ctx);
- auto targetType = ctx.BuildType(node, *node.Child(1)->GetTypeAnn()->Cast<TTypeExprType>()->GetType());
- return ctx.ProgramBuilder.BlockBitCast(arg, targetType);
- });
-
AddCallable("BlockMember", [](const TExprNode& node, TMkqlBuildContext& ctx) {
const auto structObj = MkqlBuildExpr(node.Head(), ctx);
const auto name = node.Tail().Content();