Skip to content

Commit bcddff7

Browse files
committed
fix rebase
1 parent beeaa0a commit bcddff7

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

ydb/core/kqp/executer_actor/kqp_scheme_executer.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -166,37 +166,37 @@ class TKqpSchemeExecuter : public TActorBootstrapped<TKqpSchemeExecuter> {
166166
}
167167

168168
case NKqpProto::TKqpSchemeOperation::kCreateGroup: {
169-
auto modifyScheme = schemeOp.GetCreateGroup();
169+
const auto& modifyScheme = schemeOp.GetCreateGroup();
170170
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
171171
break;
172172
}
173173

174174
case NKqpProto::TKqpSchemeOperation::kAddGroupMembership: {
175-
auto modifyScheme = schemeOp.GetAddGroupMembership();
175+
const auto& modifyScheme = schemeOp.GetAddGroupMembership();
176176
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
177177
break;
178178
}
179179

180180
case NKqpProto::TKqpSchemeOperation::kRemoveGroupMembership: {
181-
auto modifyScheme = schemeOp.GetRemoveGroupMembership();
181+
const auto& modifyScheme = schemeOp.GetRemoveGroupMembership();
182182
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
183183
break;
184184
}
185185

186186
case NKqpProto::TKqpSchemeOperation::kRenameGroup: {
187-
auto modifyScheme = schemeOp.GetRenameGroup();
187+
const auto& modifyScheme = schemeOp.GetRenameGroup();
188188
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
189189
break;
190190
}
191191

192192
case NKqpProto::TKqpSchemeOperation::kDropGroup: {
193-
auto modifyScheme = schemeOp.GetDropGroup();
193+
const auto& modifyScheme = schemeOp.GetDropGroup();
194194
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
195195
break;
196196
}
197197

198198
case NKqpProto::TKqpSchemeOperation::kModifyPermissions: {
199-
auto modifyScheme = schemeOp.GetModifyPermissions();
199+
const auto& modifyScheme = schemeOp.GetModifyPermissions();
200200
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
201201
break;
202202
}

ydb/core/kqp/gateway/kqp_ic_gateway.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ class TKikimrIcGateway : public IKqpGateway {
13241324
TVector<std::pair<const TString*, std::pair<TString, TString>>> pathPairs;
13251325
pathPairs.reserve(settings.Pathes.size());
13261326
for (const auto& path : settings.Pathes) {
1327-
pathPairs.push_back(std::make_pair(&path, SplitPathByDirAndBaseNames(path)));
1327+
pathPairs.push_back(std::make_pair(&path, NSchemeHelpers::SplitPathByDirAndBaseNames(path)));
13281328
}
13291329

13301330
for (const auto& path : pathPairs) {

ydb/core/kqp/gateway/utils/scheme_helpers.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,12 @@ void FillCreateExternalTableColumnDesc(NKikimrSchemeOp::TExternalTableDescriptio
8686
externalTableDesc.SetContent(general.SerializeAsString());
8787
}
8888

89+
std::pair<TString, TString> SplitPathByDirAndBaseNames(const TString& path) {
90+
auto splitPos = path.find_last_of('/');
91+
if (splitPos == path.npos || splitPos + 1 == path.size()) {
92+
ythrow yexception() << "wrong path format '" << path << "'" ;
93+
}
94+
return {path.substr(0, splitPos), path.substr(splitPos + 1)};
95+
}
96+
8997
} // namespace NKikimr::NKqp::NSchemeHelpers

ydb/core/kqp/gateway/utils/scheme_helpers.h

+2
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ void FillCreateExternalTableColumnDesc(NKikimrSchemeOp::TExternalTableDescriptio
3131
const TString& name,
3232
const NYql::TCreateExternalTableSettings& settings);
3333

34+
std::pair<TString, TString> SplitPathByDirAndBaseNames(const TString& path);
35+
3436
} // namespace NKikimr::NKqp::NSchemeHelpers

ydb/core/kqp/host/kqp_gateway_proxy.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ class TKqpGatewayProxy : public IKikimrGateway {
845845
TVector<std::pair<const TString*, std::pair<TString, TString>>> pathPairs;
846846
pathPairs.reserve(settings.Pathes.size());
847847
for (const auto& path : settings.Pathes) {
848-
pathPairs.push_back(std::make_pair(&path, SplitPathByDirAndBaseNames(path)));
848+
pathPairs.push_back(std::make_pair(&path, NSchemeHelpers::SplitPathByDirAndBaseNames(path)));
849849
}
850850

851851
if (IsPrepare()) {

0 commit comments

Comments
 (0)