Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
VPolka committed Dec 20, 2023
1 parent beeaa0a commit bcddff7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
12 changes: 6 additions & 6 deletions ydb/core/kqp/executer_actor/kqp_scheme_executer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,37 +166,37 @@ class TKqpSchemeExecuter : public TActorBootstrapped<TKqpSchemeExecuter> {
}

case NKqpProto::TKqpSchemeOperation::kCreateGroup: {
auto modifyScheme = schemeOp.GetCreateGroup();
const auto& modifyScheme = schemeOp.GetCreateGroup();
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
break;
}

case NKqpProto::TKqpSchemeOperation::kAddGroupMembership: {
auto modifyScheme = schemeOp.GetAddGroupMembership();
const auto& modifyScheme = schemeOp.GetAddGroupMembership();
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
break;
}

case NKqpProto::TKqpSchemeOperation::kRemoveGroupMembership: {
auto modifyScheme = schemeOp.GetRemoveGroupMembership();
const auto& modifyScheme = schemeOp.GetRemoveGroupMembership();
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
break;
}

case NKqpProto::TKqpSchemeOperation::kRenameGroup: {
auto modifyScheme = schemeOp.GetRenameGroup();
const auto& modifyScheme = schemeOp.GetRenameGroup();
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
break;
}

case NKqpProto::TKqpSchemeOperation::kDropGroup: {
auto modifyScheme = schemeOp.GetDropGroup();
const auto& modifyScheme = schemeOp.GetDropGroup();
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
break;
}

case NKqpProto::TKqpSchemeOperation::kModifyPermissions: {
auto modifyScheme = schemeOp.GetModifyPermissions();
const auto& modifyScheme = schemeOp.GetModifyPermissions();
ev->Record.MutableTransaction()->MutableModifyScheme()->CopyFrom(modifyScheme);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/kqp/gateway/kqp_ic_gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ class TKikimrIcGateway : public IKqpGateway {
TVector<std::pair<const TString*, std::pair<TString, TString>>> pathPairs;
pathPairs.reserve(settings.Pathes.size());
for (const auto& path : settings.Pathes) {
pathPairs.push_back(std::make_pair(&path, SplitPathByDirAndBaseNames(path)));
pathPairs.push_back(std::make_pair(&path, NSchemeHelpers::SplitPathByDirAndBaseNames(path)));
}

for (const auto& path : pathPairs) {
Expand Down
8 changes: 8 additions & 0 deletions ydb/core/kqp/gateway/utils/scheme_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,12 @@ void FillCreateExternalTableColumnDesc(NKikimrSchemeOp::TExternalTableDescriptio
externalTableDesc.SetContent(general.SerializeAsString());
}

std::pair<TString, TString> SplitPathByDirAndBaseNames(const TString& path) {
auto splitPos = path.find_last_of('/');
if (splitPos == path.npos || splitPos + 1 == path.size()) {
ythrow yexception() << "wrong path format '" << path << "'" ;
}
return {path.substr(0, splitPos), path.substr(splitPos + 1)};
}

} // namespace NKikimr::NKqp::NSchemeHelpers
2 changes: 2 additions & 0 deletions ydb/core/kqp/gateway/utils/scheme_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ void FillCreateExternalTableColumnDesc(NKikimrSchemeOp::TExternalTableDescriptio
const TString& name,
const NYql::TCreateExternalTableSettings& settings);

std::pair<TString, TString> SplitPathByDirAndBaseNames(const TString& path);

} // namespace NKikimr::NKqp::NSchemeHelpers
2 changes: 1 addition & 1 deletion ydb/core/kqp/host/kqp_gateway_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ class TKqpGatewayProxy : public IKikimrGateway {
TVector<std::pair<const TString*, std::pair<TString, TString>>> pathPairs;
pathPairs.reserve(settings.Pathes.size());
for (const auto& path : settings.Pathes) {
pathPairs.push_back(std::make_pair(&path, SplitPathByDirAndBaseNames(path)));
pathPairs.push_back(std::make_pair(&path, NSchemeHelpers::SplitPathByDirAndBaseNames(path)));
}

if (IsPrepare()) {
Expand Down

0 comments on commit bcddff7

Please sign in to comment.