Skip to content

Commit 27e218f

Browse files
committed
use TabletId
1 parent 00a5df8 commit 27e218f

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

ydb/core/kqp/common/kqp_yql.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ TKqpReadTableSettings ParseInternal(const TCoNameValueTupleList& node) {
169169
YQL_ENSURE(tuple.Ref().ChildrenSize() == 1);
170170
settings.ForcePrimary = true;
171171
} else if (name == TKqpReadTableSettings::GroupByFieldNames) {
172-
} else if (name == TKqpReadTableSettings::ShardIdName) {
172+
} else if (name == TKqpReadTableSettings::TabletIdName) {
173173
YQL_ENSURE(tuple.Ref().ChildrenSize() == 2);
174-
settings.ShardId = FromString<ui64>(tuple.Value().Cast<TCoAtom>().Value());
174+
settings.TabletId = FromString<ui64>(tuple.Value().Cast<TCoAtom>().Value());
175175
}else {
176176
YQL_ENSURE(false, "Unknown KqpReadTable setting name '" << name << "'");
177177
}
@@ -259,13 +259,13 @@ NNodes::TCoNameValueTupleList TKqpReadTableSettings::BuildNode(TExprContext& ctx
259259
.Done());
260260
}
261261

262-
if (ShardId) {
262+
if (TabletId) {
263263
settings.emplace_back(
264264
Build<TCoNameValueTuple>(ctx, pos)
265265
.Name()
266-
.Build(ShardIdName)
266+
.Build(TabletIdName)
267267
.Value<TCoAtom>()
268-
.Value(ToString(*ShardId))
268+
.Value(ToString(*TabletId))
269269
.Build()
270270
.Done());
271271
}

ydb/core/kqp/common/kqp_yql.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ struct TKqpReadTableSettings {
8080
static constexpr TStringBuf SequentialSettingName = "Sequential";
8181
static constexpr TStringBuf ForcePrimaryName = "ForcePrimary";
8282
static constexpr TStringBuf GroupByFieldNames = "GroupByFieldNames";
83-
static constexpr TStringBuf ShardIdName = "ShardId";
83+
static constexpr TStringBuf TabletIdName = "TabletId";
8484

8585
TVector<TString> SkipNullKeys;
8686
TExprNode::TPtr ItemsLimit;
8787
bool Reverse = false;
8888
bool Sorted = false;
8989
TMaybe<ui64> SequentialInFlight;
90-
TMaybe<ui64> ShardId;
90+
TMaybe<ui64> TabletId;
9191
bool ForcePrimary = false;
9292

9393
void AddSkipNullKey(const TString& key);

ydb/core/kqp/executer_actor/kqp_partition_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ THashMap<ui64, TShardInfo> PrunePartitions(const NKqpProto::TKqpPhyOpReadOlapRan
712712
return shardInfoMap;
713713

714714
for (const auto& partition : stageInfo.Meta.ShardKey->GetPartitions()) {
715-
if (!readRanges.HasShardId() || readRanges.GetShardId() == partition.ShardId) {
715+
if (!readRanges.HasTabletId() || readRanges.GetTabletId() == partition.ShardId) {
716716
auto& shardInfo = shardInfoMap[partition.ShardId];
717717

718718
YQL_ENSURE(!shardInfo.KeyReadRanges);

ydb/core/kqp/opt/kqp_opt_kql.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ bool HasIndexesToWrite(const TKikimrTableDescription& tableData) {
9090
return hasIndexesToWrite;
9191
}
9292

93-
TExprBase BuildReadTable(const TCoAtomList& columns, TPositionHandle pos, const TKikimrTableDescription& tableData, bool forcePrimary, TMaybe<ui64> shardId,
93+
TExprBase BuildReadTable(const TCoAtomList& columns, TPositionHandle pos, const TKikimrTableDescription& tableData, bool forcePrimary, TMaybe<ui64> tabletId,
9494
TExprContext& ctx)
9595
{
9696
TExprNode::TPtr readTable;
9797
const auto& tableMeta = BuildTableMeta(tableData, pos, ctx);
9898

9999
TKqpReadTableSettings settings;
100100
settings.ForcePrimary = forcePrimary;
101-
settings.ShardId = shardId;
101+
settings.TabletId = tabletId;
102102

103103
readTable = Build<TKqlReadTableRanges>(ctx, pos)
104104
.Table(tableMeta)
@@ -118,10 +118,10 @@ TExprBase BuildReadTable(const TKiReadTable& read, const TKikimrTableDescription
118118
bool withSystemColumns, TExprContext& ctx)
119119
{
120120
const auto& columns = read.GetSelectColumns(ctx, tableData, withSystemColumns);
121-
const auto shardId = NYql::HasSetting(read.Settings().Ref(), "shardid")
122-
? TMaybe<ui64>{FromString<ui64>(NYql::GetSetting(read.Settings().Ref(), "shardid")->Child(1)->Content())}
121+
const auto tabletId = NYql::HasSetting(read.Settings().Ref(), "tabletid")
122+
? TMaybe<ui64>{FromString<ui64>(NYql::GetSetting(read.Settings().Ref(), "tabletid")->Child(1)->Content())}
123123
: TMaybe<ui64>{};
124-
auto readNode = BuildReadTable(columns, read.Pos(), tableData, forcePrimary, shardId, ctx);
124+
auto readNode = BuildReadTable(columns, read.Pos(), tableData, forcePrimary, tabletId, ctx);
125125

126126
return readNode;
127127
}

ydb/core/kqp/query_compiler/kqp_query_compiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ void FillReadRanges(const TReader& read, const TKikimrTableMetadata&, TProto& re
397397

398398
if constexpr (std::is_same_v<TProto, NKqpProto::TKqpPhyOpReadOlapRanges>) {
399399
readProto.SetSorted(settings.Sorted);
400-
if (settings.ShardId) {
401-
readProto.SetShardId(*settings.ShardId);
400+
if (settings.TabletId) {
401+
readProto.SetTabletId(*settings.TabletId);
402402
}
403403
}
404404

ydb/core/kqp/ut/olap/kqp_olap_ut.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,7 +3275,7 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
32753275
PRIMARY KEY (Name, Id)
32763276
) WITH (
32773277
STORE = COLUMN,
3278-
AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 3
3278+
PARTITION_COUNT = 3
32793279
);
32803280
32813281
)", noTx).GetValueSync();
@@ -3297,13 +3297,13 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
32973297
UNIT_ASSERT_C(result.GetStatus() == NYdb::EStatus::SUCCESS, result.GetIssues().ToString());
32983298
//TODO USE shard ids from the table description. Not avaiable now
32993299
{
3300-
auto result = queryClient.ExecuteQuery("SELECT * FROM Test WITH (ShardId = '72075186224037888')", noTx).GetValueSync();
3300+
auto result = queryClient.ExecuteQuery("SELECT * FROM Test WITH TabletId = '72075186224037888'", noTx).GetValueSync();
33013301
UNIT_ASSERT_C(result.GetStatus() == NYdb::EStatus::SUCCESS, result.GetIssues().ToString());
33023302
CompareYson("[[[\"bb\"];20u;\"n2\"];[[\"dd\"];40u;\"n4\"]]", FormatResultSetYson(result.GetResultSet(0)));
3303-
result = queryClient.ExecuteQuery("SELECT * FROM Test WITH ShardId = '72075186224037889'", noTx).GetValueSync();
3303+
result = queryClient.ExecuteQuery("SELECT * FROM Test WITH TabletId = '72075186224037889'", noTx).GetValueSync();
33043304
UNIT_ASSERT_C(result.GetStatus() == NYdb::EStatus::SUCCESS, result.GetIssues().ToString());
33053305
CompareYson("[[[\"ee\"];50u;\"n5\"]]", FormatResultSetYson(result.GetResultSet(0)));
3306-
result = queryClient.ExecuteQuery("SELECT * FROM Test WITH (ShardId = '72075186224037890')", noTx).GetValueSync();
3306+
result = queryClient.ExecuteQuery("SELECT * FROM Test WITH TabletId = '72075186224037890'", noTx).GetValueSync();
33073307
UNIT_ASSERT_C(result.GetStatus() == NYdb::EStatus::SUCCESS, result.GetIssues().ToString());
33083308
CompareYson("[[[\"aa\"];10u;\"n1\"];[[\"cc\"];30u;\"n3\"]]", FormatResultSetYson(result.GetResultSet(0)));
33093309
}

0 commit comments

Comments
 (0)