Skip to content

Commit 0fc8efe

Browse files
authored
Merge 2727540 into 3215892
2 parents 3215892 + 2727540 commit 0fc8efe

File tree

77 files changed

+3120
-3075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3120
-3075
lines changed

ydb/library/yql/providers/yt/provider/yql_yt_datasink.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ class TYtDataSink : public TDataProviderBase {
243243
ctx);
244244
res = ctx.ChangeChild(*res, TYtWriteTable::idx_Settings, std::move(settings));
245245
}
246+
auto mutationId = ++NextMutationId_;
247+
res = ctx.ChangeChild(*res, TYtWriteTable::idx_Settings,
248+
NYql::AddSetting(*res->Child(TYtWriteTable::idx_Settings),
249+
EYtSettingType::MutationId,
250+
ctx.NewAtom(res->Child(TYtWriteTable::idx_Settings)->Pos(), ToString(mutationId)), ctx));
246251
if (State_->Configuration->UseSystemColumns.Get().GetOrElse(DEFAULT_USE_SYS_COLUMNS)) {
247252
res = ctx.ChangeChild(*res, TYtWriteTable::idx_Content,
248253
ctx.Builder(node->Pos())
@@ -268,6 +273,7 @@ class TYtDataSink : public TDataProviderBase {
268273
void Reset() final {
269274
TDataProviderBase::Reset();
270275
State_->Reset();
276+
NextMutationId_ = 0;
271277
}
272278

273279
bool CanExecute(const TExprNode& node) override {
@@ -567,6 +573,7 @@ class TYtDataSink : public TDataProviderBase {
567573
}
568574

569575
private:
576+
ui32 NextMutationId_ = 0;
570577
TYtState::TPtr State_;
571578
TLazyInitHolder<IGraphTransformer> IntentDeterminationTransformer_;
572579
TLazyInitHolder<TVisitorTransformerBase> TypeAnnotationTransformer_;

ydb/library/yql/providers/yt/provider/yql_yt_datasink_type_ann.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,7 @@ class TYtDataSinkTypeAnnotationTransformer : public TVisitorTransformerBase {
14351435
| EYtSettingType::PrimaryMedium
14361436
| EYtSettingType::Expiration
14371437
| EYtSettingType::MonotonicKeys
1438+
| EYtSettingType::MutationId
14381439
, ctx))
14391440
{
14401441
return TStatus::Error;
@@ -1712,6 +1713,7 @@ class TYtDataSinkTypeAnnotationTransformer : public TVisitorTransformerBase {
17121713
| EYtSettingType::PrimaryMedium
17131714
| EYtSettingType::Expiration
17141715
| EYtSettingType::MonotonicKeys
1716+
| EYtSettingType::MutationId
17151717
, ctx))
17161718
{
17171719
return TStatus::Error;

ydb/library/yql/providers/yt/provider/yql_yt_op_settings.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,20 @@ bool ValidateSettings(const TExprNode& settingsNode, EYtSettingTypes accepted, T
795795
return false;
796796
}
797797
break;
798+
case EYtSettingType::MutationId:
799+
if (!EnsureTupleSize(*setting, 2, ctx)) {
800+
return false;
801+
}
802+
if (!EnsureAtom(*setting->Child(1), ctx)) {
803+
return false;
804+
}
805+
ui32 mutationId;
806+
if (!TryFromString(setting->Child(1)->Content(), mutationId)) {
807+
ctx.AddError(TIssue(ctx.GetPosition(setting->Child(1)->Pos()), TStringBuilder()
808+
<< "Expected a number, but got: " << TString{setting->Child(1)->Content()}.Quote()));
809+
return false;
810+
}
811+
break;
798812
}
799813
}
800814

ydb/library/yql/providers/yt/provider/yql_yt_op_settings.h

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ enum class EYtSettingType: ui64 {
112112
PrimaryMedium = 1ull << 59 /* "primary_medium", "primarymedium" */,
113113
KeepMeta = 1ull << 60 /* "keep_meta", "keepmeta" */,
114114
MonotonicKeys = 1ull << 61 /* "monotonic_keys", "monotonickeys" */,
115+
MutationId = 1ull << 62 /* "mutationid", "mutation_id" */,
115116
};
116117

117118
Y_DECLARE_FLAGS(EYtSettingTypes, EYtSettingType);

ydb/library/yql/sql/v1/sql_query.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ bool TSqlQuery::Statement(TVector<TNodePtr>& blocks, const TRule_sql_stmt_core&
299299
break;
300300
}
301301
case TRule_sql_stmt_core::kAltSqlStmtCore8: {
302+
if (Ctx.ParallelModeCount > 0) {
303+
Error() << humanStatementName << " statement is not supported in parallel mode";
304+
return false;
305+
}
306+
302307
Ctx.BodyPart();
303308
const auto& rule = core.GetAlt_sql_stmt_core8().GetRule_commit_stmt1();
304309
Token(rule.GetToken1());
@@ -324,6 +329,11 @@ bool TSqlQuery::Statement(TVector<TNodePtr>& blocks, const TRule_sql_stmt_core&
324329
break;
325330
}
326331
case TRule_sql_stmt_core::kAltSqlStmtCore11: {
332+
if (Ctx.ParallelModeCount > 0) {
333+
Error() << humanStatementName << " statement is not supported in parallel mode";
334+
return false;
335+
}
336+
327337
Ctx.BodyPart();
328338
const auto& rule = core.GetAlt_sql_stmt_core11().GetRule_rollback_stmt1();
329339
Token(rule.GetToken1());

ydb/library/yql/tests/s-expressions/yt_native_file/part0/canondata/result.json

+78-78
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)