Skip to content

Commit 4d46da9

Browse files
authored
Merge 536cec7 into 9c31292
2 parents 9c31292 + 536cec7 commit 4d46da9

File tree

67 files changed

+756
-711
lines changed

Some content is hidden

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

67 files changed

+756
-711
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(*node->Child(TYtWriteTable::idx_Settings),
249+
EYtSettingType::MutationId,
250+
ctx.NewAtom(node->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/sql/dq_file/part0/canondata/result.json

+21-21
Original file line numberDiff line numberDiff line change
@@ -927,9 +927,9 @@
927927
],
928928
"test.test[insert-append_after_replace-default.txt-Debug]": [
929929
{
930-
"checksum": "99e704a2ae72ec9c09fc113aa894609f",
931-
"size": 2783,
932-
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_insert-append_after_replace-default.txt-Debug_/opt.yql_patched"
930+
"checksum": "346e9980be178e50040b1bc905424347",
931+
"size": 2855,
932+
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-append_after_replace-default.txt-Debug_/opt.yql_patched"
933933
}
934934
],
935935
"test.test[insert-append_after_replace-default.txt-Plan]": [
@@ -949,9 +949,9 @@
949949
],
950950
"test.test[insert-insert_null-default.txt-Debug]": [
951951
{
952-
"checksum": "d85489412c08664f6c1b60e9e4febe2c",
953-
"size": 974,
954-
"uri": "https://{canondata_backend}/1781765/f26d371bb6fecd48cec752e2b66c84e8cf31510e/resource.tar.gz#test.test_insert-insert_null-default.txt-Debug_/opt.yql_patched"
952+
"checksum": "aeae48d7e4c8099fbc06019e01c67c4f",
953+
"size": 994,
954+
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-insert_null-default.txt-Debug_/opt.yql_patched"
955955
}
956956
],
957957
"test.test[insert-insert_null-default.txt-Plan]": [
@@ -971,9 +971,9 @@
971971
],
972972
"test.test[insert-insert_relabeled-default.txt-Debug]": [
973973
{
974-
"checksum": "f897154fb9f369da00882f696c9ccbb3",
975-
"size": 2325,
976-
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_insert-insert_relabeled-default.txt-Debug_/opt.yql_patched"
974+
"checksum": "776f429f9af2036706ae3598ca7524ec",
975+
"size": 2345,
976+
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-insert_relabeled-default.txt-Debug_/opt.yql_patched"
977977
}
978978
],
979979
"test.test[insert-insert_relabeled-default.txt-Plan]": [
@@ -1015,9 +1015,9 @@
10151015
],
10161016
"test.test[insert-literals_to_string-default.txt-Debug]": [
10171017
{
1018-
"checksum": "ecb63bbe142320f0129a889e9dd4d222",
1019-
"size": 1131,
1020-
"uri": "https://{canondata_backend}/1781765/f26d371bb6fecd48cec752e2b66c84e8cf31510e/resource.tar.gz#test.test_insert-literals_to_string-default.txt-Debug_/opt.yql_patched"
1018+
"checksum": "cb9d6cfc0b3cafed94c2ad2e814bb5b5",
1019+
"size": 1151,
1020+
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-literals_to_string-default.txt-Debug_/opt.yql_patched"
10211021
}
10221022
],
10231023
"test.test[insert-literals_to_string-default.txt-Plan]": [
@@ -1037,9 +1037,9 @@
10371037
],
10381038
"test.test[insert-override--Debug]": [
10391039
{
1040-
"checksum": "de190e89f0646099d381d4c38cf9ae89",
1041-
"size": 1838,
1042-
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_insert-override--Debug_/opt.yql_patched"
1040+
"checksum": "f963ea0cd181e78eb4ecb1150d8185e8",
1041+
"size": 1876,
1042+
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-override--Debug_/opt.yql_patched"
10431043
}
10441044
],
10451045
"test.test[insert-override--Plan]": [
@@ -1062,9 +1062,9 @@
10621062
],
10631063
"test.test[insert-select_after_replace-default.txt-Debug]": [
10641064
{
1065-
"checksum": "c1f892bdda168bf7deb022136978fb40",
1066-
"size": 2554,
1067-
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_insert-select_after_replace-default.txt-Debug_/opt.yql_patched"
1065+
"checksum": "45e959c745057448b49fc8b32dd3f6de",
1066+
"size": 2592,
1067+
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-select_after_replace-default.txt-Debug_/opt.yql_patched"
10681068
}
10691069
],
10701070
"test.test[insert-select_after_replace-default.txt-Plan]": [
@@ -1766,9 +1766,9 @@
17661766
],
17671767
"test.test[limit-insert_with_limit--Debug]": [
17681768
{
1769-
"checksum": "908a867ff61e69fba4b44bca3e46a172",
1770-
"size": 1869,
1771-
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_limit-insert_with_limit--Debug_/opt.yql_patched"
1769+
"checksum": "3ae0ee09ce70615650dd25ae7b4e63bb",
1770+
"size": 1907,
1771+
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_limit-insert_with_limit--Debug_/opt.yql_patched"
17721772
}
17731773
],
17741774
"test.test[limit-insert_with_limit--Plan]": [

ydb/library/yql/tests/sql/dq_file/part1/canondata/result.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,9 @@
11261126
],
11271127
"test.test[insert-select_after_replace_unwrap-default.txt-Debug]": [
11281128
{
1129-
"checksum": "97cbf6f63c3075441943ca9baa61b5f8",
1130-
"size": 2751,
1131-
"uri": "https://{canondata_backend}/1937027/25020bb5ffa145ed0ca6d209316037bad6e8d9e9/resource.tar.gz#test.test_insert-select_after_replace_unwrap-default.txt-Debug_/opt.yql_patched"
1129+
"checksum": "f27a400ab75ee146acb35ebd66517b5e",
1130+
"size": 2789,
1131+
"uri": "https://{canondata_backend}/212715/aab8e82a2c99c314ec161e2391e4cf12a1c26fd8/resource.tar.gz#test.test_insert-select_after_replace_unwrap-default.txt-Debug_/opt.yql_patched"
11321132
}
11331133
],
11341134
"test.test[insert-select_after_replace_unwrap-default.txt-Plan]": [
@@ -1158,9 +1158,9 @@
11581158
],
11591159
"test.test[insert-yql-13083-existig-Debug]": [
11601160
{
1161-
"checksum": "99983563d20b865b9dae366ff3c467d1",
1162-
"size": 6004,
1163-
"uri": "https://{canondata_backend}/1937027/591a1ceca790d81eaf524a7a3e730722b0d7bdb7/resource.tar.gz#test.test_insert-yql-13083-existig-Debug_/opt.yql_patched"
1161+
"checksum": "931cf092daddb09dab6373bb86834377",
1162+
"size": 6120,
1163+
"uri": "https://{canondata_backend}/212715/aab8e82a2c99c314ec161e2391e4cf12a1c26fd8/resource.tar.gz#test.test_insert-yql-13083-existig-Debug_/opt.yql_patched"
11641164
}
11651165
],
11661166
"test.test[insert-yql-13083-existig-Plan]": [
@@ -1184,9 +1184,9 @@
11841184
],
11851185
"test.test[insert_monotonic-from_empty--Debug]": [
11861186
{
1187-
"checksum": "64de1e36b2fd89bc0ba6bc86ceb5ffaf",
1188-
"size": 2617,
1189-
"uri": "https://{canondata_backend}/1937027/25020bb5ffa145ed0ca6d209316037bad6e8d9e9/resource.tar.gz#test.test_insert_monotonic-from_empty--Debug_/opt.yql_patched"
1187+
"checksum": "de5f80bf64423e3015fc1b83c9403a15",
1188+
"size": 2655,
1189+
"uri": "https://{canondata_backend}/212715/aab8e82a2c99c314ec161e2391e4cf12a1c26fd8/resource.tar.gz#test.test_insert_monotonic-from_empty--Debug_/opt.yql_patched"
11901190
}
11911191
],
11921192
"test.test[insert_monotonic-from_empty--Plan]": [
@@ -1809,9 +1809,9 @@
18091809
],
18101810
"test.test[pg-insert--Debug]": [
18111811
{
1812-
"checksum": "be1ae752d424d0c396b4c88751db6934",
1813-
"size": 1867,
1814-
"uri": "https://{canondata_backend}/1937027/25020bb5ffa145ed0ca6d209316037bad6e8d9e9/resource.tar.gz#test.test_pg-insert--Debug_/opt.yql_patched"
1812+
"checksum": "3a9b6baa97c72b4ef351b97da423710e",
1813+
"size": 1905,
1814+
"uri": "https://{canondata_backend}/212715/aab8e82a2c99c314ec161e2391e4cf12a1c26fd8/resource.tar.gz#test.test_pg-insert--Debug_/opt.yql_patched"
18151815
}
18161816
],
18171817
"test.test[pg-insert--Plan]": [

ydb/library/yql/tests/sql/dq_file/part10/canondata/result.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1037,9 +1037,9 @@
10371037
],
10381038
"test.test[insert-double_append_to_anonymous--Debug]": [
10391039
{
1040-
"checksum": "60d31c24b538a750af98ba2fe35a3a38",
1041-
"size": 2491,
1042-
"uri": "https://{canondata_backend}/1600758/32cfdeb8c6377a2e7e62c6c4adbb95f25af7669b/resource.tar.gz#test.test_insert-double_append_to_anonymous--Debug_/opt.yql_patched"
1040+
"checksum": "5197ddd521048e287c091281a04296c2",
1041+
"size": 2545,
1042+
"uri": "https://{canondata_backend}/1942415/ad5ade59004e97b62f357b05c8baba968f696aa5/resource.tar.gz#test.test_insert-double_append_to_anonymous--Debug_/opt.yql_patched"
10431043
}
10441044
],
10451045
"test.test[insert-double_append_to_anonymous--Plan]": [
@@ -1059,9 +1059,9 @@
10591059
],
10601060
"test.test[insert-replace_inferred--Debug]": [
10611061
{
1062-
"checksum": "1d3d29b32c726ccc9f3bbdfafbf04096",
1063-
"size": 2799,
1064-
"uri": "https://{canondata_backend}/1600758/32cfdeb8c6377a2e7e62c6c4adbb95f25af7669b/resource.tar.gz#test.test_insert-replace_inferred--Debug_/opt.yql_patched"
1062+
"checksum": "a150123bc33eb7942a50c79446859b06",
1063+
"size": 2819,
1064+
"uri": "https://{canondata_backend}/1942415/ad5ade59004e97b62f357b05c8baba968f696aa5/resource.tar.gz#test.test_insert-replace_inferred--Debug_/opt.yql_patched"
10651065
}
10661066
],
10671067
"test.test[insert-replace_inferred--Plan]": [
@@ -2215,9 +2215,9 @@
22152215
],
22162216
"test.test[schema-insert-schema-Debug]": [
22172217
{
2218-
"checksum": "82fa4c098e6ea6770642257b18016045",
2219-
"size": 2882,
2220-
"uri": "https://{canondata_backend}/1600758/32cfdeb8c6377a2e7e62c6c4adbb95f25af7669b/resource.tar.gz#test.test_schema-insert-schema-Debug_/opt.yql_patched"
2218+
"checksum": "34b6c7ae9902821e81cb19edab1e0ecc",
2219+
"size": 2950,
2220+
"uri": "https://{canondata_backend}/1942415/ad5ade59004e97b62f357b05c8baba968f696aa5/resource.tar.gz#test.test_schema-insert-schema-Debug_/opt.yql_patched"
22212221
}
22222222
],
22232223
"test.test[schema-insert-schema-Plan]": [
@@ -2413,9 +2413,9 @@
24132413
],
24142414
"test.test[type_v3-insert_struct_v3_with_native--Debug]": [
24152415
{
2416-
"checksum": "7251ed5ac5deb03a27a15b6ccf1e484b",
2417-
"size": 5158,
2418-
"uri": "https://{canondata_backend}/1600758/32cfdeb8c6377a2e7e62c6c4adbb95f25af7669b/resource.tar.gz#test.test_type_v3-insert_struct_v3_with_native--Debug_/opt.yql_patched"
2416+
"checksum": "a9d8d4df01650c1a934396299ba0f22c",
2417+
"size": 5262,
2418+
"uri": "https://{canondata_backend}/1942415/ad5ade59004e97b62f357b05c8baba968f696aa5/resource.tar.gz#test.test_type_v3-insert_struct_v3_with_native--Debug_/opt.yql_patched"
24192419
}
24202420
],
24212421
"test.test[type_v3-insert_struct_v3_with_native--Plan]": [

ydb/library/yql/tests/sql/dq_file/part11/canondata/result.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
],
5353
"test.test[action-insert_each_from_folder--Debug]": [
5454
{
55-
"checksum": "12b1eea2d86f824793dddebbb179462d",
56-
"size": 2872,
57-
"uri": "https://{canondata_backend}/1936947/a99026e839b7e22714c2a9a81971a3b5e3ed1eb4/resource.tar.gz#test.test_action-insert_each_from_folder--Debug_/opt.yql_patched"
55+
"checksum": "15b1eb60c28d6b26d55413c1139c15c3",
56+
"size": 2892,
57+
"uri": "https://{canondata_backend}/212715/3cac1a84dde5e49e449b3f732e02eb495279cd27/resource.tar.gz#test.test_action-insert_each_from_folder--Debug_/opt.yql_patched"
5858
}
5959
],
6060
"test.test[action-insert_each_from_folder--Plan]": [
@@ -910,9 +910,9 @@
910910
],
911911
"test.test[insert-select_after_insert_relabeled-default.txt-Debug]": [
912912
{
913-
"checksum": "b31313953d6a72280b0b5e5c5419b1e3",
914-
"size": 3279,
915-
"uri": "https://{canondata_backend}/1936947/a99026e839b7e22714c2a9a81971a3b5e3ed1eb4/resource.tar.gz#test.test_insert-select_after_insert_relabeled-default.txt-Debug_/opt.yql_patched"
913+
"checksum": "62f9861149529bbaf01dd9461f777cd7",
914+
"size": 3299,
915+
"uri": "https://{canondata_backend}/212715/3cac1a84dde5e49e449b3f732e02eb495279cd27/resource.tar.gz#test.test_insert-select_after_insert_relabeled-default.txt-Debug_/opt.yql_patched"
916916
}
917917
],
918918
"test.test[insert-select_after_insert_relabeled-default.txt-Plan]": [
@@ -932,9 +932,9 @@
932932
],
933933
"test.test[insert-trivial_literals_multirow-default.txt-Debug]": [
934934
{
935-
"checksum": "35212fa835ba0068ac0bf5197358137c",
936-
"size": 1362,
937-
"uri": "https://{canondata_backend}/1936947/a99026e839b7e22714c2a9a81971a3b5e3ed1eb4/resource.tar.gz#test.test_insert-trivial_literals_multirow-default.txt-Debug_/opt.yql_patched"
935+
"checksum": "256ebc9f8c695e92c47875c9963c1739",
936+
"size": 1382,
937+
"uri": "https://{canondata_backend}/212715/3cac1a84dde5e49e449b3f732e02eb495279cd27/resource.tar.gz#test.test_insert-trivial_literals_multirow-default.txt-Debug_/opt.yql_patched"
938938
}
939939
],
940940
"test.test[insert-trivial_literals_multirow-default.txt-Plan]": [
@@ -954,9 +954,9 @@
954954
],
955955
"test.test[insert-yql-13083--Debug]": [
956956
{
957-
"checksum": "97b0a0e199eefa00df33312f8fab811a",
958-
"size": 5795,
959-
"uri": "https://{canondata_backend}/1936947/a99026e839b7e22714c2a9a81971a3b5e3ed1eb4/resource.tar.gz#test.test_insert-yql-13083--Debug_/opt.yql_patched"
957+
"checksum": "efbafe9573bd85afe59bc99b04253db3",
958+
"size": 5858,
959+
"uri": "https://{canondata_backend}/212715/3cac1a84dde5e49e449b3f732e02eb495279cd27/resource.tar.gz#test.test_insert-yql-13083--Debug_/opt.yql_patched"
960960
}
961961
],
962962
"test.test[insert-yql-13083--Plan]": [

0 commit comments

Comments
 (0)