aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvvvv <vvvv@yandex-team.com>2024-11-26 20:46:59 +0300
committervvvv <vvvv@yandex-team.com>2024-11-26 20:56:38 +0300
commit60419ef1ed276c3a1f4269720382826a2b85e912 (patch)
tree7ef7bbebc5dccb277f055e9ffabd5d57567335e9
parente607da222a564efe307bc3ed5ccb75fa08e70d27 (diff)
downloadydb-60419ef1ed276c3a1f4269720382826a2b85e912.tar.gz
Fixed usage of local/global as column names etc
init commit_hash:9d93e3a75a50972e6d21935a82825a019017f087
-rw-r--r--yql/essentials/sql/v1/SQLv1.g.in5
-rw-r--r--yql/essentials/sql/v1/SQLv1Antlr4.g.in5
-rw-r--r--yql/essentials/sql/v1/sql_ut.cpp24
-rw-r--r--yql/essentials/sql/v1/sql_ut_antlr4.cpp24
4 files changed, 32 insertions, 26 deletions
diff --git a/yql/essentials/sql/v1/SQLv1.g.in b/yql/essentials/sql/v1/SQLv1.g.in
index d58f184ec0..b31594eba3 100644
--- a/yql/essentials/sql/v1/SQLv1.g.in
+++ b/yql/essentials/sql/v1/SQLv1.g.in
@@ -1206,7 +1206,6 @@ keyword_expr_uncompat:
| JSON_EXISTS
| JSON_VALUE
| JSON_QUERY
- | LOCAL
| NOT
| NULL
| PROCESS
@@ -1338,6 +1337,7 @@ keyword_as_compat:
| FOREIGN
| FUNCTION
| GLOB
+ | GLOBAL
| GRANT
| GROUP
| GROUPING
@@ -1367,6 +1367,7 @@ keyword_as_compat:
// | LEFT
| LEGACY
| LIKE
+ | LOCAL
| MANAGE
| MATCH
| MATCHES
@@ -1560,6 +1561,7 @@ keyword_compat: (
| FOREIGN
| FUNCTION
| GLOB
+ | GLOBAL
| GRANT
| GROUP
| GROUPING
@@ -1589,6 +1591,7 @@ keyword_compat: (
| LEFT
| LEGACY
| LIKE
+ | LOCAL
| MANAGE
| MATCH
| MATCHES
diff --git a/yql/essentials/sql/v1/SQLv1Antlr4.g.in b/yql/essentials/sql/v1/SQLv1Antlr4.g.in
index 64be15d0b7..87cbcaed3d 100644
--- a/yql/essentials/sql/v1/SQLv1Antlr4.g.in
+++ b/yql/essentials/sql/v1/SQLv1Antlr4.g.in
@@ -1205,7 +1205,6 @@ keyword_expr_uncompat:
| JSON_EXISTS
| JSON_VALUE
| JSON_QUERY
- | LOCAL
| NOT
| NULL
| PROCESS
@@ -1337,6 +1336,7 @@ keyword_as_compat:
| FOREIGN
| FUNCTION
| GLOB
+ | GLOBAL
| GRANT
| GROUP
| GROUPING
@@ -1366,6 +1366,7 @@ keyword_as_compat:
// | LEFT
| LEGACY
| LIKE
+ | LOCAL
| MANAGE
| MATCH
| MATCHES
@@ -1559,6 +1560,7 @@ keyword_compat: (
| FOREIGN
| FUNCTION
| GLOB
+ | GLOBAL
| GRANT
| GROUP
| GROUPING
@@ -1588,6 +1590,7 @@ keyword_compat: (
| LEFT
| LEGACY
| LIKE
+ | LOCAL
| MANAGE
| MATCH
| MATCHES
diff --git a/yql/essentials/sql/v1/sql_ut.cpp b/yql/essentials/sql/v1/sql_ut.cpp
index 2acc9e722a..1bbdaada1e 100644
--- a/yql/essentials/sql/v1/sql_ut.cpp
+++ b/yql/essentials/sql/v1/sql_ut.cpp
@@ -72,8 +72,8 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
auto failed = ValidateTokens({
"ALL", "ANY", "AS", "ASSUME", "ASYMMETRIC", "AUTOMAP", "BETWEEN", "BITCAST",
"CALLABLE", "CASE", "CAST", "CUBE", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP",
- "DICT", "DISTINCT", "ENUM", "ERASE", "EXCEPT", "EXISTS", "FLOW", "FROM", "FULL", "GLOBAL",
- "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST", "LOCAL",
+ "DICT", "DISTINCT", "ENUM", "ERASE", "EXCEPT", "EXISTS", "FLOW", "FROM", "FULL",
+ "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST",
"NOT", "OPTIONAL", "PROCESS", "REDUCE", "REPEATABLE", "RESOURCE", "RETURN", "RETURNING", "ROLLUP",
"SELECT", "SET", "STREAM", "STRUCT", "SYMMETRIC", "TAGGED", "TUPLE", "UNBOUNDED",
"UNION", "VARIANT", "WHEN", "WHERE", "WINDOW", "WITHOUT"
@@ -91,8 +91,8 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
auto failed = ValidateTokens({
"ALL", "AS", "ASSUME", "ASYMMETRIC", "AUTOMAP", "BETWEEN", "BITCAST",
"CALLABLE", "CASE", "CAST", "CUBE", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP",
- "DICT", "DISTINCT", "EMPTY_ACTION", "ENUM", "EXCEPT", "EXISTS", "FALSE", "FLOW", "FROM", "FULL", "GLOBAL",
- "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST", "LOCAL",
+ "DICT", "DISTINCT", "EMPTY_ACTION", "ENUM", "EXCEPT", "EXISTS", "FALSE", "FLOW", "FROM", "FULL",
+ "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST",
"NOT", "NULL", "OPTIONAL", "PROCESS", "REDUCE", "REPEATABLE", "RESOURCE", "RETURN", "RETURNING", "ROLLUP",
"SELECT", "SET", "STRUCT", "SYMMETRIC", "TAGGED", "TRUE", "TUPLE", "UNBOUNDED",
"UNION", "VARIANT", "WHEN", "WHERE", "WINDOW", "WITHOUT"
@@ -109,7 +109,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsColumnNameInAddColumn) { //id_schema
auto failed = ValidateTokens({
"ANY", "AUTOMAP", "CALLABLE", "COLUMN", "DICT", "ENUM", "ERASE", "FALSE", "FLOW",
- "GLOBAL", "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
+ "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
"SET", "STREAM", "STRUCT", "TAGGED", "TRUE", "TUPLE", "VARIANT"
},
[](const TString& token){
@@ -124,7 +124,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsColumnAlias) {
auto failed = ValidateTokens({
"AUTOMAP", "FALSE",
- "GLOBAL", "REPEATABLE", "TRUE"
+ "REPEATABLE", "TRUE"
},
[](const TString& token){
TStringBuilder req;
@@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsTableName) { //id_table_or_type
auto failed = ValidateTokens({
"ANY", "AUTOMAP", "COLUMN", "ERASE", "FALSE",
- "GLOBAL", "REPEATABLE", "STREAM", "TRUE"
+ "REPEATABLE", "STREAM", "TRUE"
},
[](const TString& token){
TStringBuilder req;
@@ -152,7 +152,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsTableAlias) { //id_table
auto failed = ValidateTokens({
"AUTOMAP", "CALLABLE", "DICT", "ENUM","FALSE", "FLOW",
- "GLOBAL", "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
+ "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
"SET", "STRUCT", "TAGGED", "TRUE", "TUPLE", "VARIANT"
},
[](const TString& token){
@@ -167,7 +167,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsHints) { //id_hint
auto failed = ValidateTokens({
"AUTOMAP", "CALLABLE", "COLUMNS", "DICT", "ENUM", "FALSE", "FLOW",
- "GLOBAL", "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
+ "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
"SCHEMA", "SET", "STRUCT", "TAGGED", "TRUE", "TUPLE", "VARIANT"
},
[](const TString& token){
@@ -181,7 +181,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsWindow) { //id_window
auto failed = ValidateTokens({
- "AUTOMAP", "CALLABLE", "DICT", "ENUM", "FALSE", "FLOW", "GLOBAL", "GROUPS", "LIST", "OPTIONAL",
+ "AUTOMAP", "CALLABLE", "DICT", "ENUM", "FALSE", "FLOW", "GROUPS", "LIST", "OPTIONAL",
"RANGE", "REPEATABLE", "RESOURCE", "ROWS", "SET", "STRUCT", "TAGGED" ,"TRUE", "TUPLE", "VARIANT"
},
[](const TString& token){
@@ -197,8 +197,8 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
auto failed = ValidateTokens({
"ALL", "ANY", "AS", "ASSUME", "ASYMMETRIC", "AUTOMAP", "BETWEEN", "BITCAST",
"CALLABLE", "CASE", "CAST", "COMPACT", "CUBE", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP",
- "DICT", "DISTINCT", "ENUM", "ERASE", "EXCEPT", "EXISTS", "FLOW", "FROM", "FULL", "GLOBAL",
- "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST", "LOCAL",
+ "DICT", "DISTINCT", "ENUM", "ERASE", "EXCEPT", "EXISTS", "FLOW", "FROM", "FULL",
+ "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST",
"NOT", "OPTIONAL", "PROCESS", "REDUCE", "REPEATABLE", "RESOURCE", "RETURN", "RETURNING", "ROLLUP",
"SELECT", "SET", "STREAM", "STRUCT", "SYMMETRIC", "TAGGED", "TUPLE", "UNBOUNDED",
"UNION", "VARIANT", "WHEN", "WHERE", "WINDOW", "WITHOUT"
diff --git a/yql/essentials/sql/v1/sql_ut_antlr4.cpp b/yql/essentials/sql/v1/sql_ut_antlr4.cpp
index 1cd05a7ea5..0f61449ae2 100644
--- a/yql/essentials/sql/v1/sql_ut_antlr4.cpp
+++ b/yql/essentials/sql/v1/sql_ut_antlr4.cpp
@@ -72,8 +72,8 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
auto failed = ValidateTokens({
"ALL", "ANY", "AS", "ASSUME", "ASYMMETRIC", "AUTOMAP", "BETWEEN", "BITCAST",
"CALLABLE", "CASE", "CAST", "CUBE", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP",
- "DICT", "DISTINCT", "ENUM", "ERASE", "EXCEPT", "EXISTS", "FLOW", "FROM", "FULL", "GLOBAL",
- "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST", "LOCAL",
+ "DICT", "DISTINCT", "ENUM", "ERASE", "EXCEPT", "EXISTS", "FLOW", "FROM", "FULL",
+ "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST",
"NOT", "OPTIONAL", "PROCESS", "REDUCE", "REPEATABLE", "RESOURCE", "RETURN", "RETURNING", "ROLLUP",
"SELECT", "SET", "STREAM", "STRUCT", "SYMMETRIC", "TAGGED", "TUPLE", "UNBOUNDED",
"UNION", "VARIANT", "WHEN", "WHERE", "WINDOW", "WITHOUT"
@@ -91,8 +91,8 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
auto failed = ValidateTokens({
"ALL", "AS", "ASSUME", "ASYMMETRIC", "AUTOMAP", "BETWEEN", "BITCAST",
"CALLABLE", "CASE", "CAST", "CUBE", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP",
- "DICT", "DISTINCT", "EMPTY_ACTION", "ENUM", "EXCEPT", "EXISTS", "FALSE", "FLOW", "FROM", "FULL", "GLOBAL",
- "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST", "LOCAL",
+ "DICT", "DISTINCT", "EMPTY_ACTION", "ENUM", "EXCEPT", "EXISTS", "FALSE", "FLOW", "FROM", "FULL",
+ "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST",
"NOT", "NULL", "OPTIONAL", "PROCESS", "REDUCE", "REPEATABLE", "RESOURCE", "RETURN", "RETURNING", "ROLLUP",
"SELECT", "SET", "STRUCT", "SYMMETRIC", "TAGGED", "TRUE", "TUPLE", "UNBOUNDED",
"UNION", "VARIANT", "WHEN", "WHERE", "WINDOW", "WITHOUT"
@@ -109,7 +109,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsColumnNameInAddColumn) { //id_schema
auto failed = ValidateTokens({
"ANY", "AUTOMAP", "CALLABLE", "COLUMN", "DICT", "ENUM", "ERASE", "FALSE", "FLOW",
- "GLOBAL", "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
+ "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
"SET", "STREAM", "STRUCT", "TAGGED", "TRUE", "TUPLE", "VARIANT"
},
[](const TString& token){
@@ -124,7 +124,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsColumnAlias) {
auto failed = ValidateTokens({
"AUTOMAP", "FALSE",
- "GLOBAL", "REPEATABLE", "TRUE"
+ "REPEATABLE", "TRUE"
},
[](const TString& token){
TStringBuilder req;
@@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsTableName) { //id_table_or_type
auto failed = ValidateTokens({
"ANY", "AUTOMAP", "COLUMN", "ERASE", "FALSE",
- "GLOBAL", "REPEATABLE", "STREAM", "TRUE"
+ "REPEATABLE", "STREAM", "TRUE"
},
[](const TString& token){
TStringBuilder req;
@@ -152,7 +152,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsTableAlias) { //id_table
auto failed = ValidateTokens({
"AUTOMAP", "CALLABLE", "DICT", "ENUM","FALSE", "FLOW",
- "GLOBAL", "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
+ "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
"SET", "STRUCT", "TAGGED", "TRUE", "TUPLE", "VARIANT"
},
[](const TString& token){
@@ -167,7 +167,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsHints) { //id_hint
auto failed = ValidateTokens({
"AUTOMAP", "CALLABLE", "COLUMNS", "DICT", "ENUM", "FALSE", "FLOW",
- "GLOBAL", "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
+ "LIST", "OPTIONAL", "REPEATABLE", "RESOURCE",
"SCHEMA", "SET", "STRUCT", "TAGGED", "TRUE", "TUPLE", "VARIANT"
},
[](const TString& token){
@@ -181,7 +181,7 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
Y_UNIT_TEST(TokensAsWindow) { //id_window
auto failed = ValidateTokens({
- "AUTOMAP", "CALLABLE", "DICT", "ENUM", "FALSE", "FLOW", "GLOBAL", "GROUPS", "LIST", "OPTIONAL",
+ "AUTOMAP", "CALLABLE", "DICT", "ENUM", "FALSE", "FLOW", "GROUPS", "LIST", "OPTIONAL",
"RANGE", "REPEATABLE", "RESOURCE", "ROWS", "SET", "STRUCT", "TAGGED" ,"TRUE", "TUPLE", "VARIANT"
},
[](const TString& token){
@@ -197,8 +197,8 @@ Y_UNIT_TEST_SUITE(SqlParsingOnly) {
auto failed = ValidateTokens({
"ALL", "ANY", "AS", "ASSUME", "ASYMMETRIC", "AUTOMAP", "BETWEEN", "BITCAST",
"CALLABLE", "CASE", "CAST", "COMPACT", "CUBE", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP",
- "DICT", "DISTINCT", "ENUM", "ERASE", "EXCEPT", "EXISTS", "FLOW", "FROM", "FULL", "GLOBAL",
- "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST", "LOCAL",
+ "DICT", "DISTINCT", "ENUM", "ERASE", "EXCEPT", "EXISTS", "FLOW", "FROM", "FULL",
+ "HAVING", "HOP", "INTERSECT", "JSON_EXISTS", "JSON_QUERY", "JSON_VALUE", "LIMIT", "LIST",
"NOT", "OPTIONAL", "PROCESS", "REDUCE", "REPEATABLE", "RESOURCE", "RETURN", "RETURNING", "ROLLUP",
"SELECT", "SET", "STREAM", "STRUCT", "SYMMETRIC", "TAGGED", "TUPLE", "UNBOUNDED",
"UNION", "VARIANT", "WHEN", "WHERE", "WINDOW", "WITHOUT"