diff options
author | ilnaz <ilnaz@yandex-team.com> | 2024-12-13 13:23:45 +0300 |
---|---|---|
committer | ilnaz <ilnaz@yandex-team.com> | 2024-12-13 14:40:50 +0300 |
commit | 4526714adffb9a72bcf8e217ace99c462ef8fe1f (patch) | |
tree | 4d7b5d8ec9b1bb6e30b3c65e692444f514782089 /yql | |
parent | 7e12365effe19ba025ad585c13c2a6b68bfe4703 (diff) | |
download | ydb-4526714adffb9a72bcf8e217ace99c462ef8fe1f.tar.gz |
RESOLVED_TIMESTAMPS => BARRIERS_INTERVAL (part 2)
Part 1: [https://github.com/ydb-platform/ydb/pull/12555](https://github.com/ydb-platform/ydb/pull/12555/files)
commit_hash:6fec02d61652f1b4ee5fd2c677f4cedb547ef9ac
Diffstat (limited to 'yql')
-rw-r--r-- | yql/essentials/sql/v1/format/sql_format_ut.h | 4 | ||||
-rw-r--r-- | yql/essentials/sql/v1/node.h | 2 | ||||
-rw-r--r-- | yql/essentials/sql/v1/query.cpp | 4 | ||||
-rw-r--r-- | yql/essentials/sql/v1/sql_expression.cpp | 4 | ||||
-rw-r--r-- | yql/essentials/sql/v1/sql_ut.cpp | 8 | ||||
-rw-r--r-- | yql/essentials/sql/v1/sql_ut_antlr4.cpp | 8 |
6 files changed, 15 insertions, 15 deletions
diff --git a/yql/essentials/sql/v1/format/sql_format_ut.h b/yql/essentials/sql/v1/format/sql_format_ut.h index 57bcef4bff..7927267378 100644 --- a/yql/essentials/sql/v1/format/sql_format_ut.h +++ b/yql/essentials/sql/v1/format/sql_format_ut.h @@ -460,8 +460,8 @@ Y_UNIT_TEST(AlterTable) { "ALTER TABLE user\n\tADD CHANGEFEED user WITH (virtual_timestamps = TRUE)\n;\n"}, {"alter table user add changefeed user with (virtual_timestamps = fAlSe)", "ALTER TABLE user\n\tADD CHANGEFEED user WITH (virtual_timestamps = FALSE)\n;\n"}, - {"alter table user add changefeed user with (resolved_timestamps = Interval(\"PT1S\"))", - "ALTER TABLE user\n\tADD CHANGEFEED user WITH (resolved_timestamps = Interval(\"PT1S\"))\n;\n"}, + {"alter table user add changefeed user with (barriers_interval = Interval(\"PT1S\"))", + "ALTER TABLE user\n\tADD CHANGEFEED user WITH (barriers_interval = Interval(\"PT1S\"))\n;\n"}, {"alter table user add changefeed user with (topic_min_active_partitions = 1)", "ALTER TABLE user\n\tADD CHANGEFEED user WITH (topic_min_active_partitions = 1)\n;\n"}, {"alter table user add changefeed user with (topic_auto_partitioning = 'ENABLED', topic_min_active_partitions = 1, topic_max_active_partitions = 7)", diff --git a/yql/essentials/sql/v1/node.h b/yql/essentials/sql/v1/node.h index ba14584543..fe6ddb08ac 100644 --- a/yql/essentials/sql/v1/node.h +++ b/yql/essentials/sql/v1/node.h @@ -1235,7 +1235,7 @@ namespace NSQLTranslationV1 { TNodePtr Format; TNodePtr InitialScan; TNodePtr VirtualTimestamps; - TNodePtr ResolvedTimestamps; + TNodePtr BarriersInterval; TNodePtr RetentionPeriod; TNodePtr TopicAutoPartitioning; TNodePtr TopicPartitions; diff --git a/yql/essentials/sql/v1/query.cpp b/yql/essentials/sql/v1/query.cpp index 8e71da3146..2f58ec5dfb 100644 --- a/yql/essentials/sql/v1/query.cpp +++ b/yql/essentials/sql/v1/query.cpp @@ -370,8 +370,8 @@ static INode::TPtr CreateChangefeedDesc(const TChangefeedDescription& desc, cons if (desc.Settings.VirtualTimestamps) { settings = node.L(settings, node.Q(node.Y(node.Q("virtual_timestamps"), desc.Settings.VirtualTimestamps))); } - if (desc.Settings.ResolvedTimestamps) { - settings = node.L(settings, node.Q(node.Y(node.Q("resolved_timestamps"), desc.Settings.ResolvedTimestamps))); + if (desc.Settings.BarriersInterval) { + settings = node.L(settings, node.Q(node.Y(node.Q("barriers_interval"), desc.Settings.BarriersInterval))); } if (desc.Settings.RetentionPeriod) { settings = node.L(settings, node.Q(node.Y(node.Q("retention_period"), desc.Settings.RetentionPeriod))); diff --git a/yql/essentials/sql/v1/sql_expression.cpp b/yql/essentials/sql/v1/sql_expression.cpp index 675d36ed46..a7a9877ccb 100644 --- a/yql/essentials/sql/v1/sql_expression.cpp +++ b/yql/essentials/sql/v1/sql_expression.cpp @@ -159,12 +159,12 @@ bool ChangefeedSettingsEntry(const TRule_changefeed_settings_entry& node, TSqlEx return false; } settings.VirtualTimestamps = exprNode; - } else if (to_lower(id.Name) == "resolved_timestamps") { + } else if (to_lower(id.Name) == "barriers_interval" || to_lower(id.Name) == "resolved_timestamps") { if (exprNode->GetOpName() != "Interval") { ctx.Context().Error() << "Literal of Interval type is expected for " << id.Name; return false; } - settings.ResolvedTimestamps = exprNode; + settings.BarriersInterval = exprNode; } else if (to_lower(id.Name) == "retention_period") { if (exprNode->GetOpName() != "Interval") { ctx.Context().Error() << "Literal of Interval type is expected for " << id.Name; diff --git a/yql/essentials/sql/v1/sql_ut.cpp b/yql/essentials/sql/v1/sql_ut.cpp index 0cb626f5b0..1c87beee05 100644 --- a/yql/essentials/sql/v1/sql_ut.cpp +++ b/yql/essentials/sql/v1/sql_ut.cpp @@ -2340,7 +2340,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) { FORMAT = 'json', INITIAL_SCAN = TRUE, VIRTUAL_TIMESTAMPS = FALSE, - RESOLVED_TIMESTAMPS = Interval("PT1S"), + BARRIERS_INTERVAL = Interval("PT1S"), RETENTION_PERIOD = Interval("P1D"), TOPIC_MIN_ACTIVE_PARTITIONS = 10, AWS_REGION = 'aws:region' @@ -2360,7 +2360,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) { UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("true")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("virtual_timestamps")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("false")); - UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("resolved_timestamps")); + UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("barriers_interval")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("retention_period")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("topic_min_active_partitions")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("aws_region")); @@ -4705,12 +4705,12 @@ select FormatType($f()); USE plato; CREATE TABLE tableName ( Key Uint32, PRIMARY KEY (Key), - CHANGEFEED feedName WITH (MODE = "KEYS_ONLY", FORMAT = "json", RESOLVED_TIMESTAMPS = "foo") + CHANGEFEED feedName WITH (MODE = "KEYS_ONLY", FORMAT = "json", BARRIERS_INTERVAL = "foo") ); )"; auto res = SqlToYql(req); UNIT_ASSERT(!res.Root); - UNIT_ASSERT_NO_DIFF(Err2Str(res), "<main>:5:102: Error: Literal of Interval type is expected for RESOLVED_TIMESTAMPS\n"); + UNIT_ASSERT_NO_DIFF(Err2Str(res), "<main>:5:100: Error: Literal of Interval type is expected for BARRIERS_INTERVAL\n"); } Y_UNIT_TEST(InvalidChangefeedRetentionPeriod) { diff --git a/yql/essentials/sql/v1/sql_ut_antlr4.cpp b/yql/essentials/sql/v1/sql_ut_antlr4.cpp index ae2ef94759..705ca3d19c 100644 --- a/yql/essentials/sql/v1/sql_ut_antlr4.cpp +++ b/yql/essentials/sql/v1/sql_ut_antlr4.cpp @@ -2340,7 +2340,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) { FORMAT = 'json', INITIAL_SCAN = TRUE, VIRTUAL_TIMESTAMPS = FALSE, - RESOLVED_TIMESTAMPS = Interval("PT1S"), + BARRIERS_INTERVAL = Interval("PT1S"), RETENTION_PERIOD = Interval("P1D"), TOPIC_MIN_ACTIVE_PARTITIONS = 10, AWS_REGION = 'aws:region' @@ -2360,7 +2360,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) { UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("true")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("virtual_timestamps")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("false")); - UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("resolved_timestamps")); + UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("barriers_interval")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("retention_period")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("topic_min_active_partitions")); UNIT_ASSERT_VALUES_UNEQUAL(TString::npos, line.find("aws_region")); @@ -4702,12 +4702,12 @@ select FormatType($f()); USE plato; CREATE TABLE tableName ( Key Uint32, PRIMARY KEY (Key), - CHANGEFEED feedName WITH (MODE = "KEYS_ONLY", FORMAT = "json", RESOLVED_TIMESTAMPS = "foo") + CHANGEFEED feedName WITH (MODE = "KEYS_ONLY", FORMAT = "json", BARRIERS_INTERVAL = "foo") ); )"; auto res = SqlToYql(req); UNIT_ASSERT(!res.Root); - UNIT_ASSERT_NO_DIFF(Err2Str(res), "<main>:5:102: Error: Literal of Interval type is expected for RESOLVED_TIMESTAMPS\n"); + UNIT_ASSERT_NO_DIFF(Err2Str(res), "<main>:5:100: Error: Literal of Interval type is expected for BARRIERS_INTERVAL\n"); } Y_UNIT_TEST(InvalidChangefeedRetentionPeriod) { |