Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
vitstn committed Feb 8, 2024
1 parent 8adf99d commit 536cec7
Show file tree
Hide file tree
Showing 67 changed files with 756 additions and 711 deletions.
7 changes: 7 additions & 0 deletions ydb/library/yql/providers/yt/provider/yql_yt_datasink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ class TYtDataSink : public TDataProviderBase {
ctx);
res = ctx.ChangeChild(*res, TYtWriteTable::idx_Settings, std::move(settings));
}
auto mutationId = ++NextMutationId_;
res = ctx.ChangeChild(*res, TYtWriteTable::idx_Settings,
NYql::AddSetting(*node->Child(TYtWriteTable::idx_Settings),
EYtSettingType::MutationId,
ctx.NewAtom(node->Child(TYtWriteTable::idx_Settings)->Pos(), ToString(mutationId)), ctx));
if (State_->Configuration->UseSystemColumns.Get().GetOrElse(DEFAULT_USE_SYS_COLUMNS)) {
res = ctx.ChangeChild(*res, TYtWriteTable::idx_Content,
ctx.Builder(node->Pos())
Expand All @@ -268,6 +273,7 @@ class TYtDataSink : public TDataProviderBase {
void Reset() final {
TDataProviderBase::Reset();
State_->Reset();
NextMutationId_ = 0;
}

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

private:
ui32 NextMutationId_ = 0;
TYtState::TPtr State_;
TLazyInitHolder<IGraphTransformer> IntentDeterminationTransformer_;
TLazyInitHolder<TVisitorTransformerBase> TypeAnnotationTransformer_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,7 @@ class TYtDataSinkTypeAnnotationTransformer : public TVisitorTransformerBase {
| EYtSettingType::PrimaryMedium
| EYtSettingType::Expiration
| EYtSettingType::MonotonicKeys
| EYtSettingType::MutationId
, ctx))
{
return TStatus::Error;
Expand Down Expand Up @@ -1712,6 +1713,7 @@ class TYtDataSinkTypeAnnotationTransformer : public TVisitorTransformerBase {
| EYtSettingType::PrimaryMedium
| EYtSettingType::Expiration
| EYtSettingType::MonotonicKeys
| EYtSettingType::MutationId
, ctx))
{
return TStatus::Error;
Expand Down
14 changes: 14 additions & 0 deletions ydb/library/yql/providers/yt/provider/yql_yt_op_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,20 @@ bool ValidateSettings(const TExprNode& settingsNode, EYtSettingTypes accepted, T
return false;
}
break;
case EYtSettingType::MutationId:
if (!EnsureTupleSize(*setting, 2, ctx)) {
return false;
}
if (!EnsureAtom(*setting->Child(1), ctx)) {
return false;
}
ui32 mutationId;
if (!TryFromString(setting->Child(1)->Content(), mutationId)) {
ctx.AddError(TIssue(ctx.GetPosition(setting->Child(1)->Pos()), TStringBuilder()
<< "Expected a number, but got: " << TString{setting->Child(1)->Content()}.Quote()));
return false;
}
break;
}
}

Expand Down
1 change: 1 addition & 0 deletions ydb/library/yql/providers/yt/provider/yql_yt_op_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ enum class EYtSettingType: ui64 {
PrimaryMedium = 1ull << 59 /* "primary_medium", "primarymedium" */,
KeepMeta = 1ull << 60 /* "keep_meta", "keepmeta" */,
MonotonicKeys = 1ull << 61 /* "monotonic_keys", "monotonickeys" */,
MutationId = 1ull << 62 /* "mutationid", "mutation_id" */,
};

Y_DECLARE_FLAGS(EYtSettingTypes, EYtSettingType);
Expand Down
10 changes: 10 additions & 0 deletions ydb/library/yql/sql/v1/sql_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ bool TSqlQuery::Statement(TVector<TNodePtr>& blocks, const TRule_sql_stmt_core&
break;
}
case TRule_sql_stmt_core::kAltSqlStmtCore8: {
if (Ctx.ParallelModeCount > 0) {
Error() << humanStatementName << " statement is not supported in parallel mode";
return false;
}

Ctx.BodyPart();
const auto& rule = core.GetAlt_sql_stmt_core8().GetRule_commit_stmt1();
Token(rule.GetToken1());
Expand All @@ -320,6 +325,11 @@ bool TSqlQuery::Statement(TVector<TNodePtr>& blocks, const TRule_sql_stmt_core&
break;
}
case TRule_sql_stmt_core::kAltSqlStmtCore11: {
if (Ctx.ParallelModeCount > 0) {
Error() << humanStatementName << " statement is not supported in parallel mode";
return false;
}

Ctx.BodyPart();
const auto& rule = core.GetAlt_sql_stmt_core11().GetRule_rollback_stmt1();
Token(rule.GetToken1());
Expand Down
42 changes: 21 additions & 21 deletions ydb/library/yql/tests/sql/dq_file/part0/canondata/result.json
Original file line number Diff line number Diff line change
Expand Up @@ -927,9 +927,9 @@
],
"test.test[insert-append_after_replace-default.txt-Debug]": [
{
"checksum": "99e704a2ae72ec9c09fc113aa894609f",
"size": 2783,
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_insert-append_after_replace-default.txt-Debug_/opt.yql_patched"
"checksum": "346e9980be178e50040b1bc905424347",
"size": 2855,
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-append_after_replace-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[insert-append_after_replace-default.txt-Plan]": [
Expand All @@ -949,9 +949,9 @@
],
"test.test[insert-insert_null-default.txt-Debug]": [
{
"checksum": "d85489412c08664f6c1b60e9e4febe2c",
"size": 974,
"uri": "https://{canondata_backend}/1781765/f26d371bb6fecd48cec752e2b66c84e8cf31510e/resource.tar.gz#test.test_insert-insert_null-default.txt-Debug_/opt.yql_patched"
"checksum": "aeae48d7e4c8099fbc06019e01c67c4f",
"size": 994,
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-insert_null-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[insert-insert_null-default.txt-Plan]": [
Expand All @@ -971,9 +971,9 @@
],
"test.test[insert-insert_relabeled-default.txt-Debug]": [
{
"checksum": "f897154fb9f369da00882f696c9ccbb3",
"size": 2325,
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_insert-insert_relabeled-default.txt-Debug_/opt.yql_patched"
"checksum": "776f429f9af2036706ae3598ca7524ec",
"size": 2345,
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-insert_relabeled-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[insert-insert_relabeled-default.txt-Plan]": [
Expand Down Expand Up @@ -1015,9 +1015,9 @@
],
"test.test[insert-literals_to_string-default.txt-Debug]": [
{
"checksum": "ecb63bbe142320f0129a889e9dd4d222",
"size": 1131,
"uri": "https://{canondata_backend}/1781765/f26d371bb6fecd48cec752e2b66c84e8cf31510e/resource.tar.gz#test.test_insert-literals_to_string-default.txt-Debug_/opt.yql_patched"
"checksum": "cb9d6cfc0b3cafed94c2ad2e814bb5b5",
"size": 1151,
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-literals_to_string-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[insert-literals_to_string-default.txt-Plan]": [
Expand All @@ -1037,9 +1037,9 @@
],
"test.test[insert-override--Debug]": [
{
"checksum": "de190e89f0646099d381d4c38cf9ae89",
"size": 1838,
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_insert-override--Debug_/opt.yql_patched"
"checksum": "f963ea0cd181e78eb4ecb1150d8185e8",
"size": 1876,
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-override--Debug_/opt.yql_patched"
}
],
"test.test[insert-override--Plan]": [
Expand All @@ -1062,9 +1062,9 @@
],
"test.test[insert-select_after_replace-default.txt-Debug]": [
{
"checksum": "c1f892bdda168bf7deb022136978fb40",
"size": 2554,
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_insert-select_after_replace-default.txt-Debug_/opt.yql_patched"
"checksum": "45e959c745057448b49fc8b32dd3f6de",
"size": 2592,
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_insert-select_after_replace-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[insert-select_after_replace-default.txt-Plan]": [
Expand Down Expand Up @@ -1766,9 +1766,9 @@
],
"test.test[limit-insert_with_limit--Debug]": [
{
"checksum": "908a867ff61e69fba4b44bca3e46a172",
"size": 1869,
"uri": "https://{canondata_backend}/1784117/bbb3849c25f3340e292971fd3dc9eb55c6b01d59/resource.tar.gz#test.test_limit-insert_with_limit--Debug_/opt.yql_patched"
"checksum": "3ae0ee09ce70615650dd25ae7b4e63bb",
"size": 1907,
"uri": "https://{canondata_backend}/212715/70085563c7b6ff5dacc6f9b036630913d5a5a13d/resource.tar.gz#test.test_limit-insert_with_limit--Debug_/opt.yql_patched"
}
],
"test.test[limit-insert_with_limit--Plan]": [
Expand Down
24 changes: 12 additions & 12 deletions ydb/library/yql/tests/sql/dq_file/part1/canondata/result.json
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,9 @@
],
"test.test[insert-select_after_replace_unwrap-default.txt-Debug]": [
{
"checksum": "97cbf6f63c3075441943ca9baa61b5f8",
"size": 2751,
"uri": "https://{canondata_backend}/1937027/25020bb5ffa145ed0ca6d209316037bad6e8d9e9/resource.tar.gz#test.test_insert-select_after_replace_unwrap-default.txt-Debug_/opt.yql_patched"
"checksum": "f27a400ab75ee146acb35ebd66517b5e",
"size": 2789,
"uri": "https://{canondata_backend}/212715/aab8e82a2c99c314ec161e2391e4cf12a1c26fd8/resource.tar.gz#test.test_insert-select_after_replace_unwrap-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[insert-select_after_replace_unwrap-default.txt-Plan]": [
Expand Down Expand Up @@ -1158,9 +1158,9 @@
],
"test.test[insert-yql-13083-existig-Debug]": [
{
"checksum": "99983563d20b865b9dae366ff3c467d1",
"size": 6004,
"uri": "https://{canondata_backend}/1937027/591a1ceca790d81eaf524a7a3e730722b0d7bdb7/resource.tar.gz#test.test_insert-yql-13083-existig-Debug_/opt.yql_patched"
"checksum": "931cf092daddb09dab6373bb86834377",
"size": 6120,
"uri": "https://{canondata_backend}/212715/aab8e82a2c99c314ec161e2391e4cf12a1c26fd8/resource.tar.gz#test.test_insert-yql-13083-existig-Debug_/opt.yql_patched"
}
],
"test.test[insert-yql-13083-existig-Plan]": [
Expand All @@ -1184,9 +1184,9 @@
],
"test.test[insert_monotonic-from_empty--Debug]": [
{
"checksum": "64de1e36b2fd89bc0ba6bc86ceb5ffaf",
"size": 2617,
"uri": "https://{canondata_backend}/1937027/25020bb5ffa145ed0ca6d209316037bad6e8d9e9/resource.tar.gz#test.test_insert_monotonic-from_empty--Debug_/opt.yql_patched"
"checksum": "de5f80bf64423e3015fc1b83c9403a15",
"size": 2655,
"uri": "https://{canondata_backend}/212715/aab8e82a2c99c314ec161e2391e4cf12a1c26fd8/resource.tar.gz#test.test_insert_monotonic-from_empty--Debug_/opt.yql_patched"
}
],
"test.test[insert_monotonic-from_empty--Plan]": [
Expand Down Expand Up @@ -1809,9 +1809,9 @@
],
"test.test[pg-insert--Debug]": [
{
"checksum": "be1ae752d424d0c396b4c88751db6934",
"size": 1867,
"uri": "https://{canondata_backend}/1937027/25020bb5ffa145ed0ca6d209316037bad6e8d9e9/resource.tar.gz#test.test_pg-insert--Debug_/opt.yql_patched"
"checksum": "3a9b6baa97c72b4ef351b97da423710e",
"size": 1905,
"uri": "https://{canondata_backend}/212715/aab8e82a2c99c314ec161e2391e4cf12a1c26fd8/resource.tar.gz#test.test_pg-insert--Debug_/opt.yql_patched"
}
],
"test.test[pg-insert--Plan]": [
Expand Down
24 changes: 12 additions & 12 deletions ydb/library/yql/tests/sql/dq_file/part10/canondata/result.json
Original file line number Diff line number Diff line change
Expand Up @@ -1037,9 +1037,9 @@
],
"test.test[insert-double_append_to_anonymous--Debug]": [
{
"checksum": "60d31c24b538a750af98ba2fe35a3a38",
"size": 2491,
"uri": "https://{canondata_backend}/1600758/32cfdeb8c6377a2e7e62c6c4adbb95f25af7669b/resource.tar.gz#test.test_insert-double_append_to_anonymous--Debug_/opt.yql_patched"
"checksum": "5197ddd521048e287c091281a04296c2",
"size": 2545,
"uri": "https://{canondata_backend}/1942415/ad5ade59004e97b62f357b05c8baba968f696aa5/resource.tar.gz#test.test_insert-double_append_to_anonymous--Debug_/opt.yql_patched"
}
],
"test.test[insert-double_append_to_anonymous--Plan]": [
Expand All @@ -1059,9 +1059,9 @@
],
"test.test[insert-replace_inferred--Debug]": [
{
"checksum": "1d3d29b32c726ccc9f3bbdfafbf04096",
"size": 2799,
"uri": "https://{canondata_backend}/1600758/32cfdeb8c6377a2e7e62c6c4adbb95f25af7669b/resource.tar.gz#test.test_insert-replace_inferred--Debug_/opt.yql_patched"
"checksum": "a150123bc33eb7942a50c79446859b06",
"size": 2819,
"uri": "https://{canondata_backend}/1942415/ad5ade59004e97b62f357b05c8baba968f696aa5/resource.tar.gz#test.test_insert-replace_inferred--Debug_/opt.yql_patched"
}
],
"test.test[insert-replace_inferred--Plan]": [
Expand Down Expand Up @@ -2215,9 +2215,9 @@
],
"test.test[schema-insert-schema-Debug]": [
{
"checksum": "82fa4c098e6ea6770642257b18016045",
"size": 2882,
"uri": "https://{canondata_backend}/1600758/32cfdeb8c6377a2e7e62c6c4adbb95f25af7669b/resource.tar.gz#test.test_schema-insert-schema-Debug_/opt.yql_patched"
"checksum": "34b6c7ae9902821e81cb19edab1e0ecc",
"size": 2950,
"uri": "https://{canondata_backend}/1942415/ad5ade59004e97b62f357b05c8baba968f696aa5/resource.tar.gz#test.test_schema-insert-schema-Debug_/opt.yql_patched"
}
],
"test.test[schema-insert-schema-Plan]": [
Expand Down Expand Up @@ -2413,9 +2413,9 @@
],
"test.test[type_v3-insert_struct_v3_with_native--Debug]": [
{
"checksum": "7251ed5ac5deb03a27a15b6ccf1e484b",
"size": 5158,
"uri": "https://{canondata_backend}/1600758/32cfdeb8c6377a2e7e62c6c4adbb95f25af7669b/resource.tar.gz#test.test_type_v3-insert_struct_v3_with_native--Debug_/opt.yql_patched"
"checksum": "a9d8d4df01650c1a934396299ba0f22c",
"size": 5262,
"uri": "https://{canondata_backend}/1942415/ad5ade59004e97b62f357b05c8baba968f696aa5/resource.tar.gz#test.test_type_v3-insert_struct_v3_with_native--Debug_/opt.yql_patched"
}
],
"test.test[type_v3-insert_struct_v3_with_native--Plan]": [
Expand Down
24 changes: 12 additions & 12 deletions ydb/library/yql/tests/sql/dq_file/part11/canondata/result.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
],
"test.test[action-insert_each_from_folder--Debug]": [
{
"checksum": "12b1eea2d86f824793dddebbb179462d",
"size": 2872,
"uri": "https://{canondata_backend}/1936947/a99026e839b7e22714c2a9a81971a3b5e3ed1eb4/resource.tar.gz#test.test_action-insert_each_from_folder--Debug_/opt.yql_patched"
"checksum": "15b1eb60c28d6b26d55413c1139c15c3",
"size": 2892,
"uri": "https://{canondata_backend}/212715/3cac1a84dde5e49e449b3f732e02eb495279cd27/resource.tar.gz#test.test_action-insert_each_from_folder--Debug_/opt.yql_patched"
}
],
"test.test[action-insert_each_from_folder--Plan]": [
Expand Down Expand Up @@ -910,9 +910,9 @@
],
"test.test[insert-select_after_insert_relabeled-default.txt-Debug]": [
{
"checksum": "b31313953d6a72280b0b5e5c5419b1e3",
"size": 3279,
"uri": "https://{canondata_backend}/1936947/a99026e839b7e22714c2a9a81971a3b5e3ed1eb4/resource.tar.gz#test.test_insert-select_after_insert_relabeled-default.txt-Debug_/opt.yql_patched"
"checksum": "62f9861149529bbaf01dd9461f777cd7",
"size": 3299,
"uri": "https://{canondata_backend}/212715/3cac1a84dde5e49e449b3f732e02eb495279cd27/resource.tar.gz#test.test_insert-select_after_insert_relabeled-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[insert-select_after_insert_relabeled-default.txt-Plan]": [
Expand All @@ -932,9 +932,9 @@
],
"test.test[insert-trivial_literals_multirow-default.txt-Debug]": [
{
"checksum": "35212fa835ba0068ac0bf5197358137c",
"size": 1362,
"uri": "https://{canondata_backend}/1936947/a99026e839b7e22714c2a9a81971a3b5e3ed1eb4/resource.tar.gz#test.test_insert-trivial_literals_multirow-default.txt-Debug_/opt.yql_patched"
"checksum": "256ebc9f8c695e92c47875c9963c1739",
"size": 1382,
"uri": "https://{canondata_backend}/212715/3cac1a84dde5e49e449b3f732e02eb495279cd27/resource.tar.gz#test.test_insert-trivial_literals_multirow-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[insert-trivial_literals_multirow-default.txt-Plan]": [
Expand All @@ -954,9 +954,9 @@
],
"test.test[insert-yql-13083--Debug]": [
{
"checksum": "97b0a0e199eefa00df33312f8fab811a",
"size": 5795,
"uri": "https://{canondata_backend}/1936947/a99026e839b7e22714c2a9a81971a3b5e3ed1eb4/resource.tar.gz#test.test_insert-yql-13083--Debug_/opt.yql_patched"
"checksum": "efbafe9573bd85afe59bc99b04253db3",
"size": 5858,
"uri": "https://{canondata_backend}/212715/3cac1a84dde5e49e449b3f732e02eb495279cd27/resource.tar.gz#test.test_insert-yql-13083--Debug_/opt.yql_patched"
}
],
"test.test[insert-yql-13083--Plan]": [
Expand Down
Loading

0 comments on commit 536cec7

Please sign in to comment.