diff options
author | ivanmorozov333 <ivanmorozov@ydb.tech> | 2024-05-03 09:24:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 09:24:34 +0300 |
commit | 4b36f7a5467d8d16f49c9fb56182dd2d7bff7cde (patch) | |
tree | 3099ed62ad623b882f69b780646267a9d695f593 | |
parent | 4fe968f146568e807e56f8fd277035066e287c0f (diff) | |
download | ydb-4b36f7a5467d8d16f49c9fb56182dd2d7bff7cde.tar.gz |
split proto library for future deps usage (#4239)
36 files changed, 300 insertions, 55 deletions
diff --git a/ydb/core/formats/arrow/protos/ssa.proto b/ydb/core/formats/arrow/protos/ssa.proto new file mode 100644 index 0000000000..5ffbf067b3 --- /dev/null +++ b/ydb/core/formats/arrow/protos/ssa.proto @@ -0,0 +1,209 @@ +package NKikimrSSA; +option java_package = "ru.yandex.kikimr.proto"; + +// Program to pushdown to ColumnShard +// +// > 'SELECT y, z WHERE x > 10' +// PROJECTION x, y, z +// ASSIGN tmp = x > 10 +// FILTER BY tmp +// PROJECTION y, z +// +// > 'SELECT min(x), sum(y) GROUP BY z' +// PROJECTION x, y, z +// ASSIGN agg1 = min(x) +// ASSIGN agg2 = sum(y) +// GROUP BY z +// PROJECTION agg1, agg2 +// +message TProgram { + message TColumn { + optional uint64 Id = 1; + optional string Name = 2; + } + + message TConstant { + oneof value { + bool Bool = 1; + int32 Int32 = 2; + uint32 Uint32 = 3; + int64 Int64 = 4; + uint64 Uint64 = 5; + float Float = 6; + double Double = 7; + bytes Bytes = 8; + string Text = 9; + int32 Int8 = 10; + uint32 Uint8 = 11; + int32 Int16 = 12; + uint32 Uint16 = 13; + uint64 Timestamp = 14; + } + } + + message TBloomFilterChecker { + repeated uint64 HashValues = 1; + } + + message TOlapIndexChecker { + optional uint32 IndexId = 1; + optional string ClassName = 2; + + message TCompositeChecker { + repeated TOlapIndexChecker ChildrenCheckers = 1; + } + + oneof Implementation { + TBloomFilterChecker BloomFilter = 40; + TCompositeChecker Composite = 41; + } + } + + message TParameter { + optional string Name = 1; + } + + enum EFunctionType { + SIMPLE_ARROW = 1; + YQL_KERNEL = 2; + } + + message TAssignment { + enum EFunction { + FUNC_UNSPECIFIED = 0; + FUNC_CMP_EQUAL = 1; + FUNC_CMP_NOT_EQUAL = 2; + FUNC_CMP_LESS = 3; + FUNC_CMP_LESS_EQUAL = 4; + FUNC_CMP_GREATER = 5; + FUNC_CMP_GREATER_EQUAL = 6; + FUNC_IS_NULL = 7; + FUNC_STR_LENGTH = 8; + FUNC_STR_MATCH = 9; + FUNC_BINARY_NOT = 10; + FUNC_BINARY_AND = 11; + FUNC_BINARY_OR = 12; + FUNC_BINARY_XOR = 13; + FUNC_MATH_ADD = 14; + FUNC_MATH_SUBTRACT = 15; + FUNC_MATH_MULTIPLY = 16; + FUNC_MATH_DIVIDE = 17; + FUNC_CAST_TO_BOOLEAN = 18; + FUNC_CAST_TO_INT8 = 19; + FUNC_CAST_TO_INT16 = 20; + FUNC_CAST_TO_INT32 = 21; + FUNC_CAST_TO_INT64 = 22; + FUNC_CAST_TO_UINT8 = 23; + FUNC_CAST_TO_UINT16 = 24; + FUNC_CAST_TO_UINT32 = 25; + FUNC_CAST_TO_UINT64 = 26; + FUNC_CAST_TO_FLOAT = 27; + FUNC_CAST_TO_DOUBLE = 28; + FUNC_CAST_TO_BINARY = 29; + FUNC_CAST_TO_FIXED_SIZE_BINARY = 30; + FUNC_CAST_TO_TIMESTAMP = 31; + FUNC_STR_MATCH_LIKE = 32; + FUNC_STR_STARTS_WITH = 33; + FUNC_STR_ENDS_WITH = 34; + FUNC_STR_MATCH_IGNORE_CASE = 35; + FUNC_STR_STARTS_WITH_IGNORE_CASE = 36; + FUNC_STR_ENDS_WITH_IGNORE_CASE = 37; + } + + message TFunction { + optional uint32 Id = 1; // EFunction + repeated TColumn Arguments = 2; + optional EFunctionType FunctionType = 3 [ default = SIMPLE_ARROW ]; + optional uint32 KernelIdx = 4; + optional uint32 YqlOperationId = 5; // TKernelRequestBuilder::EBinaryOp + } + + message TExternalFunction { + optional string Name = 1; + repeated TColumn Arguments = 2; + } + + optional TColumn Column = 1; + oneof expression { + TFunction Function = 2; + TExternalFunction ExternalFunction = 3; + TConstant Constant = 4; + bool Null = 5; + TParameter Parameter = 6; + } + } + + message TAggregateAssignment { + enum EAggregateFunction { + AGG_UNSPECIFIED = 0; + AGG_SOME = 1; + AGG_COUNT = 2; + AGG_MIN = 3; + AGG_MAX = 4; + AGG_SUM = 5; + //AGG_AVG = 6; + //AGG_VAR = 7; + //AGG_COVAR = 8; + //AGG_STDDEV = 9; + //AGG_CORR = 10; + //AGG_ARG_MIN = 11; + //AGG_ARG_MAX = 12; + //AGG_COUNT_DISTINCT = 13; + //AGG_QUANTILES = 14; + //AGG_TOP_COUNT = 15; + //AGG_TOP_SUM = 16; + } + + message TAggregateFunction { + optional uint32 Id = 1; // EAggregateFunction + repeated TColumn Arguments = 2; + optional string Variant = 3; // i.e. POP/SAMP for AGG_VAR, AGG_COVAR, AGG_STDDEV + optional EFunctionType FunctionType = 4 [ default = SIMPLE_ARROW ]; + optional uint32 KernelIdx = 5; + // TODO: Parameters, i.e. N for topK(N)(arg) + } + + optional TColumn Column = 1; + optional TAggregateFunction Function = 2; + } + + message TProjection { + repeated TColumn Columns = 1; + } + + message TFilter { + // Predicate should be a bool column: + // true - keep the row + // false - remove the row + optional TColumn Predicate = 1; + } + + message TGroupBy { + repeated TAggregateAssignment Aggregates = 1; + repeated TColumn KeyColumns = 2; + } + + message TCommand { + oneof line { + TAssignment Assign = 1; + TProjection Projection = 2; + TFilter Filter = 3; + TGroupBy GroupBy = 4; + // TODO: ORDER BY, LIMIT + } + } + + repeated TCommand Command = 1; + optional uint32 Version = 2; + optional bytes Kernels = 3; +} + +message TOlapProgram { + // Store OLAP program in serialized format in case we do not need to deserialize it in TScanTaskMeta + // Note: when this message exists the program must be present. + optional bytes Program = 1; + // RecordBatch deserialization require arrow::Schema, thus store it here + optional bytes ParametersSchema = 2; + optional bytes Parameters = 3; + optional TProgram.TOlapIndexChecker IndexChecker = 4; +} diff --git a/ydb/core/formats/arrow/protos/ya.make b/ydb/core/formats/arrow/protos/ya.make new file mode 100644 index 0000000000..f01aa064fb --- /dev/null +++ b/ydb/core/formats/arrow/protos/ya.make @@ -0,0 +1,11 @@ +PROTO_LIBRARY() + +SRCS( + ssa.proto +) + +PEERDIR( + +) + +END() diff --git a/ydb/core/formats/arrow/ssa_program_optimizer.h b/ydb/core/formats/arrow/ssa_program_optimizer.h index bdd2f78363..21be81fe35 100644 --- a/ydb/core/formats/arrow/ssa_program_optimizer.h +++ b/ydb/core/formats/arrow/ssa_program_optimizer.h @@ -2,7 +2,6 @@ #include "program.h" -#include <ydb/core/protos/ssa.pb.h> #include <ydb/core/tablet_flat/flat_dbase_scheme.h> namespace NKikimr::NSsa { diff --git a/ydb/core/kqp/compute_actor/kqp_compute_actor.cpp b/ydb/core/kqp/compute_actor/kqp_compute_actor.cpp index 9ec068e045..93f295a4ed 100644 --- a/ydb/core/kqp/compute_actor/kqp_compute_actor.cpp +++ b/ydb/core/kqp/compute_actor/kqp_compute_actor.cpp @@ -12,7 +12,7 @@ #include <ydb/library/yql/providers/generic/actors/yql_generic_provider_factories.h> #include <ydb/library/yql/providers/s3/actors/yql_s3_sink_factory.h> #include <ydb/library/yql/providers/s3/actors/yql_s3_source_factory.h> -#include <ydb/core/protos/ssa.pb.h> +#include <ydb/core/formats/arrow/protos/ssa.pb.h> #include <ydb/library/yql/dq/proto/dq_tasks.pb.h> diff --git a/ydb/core/kqp/compute_actor/kqp_scan_fetcher_actor.cpp b/ydb/core/kqp/compute_actor/kqp_scan_fetcher_actor.cpp index 43aabec1a6..b4d23bbfb9 100644 --- a/ydb/core/kqp/compute_actor/kqp_scan_fetcher_actor.cpp +++ b/ydb/core/kqp/compute_actor/kqp_scan_fetcher_actor.cpp @@ -4,7 +4,6 @@ #include <ydb/core/tx/datashard/range_ops.h> #include <ydb/core/actorlib_impl/long_timer.h> #include <ydb/core/scheme/scheme_types_proto.h> -#include <ydb/core/protos/ssa.pb.h> #include <ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h> diff --git a/ydb/core/kqp/compute_actor/ya.make b/ydb/core/kqp/compute_actor/ya.make index 570d174d73..c0b8d48ef8 100644 --- a/ydb/core/kqp/compute_actor/ya.make +++ b/ydb/core/kqp/compute_actor/ya.make @@ -21,6 +21,7 @@ PEERDIR( ydb/core/kqp/runtime ydb/core/tx/datashard ydb/core/tx/scheme_cache + ydb/core/formats/arrow/protos ydb/library/yql/dq/actors/compute ydb/library/yql/providers/generic/actors ydb/library/yql/providers/s3/actors diff --git a/ydb/core/kqp/opt/kqp_query_plan.cpp b/ydb/core/kqp/opt/kqp_query_plan.cpp index 1ef5e5f60a..90a67553e6 100644 --- a/ydb/core/kqp/opt/kqp_query_plan.cpp +++ b/ydb/core/kqp/opt/kqp_query_plan.cpp @@ -2,7 +2,7 @@ #include <ydb/core/kqp/common/kqp_yql.h> #include <ydb/core/kqp/provider/yql_kikimr_provider_impl.h> -#include <ydb/core/protos/ssa.pb.h> +#include <ydb/core/formats/arrow/protos/ssa.pb.h> #include <ydb/public/lib/value/value.h> #include <ydb/library/yql/ast/yql_ast_escaping.h> diff --git a/ydb/core/kqp/opt/ya.make b/ydb/core/kqp/opt/ya.make index 816583d41e..e0e0b547a5 100644 --- a/ydb/core/kqp/opt/ya.make +++ b/ydb/core/kqp/opt/ya.make @@ -26,6 +26,7 @@ PEERDIR( ydb/library/yql/dq/type_ann ydb/library/yql/utils/plan ydb/core/kqp/provider + ydb/core/formats/arrow/protos ) YQL_LAST_ABI_VERSION() diff --git a/ydb/core/kqp/query_compiler/kqp_olap_compiler.cpp b/ydb/core/kqp/query_compiler/kqp_olap_compiler.cpp index 7f2529250f..a7cd80c165 100644 --- a/ydb/core/kqp/query_compiler/kqp_olap_compiler.cpp +++ b/ydb/core/kqp/query_compiler/kqp_olap_compiler.cpp @@ -2,6 +2,7 @@ #include <ydb/core/formats/arrow/arrow_helpers.h> #include <ydb/core/formats/arrow/ssa_runtime_version.h> +#include <ydb/core/formats/arrow/protos/ssa.pb.h> #include <ydb/library/yql/core/arrow_kernels/request/request.h> #include <ydb/library/yql/core/yql_expr_type_annotation.h> diff --git a/ydb/core/kqp/query_compiler/kqp_olap_compiler.h b/ydb/core/kqp/query_compiler/kqp_olap_compiler.h index 0e9cb8ee4a..04e0b1ecdb 100644 --- a/ydb/core/kqp/query_compiler/kqp_olap_compiler.h +++ b/ydb/core/kqp/query_compiler/kqp_olap_compiler.h @@ -1,7 +1,6 @@ #pragma once #include <ydb/core/kqp/expr_nodes/kqp_expr_nodes.h> -#include <ydb/core/protos/ssa.pb.h> #include <ydb/core/kqp/provider/yql_kikimr_gateway.h> diff --git a/ydb/core/protos/tx_columnshard.proto b/ydb/core/protos/tx_columnshard.proto index 2caec98084..5a2c712523 100644 --- a/ydb/core/protos/tx_columnshard.proto +++ b/ydb/core/protos/tx_columnshard.proto @@ -1,9 +1,10 @@ import "ydb/library/actors/protos/actors.proto"; import "ydb/core/tx/columnshard/engines/scheme/statistics/protos/data.proto"; +import "ydb/core/tx/columnshard/engines/protos/portion_info.proto"; import "ydb/core/protos/flat_scheme_op.proto"; import "ydb/core/protos/long_tx_service.proto"; import "ydb/core/protos/subdomains.proto"; -import "ydb/core/protos/ssa.proto"; +import "ydb/core/formats/arrow/protos/ssa.proto"; package NKikimrTxColumnShard; option java_package = "ru.yandex.kikimr.proto"; @@ -271,33 +272,6 @@ message TIndexGranuleMeta { optional uint32 MarkSize = 1; // Composite key mark (granule border) size: count of first PK elements in mark } -message TSnapshot { - optional uint64 PlanStep = 1; - optional uint64 TxId = 2; -} - -message TIndexPortionMeta { - oneof Produced { - bool IsInserted = 1; - bool IsCompacted = 2; - bool IsSplitCompacted = 3; - bool IsEvicted = 4; - } - optional string TierName = 5; - optional bytes PrimaryKeyBorders = 6; // arrow::RecordBatch with first and last ReplaceKey rows - optional TSnapshot RecordSnapshotMin = 7; - optional TSnapshot RecordSnapshotMax = 8; - optional NKikimrColumnShardStatisticsProto.TPortionStorage StatisticsStorage = 9; -} - -message TIndexColumnMeta { - optional uint32 NumRows = 1; - optional uint32 RawBytes = 2; - optional NKikimrSSA.TProgram.TConstant MinValue = 3; - optional NKikimrSSA.TProgram.TConstant MaxValue = 4; - optional TIndexPortionMeta PortionMeta = 5; // First PK column could contain portion info -} - message TSchemaTxBody { optional TSchemaSeqNo SeqNo = 1; oneof TxBody { diff --git a/ydb/core/protos/tx_datashard.proto b/ydb/core/protos/tx_datashard.proto index fc436b789b..9043a8d1b6 100644 --- a/ydb/core/protos/tx_datashard.proto +++ b/ydb/core/protos/tx_datashard.proto @@ -7,7 +7,7 @@ import "ydb/core/scheme/protos/key_range.proto"; import "ydb/core/scheme/protos/pathid.proto"; import "ydb/core/protos/data_events.proto"; import "ydb/core/protos/kqp.proto"; -import "ydb/core/protos/ssa.proto"; +import "ydb/core/formats/arrow/protos/ssa.proto"; import "ydb/core/protos/tablet.proto"; import "ydb/core/protos/tx.proto"; import "ydb/core/protos/flat_scheme_op.proto"; diff --git a/ydb/core/protos/ya.make b/ydb/core/protos/ya.make index 1c00a9575b..53ec70b60b 100644 --- a/ydb/core/protos/ya.make +++ b/ydb/core/protos/ya.make @@ -116,7 +116,6 @@ SRCS( serverless_proxy_config.proto shared_cache.proto sqs.proto - ssa.proto statestorage.proto statistics.proto stream.proto @@ -167,6 +166,8 @@ PEERDIR( ydb/library/services ydb/library/ydb_issue/proto ydb/core/tx/columnshard/engines/scheme/statistics/protos + ydb/core/tx/columnshard/engines/protos + ydb/core/formats/arrow/protos ) CPP_PROTO_PLUGIN0(config_proto_plugin ydb/core/config/tools/protobuf_plugin) diff --git a/ydb/core/tx/columnshard/common/scalars.cpp b/ydb/core/tx/columnshard/common/scalars.cpp index ae575064d9..d614253e9e 100644 --- a/ydb/core/tx/columnshard/common/scalars.cpp +++ b/ydb/core/tx/columnshard/common/scalars.cpp @@ -1,7 +1,6 @@ #include "scalars.h" #include <ydb/core/formats/arrow/switch_type.h> -#include <ydb/core/protos/ssa.pb.h> #include <ydb/library/yverify_stream/yverify_stream.h> #include <util/system/unaligned_mem.h> diff --git a/ydb/core/tx/columnshard/common/scalars.h b/ydb/core/tx/columnshard/common/scalars.h index c2bfed65c1..3282960486 100644 --- a/ydb/core/tx/columnshard/common/scalars.h +++ b/ydb/core/tx/columnshard/common/scalars.h @@ -1,6 +1,6 @@ #pragma once -#include <ydb/core/protos/tx_columnshard.pb.h> +#include <ydb/core/formats/arrow/protos/ssa.pb.h> #include <contrib/libs/apache/arrow/cpp/src/arrow/scalar.h> #include <contrib/libs/apache/arrow/cpp/src/arrow/type.h> #include <memory> diff --git a/ydb/core/tx/columnshard/common/tests/ya.make b/ydb/core/tx/columnshard/common/tests/ya.make index 98401ad0e7..8b3c380900 100644 --- a/ydb/core/tx/columnshard/common/tests/ya.make +++ b/ydb/core/tx/columnshard/common/tests/ya.make @@ -5,7 +5,7 @@ SRCS( ) PEERDIR( - ydb/core/protos + ydb/core/formats/arrow/protos contrib/libs/apache/arrow ydb/core/formats/arrow ydb/core/kqp/compute_actor diff --git a/ydb/core/tx/columnshard/common/ya.make b/ydb/core/tx/columnshard/common/ya.make index 993b47fff6..87bd2c16b2 100644 --- a/ydb/core/tx/columnshard/common/ya.make +++ b/ydb/core/tx/columnshard/common/ya.make @@ -11,7 +11,7 @@ SRCS( ) PEERDIR( - ydb/core/protos + ydb/core/formats/arrow/protos contrib/libs/apache/arrow ydb/core/formats/arrow ydb/core/tx/columnshard/common/protos diff --git a/ydb/core/tx/columnshard/data_sharing/protos/data.proto b/ydb/core/tx/columnshard/data_sharing/protos/data.proto index f59d6e7b3d..e602bc4dbb 100644 --- a/ydb/core/tx/columnshard/data_sharing/protos/data.proto +++ b/ydb/core/tx/columnshard/data_sharing/protos/data.proto @@ -1,6 +1,6 @@ import "ydb/core/tx/columnshard/common/protos/blob_range.proto"; import "ydb/core/tx/columnshard/common/protos/snapshot.proto"; -import "ydb/core/protos/tx_columnshard.proto"; +import "ydb/core/tx/columnshard/engines/protos/portion_info.proto"; package NKikimrColumnShardDataSharingProto; diff --git a/ydb/core/tx/columnshard/data_sharing/protos/events.proto b/ydb/core/tx/columnshard/data_sharing/protos/events.proto index 7f60cea111..39d3290301 100644 --- a/ydb/core/tx/columnshard/data_sharing/protos/events.proto +++ b/ydb/core/tx/columnshard/data_sharing/protos/events.proto @@ -6,10 +6,6 @@ import "ydb/core/tx/columnshard/data_sharing/protos/initiator.proto"; package NKikimrColumnShardDataSharingProto; -message TEvProposeFromInitiator { - optional TDestinationSession Session = 1; -} - message TEvConfirmFromInitiator { optional string SessionId = 1; } diff --git a/ydb/core/tx/columnshard/data_sharing/protos/sessions.proto b/ydb/core/tx/columnshard/data_sharing/protos/sessions.proto index 9ae73bf261..ea01d6fc6f 100644 --- a/ydb/core/tx/columnshard/data_sharing/protos/sessions.proto +++ b/ydb/core/tx/columnshard/data_sharing/protos/sessions.proto @@ -57,3 +57,7 @@ message TSourceSession { repeated TPathPortionsHash PathHashes = 7; } } + +message TEvProposeFromInitiator { + optional TDestinationSession Session = 1; +} diff --git a/ydb/core/tx/columnshard/data_sharing/protos/ya.make b/ydb/core/tx/columnshard/data_sharing/protos/ya.make index f500be540e..3b50d7c230 100644 --- a/ydb/core/tx/columnshard/data_sharing/protos/ya.make +++ b/ydb/core/tx/columnshard/data_sharing/protos/ya.make @@ -9,10 +9,10 @@ SRCS( ) PEERDIR( + ydb/core/tx/columnshard/engines/protos ydb/core/tx/columnshard/common/protos ydb/library/actors/protos ydb/core/tx/columnshard/blobs_action/protos - ydb/core/protos ) diff --git a/ydb/core/tx/columnshard/engines/portions/column_record.h b/ydb/core/tx/columnshard/engines/portions/column_record.h index 79439b1dbb..2e890c97f9 100644 --- a/ydb/core/tx/columnshard/engines/portions/column_record.h +++ b/ydb/core/tx/columnshard/engines/portions/column_record.h @@ -2,7 +2,7 @@ #include "common.h" -#include <ydb/core/protos/tx_columnshard.pb.h> +#include <ydb/core/tx/columnshard/engines/protos/portion_info.pb.h> #include <ydb/core/tx/columnshard/blob.h> #include <ydb/core/tx/columnshard/common/snapshot.h> diff --git a/ydb/core/tx/columnshard/engines/portions/meta.h b/ydb/core/tx/columnshard/engines/portions/meta.h index 4d0dc65b1f..edb5ceeeaf 100644 --- a/ydb/core/tx/columnshard/engines/portions/meta.h +++ b/ydb/core/tx/columnshard/engines/portions/meta.h @@ -2,9 +2,9 @@ #include <ydb/core/tx/columnshard/common/portion.h> #include <ydb/core/tx/columnshard/common/snapshot.h> #include <ydb/core/tx/columnshard/engines/scheme/statistics/abstract/portion_storage.h> +#include <ydb/core/tx/columnshard/engines/protos/portion_info.pb.h> #include <ydb/core/formats/arrow/replace_key.h> #include <ydb/core/formats/arrow/special_keys.h> -#include <ydb/core/protos/tx_columnshard.pb.h> #include <ydb/library/accessor/accessor.h> #include <util/stream/output.h> diff --git a/ydb/core/tx/columnshard/engines/portions/ya.make b/ydb/core/tx/columnshard/engines/portions/ya.make index d9f35dbbac..ced1ad706c 100644 --- a/ydb/core/tx/columnshard/engines/portions/ya.make +++ b/ydb/core/tx/columnshard/engines/portions/ya.make @@ -18,6 +18,7 @@ PEERDIR( ydb/core/tx/columnshard/splitter ydb/core/tx/columnshard/common ydb/core/tx/columnshard/data_sharing/protos + ydb/core/tx/columnshard/engines/protos ydb/core/tablet_flat ) diff --git a/ydb/core/tx/columnshard/engines/protos/portion_info.proto b/ydb/core/tx/columnshard/engines/protos/portion_info.proto new file mode 100644 index 0000000000..b88ed00897 --- /dev/null +++ b/ydb/core/tx/columnshard/engines/protos/portion_info.proto @@ -0,0 +1,31 @@ +import "ydb/core/tx/columnshard/engines/scheme/statistics/protos/data.proto"; +import "ydb/core/formats/arrow/protos/ssa.proto"; + +package NKikimrTxColumnShard; + +message TSnapshot { + optional uint64 PlanStep = 1; + optional uint64 TxId = 2; +} + +message TIndexPortionMeta { + oneof Produced { + bool IsInserted = 1; + bool IsCompacted = 2; + bool IsSplitCompacted = 3; + bool IsEvicted = 4; + } + optional string TierName = 5; + optional bytes PrimaryKeyBorders = 6; // arrow::RecordBatch with first and last ReplaceKey rows + optional TSnapshot RecordSnapshotMin = 7; + optional TSnapshot RecordSnapshotMax = 8; + optional NKikimrColumnShardStatisticsProto.TPortionStorage StatisticsStorage = 9; +} + +message TIndexColumnMeta { + optional uint32 NumRows = 1; + optional uint32 RawBytes = 2; + optional NKikimrSSA.TProgram.TConstant MinValue = 3; + optional NKikimrSSA.TProgram.TConstant MaxValue = 4; + optional TIndexPortionMeta PortionMeta = 5; // First PK column could contain portion info +} diff --git a/ydb/core/tx/columnshard/engines/protos/ya.make b/ydb/core/tx/columnshard/engines/protos/ya.make new file mode 100644 index 0000000000..67c3e138a8 --- /dev/null +++ b/ydb/core/tx/columnshard/engines/protos/ya.make @@ -0,0 +1,13 @@ +PROTO_LIBRARY() + +SRCS( + portion_info.proto +) + +PEERDIR( + ydb/core/tx/columnshard/engines/scheme/statistics/protos + ydb/core/formats/arrow/protos + +) + +END() diff --git a/ydb/core/tx/columnshard/engines/scheme/indexes/abstract/checker.h b/ydb/core/tx/columnshard/engines/scheme/indexes/abstract/checker.h index 6258ad2933..a67a72df8e 100644 --- a/ydb/core/tx/columnshard/engines/scheme/indexes/abstract/checker.h +++ b/ydb/core/tx/columnshard/engines/scheme/indexes/abstract/checker.h @@ -1,5 +1,5 @@ #pragma once -#include <ydb/core/protos/ssa.pb.h> +#include <ydb/core/formats/arrow/protos/ssa.pb.h> #include <ydb/services/bg_tasks/abstract/interface.h> #include <ydb/library/accessor/accessor.h> #include <library/cpp/object_factory/object_factory.h> diff --git a/ydb/core/tx/columnshard/engines/scheme/indexes/abstract/ya.make b/ydb/core/tx/columnshard/engines/scheme/indexes/abstract/ya.make index f5babe9497..e758f9ecc4 100644 --- a/ydb/core/tx/columnshard/engines/scheme/indexes/abstract/ya.make +++ b/ydb/core/tx/columnshard/engines/scheme/indexes/abstract/ya.make @@ -10,8 +10,8 @@ SRCS( ) PEERDIR( - ydb/core/protos ydb/core/formats/arrow + ydb/core/formats/arrow/protos ) YQL_LAST_ABI_VERSION() diff --git a/ydb/core/tx/columnshard/engines/ya.make b/ydb/core/tx/columnshard/engines/ya.make index 4a244f8be4..4772008f14 100644 --- a/ydb/core/tx/columnshard/engines/ya.make +++ b/ydb/core/tx/columnshard/engines/ya.make @@ -29,6 +29,7 @@ PEERDIR( ydb/core/tx/columnshard/engines/insert_table ydb/core/tx/columnshard/engines/changes ydb/core/tx/columnshard/engines/portions + ydb/core/tx/columnshard/engines/protos ydb/core/tx/program ydb/core/tx/columnshard/common diff --git a/ydb/core/tx/columnshard/operations/write_data.h b/ydb/core/tx/columnshard/operations/write_data.h index 374cd06071..9fec5f5a1e 100644 --- a/ydb/core/tx/columnshard/operations/write_data.h +++ b/ydb/core/tx/columnshard/operations/write_data.h @@ -6,6 +6,7 @@ #include <ydb/core/tx/columnshard/engines/scheme/abstract_scheme.h> #include <ydb/core/tx/columnshard/engines/scheme/filtered_scheme.h> #include <ydb/core/protos/data_events.pb.h> +#include <ydb/core/protos/tx_columnshard.pb.h> namespace NKikimr::NColumnShard { diff --git a/ydb/core/tx/program/program.h b/ydb/core/tx/program/program.h index dfeb714a14..baf10a9cdd 100644 --- a/ydb/core/tx/program/program.h +++ b/ydb/core/tx/program/program.h @@ -2,7 +2,7 @@ #include "registry.h" #include <ydb/core/protos/flat_scheme_op.pb.h> -#include <ydb/core/protos/ssa.pb.h> +#include <ydb/core/formats/arrow/protos/ssa.pb.h> #include <ydb/core/formats/arrow/program.h> #include <ydb/core/formats/arrow/custom_registry.h> #include <ydb/core/tablet_flat/flat_dbase_scheme.h> diff --git a/ydb/core/tx/program/ya.make b/ydb/core/tx/program/ya.make index ac3f0c8a42..4e69528543 100644 --- a/ydb/core/tx/program/ya.make +++ b/ydb/core/tx/program/ya.make @@ -8,6 +8,7 @@ SRCS( PEERDIR( ydb/core/formats/arrow ydb/core/protos + ydb/core/formats/arrow/protos ydb/core/tablet_flat ydb/library/yql/minikql/comp_nodes ydb/library/yql/core/arrow_kernels/registry diff --git a/ydb/core/util/ui64id.h b/ydb/core/util/ui64id.h index 31ec310a6f..c5579fc415 100644 --- a/ydb/core/util/ui64id.h +++ b/ydb/core/util/ui64id.h @@ -1,6 +1,5 @@ #pragma once -#include <ydb/core/base/defs.h> #include <ydb/core/tablet_flat/flat_cxx_database.h> #include <util/system/types.h> diff --git a/ydb/library/conclusion/result.h b/ydb/library/conclusion/result.h index cd4034a754..72aaf29f1a 100644 --- a/ydb/library/conclusion/result.h +++ b/ydb/library/conclusion/result.h @@ -60,7 +60,7 @@ public: TResult&& DetachResult() { auto result = std::get_if<TResult>(&Result); - Y_ABORT_UNLESS(result, "incorrect object for result request"); + Y_ABORT_UNLESS(result, "incorrect object for result request: %s", GetErrorMessage().data()); return std::move(*result); } diff --git a/ydb/library/conclusion/status.cpp b/ydb/library/conclusion/status.cpp index 30b85520e2..bc355d9ff0 100644 --- a/ydb/library/conclusion/status.cpp +++ b/ydb/library/conclusion/status.cpp @@ -3,8 +3,12 @@ namespace NKikimr { -void TConclusionStatus::Validate() const { - AFL_VERIFY(Ok())("problem", GetErrorMessage()); +void TConclusionStatus::Validate(const TString& processInfo) const { + if (processInfo) { + AFL_VERIFY(Ok())("problem", GetErrorMessage())("process_info", processInfo); + } else { + AFL_VERIFY(Ok())("problem", GetErrorMessage()); + } } } diff --git a/ydb/library/conclusion/status.h b/ydb/library/conclusion/status.h index 97b45911c6..8e798f0583 100644 --- a/ydb/library/conclusion/status.h +++ b/ydb/library/conclusion/status.h @@ -30,7 +30,7 @@ private: Y_ABORT_UNLESS(!!ErrorMessage); } public: - void Validate() const; + void Validate(const TString& processInfo = Default<TString>()) const; const TString& GetErrorMessage() const { return ErrorMessage ? *ErrorMessage : Default<TString>(); |