diff --git a/README.md b/README.md index 57565de..8d21838 100644 --- a/README.md +++ b/README.md @@ -97,3 +97,9 @@ console.log(dtSqlParser.parseSyntax("selet * form",'hive')); ast生成代码来自[nquery](https://github.com/alibaba/nquery/) hive,impala等语法解析文件来自[Hue](https://github.com/cloudera/hue) + +---- + +### ChangeLog + +- 1.1.8 添加转义字符支持 diff --git a/core/sqlAutoCompleteParser.js b/core/sqlAutoCompleteParser.js index a00d29b..db4d8ef 100644 --- a/core/sqlAutoCompleteParser.js +++ b/core/sqlAutoCompleteParser.js @@ -9251,7 +9251,7 @@ case 480:console.log(yy_.yytext); break; } }, -rules: [/^(?:\s)/i,/^(?:--.*)/i,/^(?:[\/][*][^*]*[*]+([^\/*][^*]*[*]+)*[\/])/i,/^(?:\u2020)/i,/^(?:\u2021)/i,/^(?:ALL)/i,/^(?:ARRAY)/i,/^(?:AS)/i,/^(?:AUTHORIZATION)/i,/^(?:BINARY)/i,/^(?:CACHE)/i,/^(?:COLUMN)/i,/^(?:CONF)/i,/^(?:CONSTRAINT)/i,/^(?:CREATE)/i,/^(?:CUBE)/i,/^(?:CURRENT)/i,/^(?:DATE)/i,/^(?:DELETE)/i,/^(?:DESCRIBE)/i,/^(?:EXTENDED)/i,/^(?:EXTERNAL)/i,/^(?:FOR)/i,/^(?:FOREIGN)/i,/^(?:FUNCTION)/i,/^(?:GRANT)/i,/^(?:GROUPING)/i,/^(?:IMPORT)/i,/^(?:INSERT)/i,/^(?:LATERAL)/i,/^(?:LOCAL)/i,/^(?:MACRO)/i,/^(?:MAP)/i,/^(?:NONE)/i,/^(?:OF)/i,/^(?:OUT)/i,/^(?:PRIMARY)/i,/^(?:REFERENCES)/i,/^(?:REVOKE)/i,/^(?:ROLLUP)/i,/^(?:TABLE)/i,/^(?:TIMESTAMP)/i,/^(?:USER)/i,/^(?:USING)/i,/^(?:VIEWS)/i,/^(?:LIFECYCLE)/i,/^(?:ABORT)/i,/^(?:ADD)/i,/^(?:ADMIN)/i,/^(?:AFT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/i,/^(?:ORC)/i,/^(?:OUTPUTFORMAT)/i,/^(?:OVERWRITE)/i,/^(?:OVERWRITE\s+DIRECTORY)/i,/^(?:OWNER)/i,/^(?:PARQUET)/i,/^(?:PARTITIONED)/i,/^(?:PARTITIONS)/i,/^(?:PERCENT)/i,/^(?:PRIVILEGES)/i,/^(?:PURGE)/i,/^(?:QUARTER)/i,/^(?:RCFILE)/i,/^(?:REBUILD)/i,/^(?:RELOAD)/i,/^(?:RELY)/i,/^(?:REPAIR)/i,/^(?:REPLICATION)/i,/^(?:RECOVER)/i,/^(?:RENAME)/i,/^(?:REPLACE)/i,/^(?:RESTRICT)/i,/^(?:ROLE)/i,/^(?:ROLES)/i,/^(?:SECOND)/i,/^(?:SCHEMA)/i,/^(?:SCHEMAS)/i,/^(?:SEQUENCEFILE)/i,/^(?:SERDE)/i,/^(?:SERDEPROPERTIES)/i,/^(?:SETS)/i,/^(?:SHOW)/i,/^(?:SHOW_DATABASE)/i,/^(?:SKEWED)/i,/^(?:SKEWED LOCATION)/i,/^(?:SORT)/i,/^(?:SORTED)/i,/^(?:STATISTICS)/i,/^(?:STORED)/i,/^(?:STORED\s+AS\s+DIRECTORIES)/i,/^(?:STRING)/i,/^(?:STRUCT)/i,/^(?:TABLES)/i,/^(?:TABLESAMPLE)/i,/^(?:TBLPROPERTIES)/i,/^(?:TEMPORARY)/i,/^(?:TERMINATED)/i,/^(?:TEXTFILE)/i,/^(?:TINYINT)/i,/^(?:TOUCH)/i,/^(?:TRANSACTIONS)/i,/^(?:UNARCHIVE)/i,/^(?:UNIONTYPE)/i,/^(?:USE)/i,/^(?:VIEW)/i,/^(?:WAIT)/i,/^(?:WEEK)/i,/^(?:WINDOW)/i,/^(?:YEAR)/i,/^(?:\.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:ADD)/i,/^(?:AGGREGATE)/i,/^(?:AVRO)/i,/^(?:CACHED)/i,/^(?:CASCADE)/i,/^(?:CHANGE)/i,/^(?:CLOSE_FN)/i,/^(?:COLUMN)/i,/^(?:COLUMNS)/i,/^(?:COMMENT)/i,/^(?:COMPUTE)/i,/^(?:CREATE)/i,/^(?:DATA)/i,/^(?:DATABASES)/i,/^(?:DELETE)/i,/^(?:DELIMITED)/i,/^(?:DESCRIBE)/i,/^(?:ESCAPED)/i,/^(?:EXPLAIN)/i,/^(?:EXTERNAL)/i,/^(?:EXTENDED)/i,/^(?:FIELDS)/i,/^(?:FILEFORMAT)/i,/^(?:FILES)/i,/^(?:FINALIZE_FN)/i,/^(?:FIRST)/i,/^(?:FORMAT)/i,/^(?:FORMATTED)/i,/^(?:FUNCTION)/i,/^(?:FUNCTIONS)/i,/^(?:GROUP)/i,/^(?:HASH)/i,/^(?:ILIKE)/i,/^(?:INCREMENTAL)/i,/^(?:INSERT)/i,/^(?:INTERVAL)/i,/^(?:INTERMEDIATE)/i,/^(?:INIT_FN)/i,/^(?:INVALIDATE)/i,/^(?:INPATH)/i,/^(?:IREGEXP)/i,/^(?:KEY)/i,/^(?:KUDU)/i,/^(?:LAST)/i,/^(?:LIKE\s+PARQUET)/i,/^(?:LIMIT)/i,/^(?:LINES)/i,/^(?:LOAD)/i,/^(?:LOCATION)/i,/^(?:MERGE_FN)/i,/^(?:METADATA)/i,/^(?:NULLS)/i,/^(?:OFFSET)/i,/^(?:ORC)/i,/^(?:OVERWRITE)/i,/^(?:PARQUET)/i,/^(?:PARTITIONED)/i,/^(?:PARTITIONS)/i,/^(?:PREPARE_FN)/i,/^(?:PRIMARY)/i,/^(?:RCFILE)/i,/^(?:RANGE)/i,/^(?:REAL)/i,/^(?:REFRESH)/i,/^(?:RENAME)/i,/^(?:REPEATABLE)/i,/^(?:REPLACE)/i,/^(?:REPLICATION)/i,/^(?:RESTRICT)/i,/^(?:RETURNS)/i,/^(?:REVOKE)/i,/^(?:SEQUENCEFILE)/i,/^(?:SERDEPROPERTIES)/i,/^(?:SCHEMAS)/i,/^(?:SERIALIZE_FN)/i,/^(?:SERVER)/i,/^(?:SORT)/i,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/i,/^(?:COMPUTE)/i,/^(?:CONCATENATE)/i,/^(?:DATA)/i,/^(?:DATABASES)/i,/^(?:DAY)/i,/^(?:DAYOFWEEK)/i,/^(?:DBPROPERTIES)/i,/^(?:DEFERRED)/i,/^(?:DEFINED)/i,/^(?:DELIMITED)/i,/^(?:DEPENDENCY)/i,/^(?:DESC)/i,/^(?:DIRECTORY)/i,/^(?:DISABLE)/i,/^(?:DISTRIBUTE)/i,/^(?:DOUBLE\s+PRECISION)/i,/^(?:ESCAPED)/i,/^(?:ENABLE)/i,/^(?:EXCHANGE)/i,/^(?:EXPLAIN)/i,/^(?:EXPORT)/i,/^(?:FIELDS)/i,/^(?:FILE)/i,/^(?:FILEFORMAT)/i,/^(?:FIRST)/i,/^(?:FORMAT)/i,/^(?:FORMATTED)/i,/^(?:FUNCTION)/i,/^(?:FUNCTIONS)/i,/^(?:HOUR)/i,/^(?:IDXPROPERTIES)/i,/^(?:INDEX)/i,/^(?:INDEXES)/i,/^(?:INPATH)/i,/^(?:INPUTFORMAT)/i,/^(?:ITEMS)/i,/^(?:JAR)/i,/^(?:KEY)/i,/^(?:KEYS)/i,/^(?:LINES)/i,/^(?:LOAD)/i,/^(?:LOCATION)/i,/^(?:LOCK)/i,/^(?:LOCKS)/i,/^(?:MATCHED)/i,/^(?:MERGE)/i,/^(?:METADATA)/i,/^(?:MINUTE)/i,/^(?:MONTH)/i,/^(?:MSCK)/i,/^(?:NORELY)/i,/^(?:NOSCAN)/i,/^(?:NOVALIDATE)/i,/^(?:NO_DROP)/i,/^(?:OFFLINE)/i,/^(?:ORC)/i,/^(?:OUTPUTFORMAT)/i,/^(?:OVERWRITE)/i,/^(?:OVERWRITE\s+DIRECTORY)/i,/^(?:OWNER)/i,/^(?:PARQUET)/i,/^(?:PARTITIONED)/i,/^(?:PARTITIONS)/i,/^(?:PERCENT)/i,/^(?:PRIVILEGES)/i,/^(?:PURGE)/i,/^(?:QUARTER)/i,/^(?:RCFILE)/i,/^(?:REBUILD)/i,/^(?:RELOAD)/i,/^(?:RELY)/i,/^(?:REPAIR)/i,/^(?:REPLICATION)/i,/^(?:RECOVER)/i,/^(?:RENAME)/i,/^(?:REPLACE)/i,/^(?:RESTRICT)/i,/^(?:ROLE)/i,/^(?:ROLES)/i,/^(?:SECOND)/i,/^(?:SCHEMA)/i,/^(?:SCHEMAS)/i,/^(?:SEQUENCEFILE)/i,/^(?:SERDE)/i,/^(?:SERDEPROPERTIES)/i,/^(?:SETS)/i,/^(?:SHOW)/i,/^(?:SHOW_DATABASE)/i,/^(?:SKEWED)/i,/^(?:SKEWED LOCATION)/i,/^(?:SORT)/i,/^(?:SORTED)/i,/^(?:STATISTICS)/i,/^(?:STORED)/i,/^(?:STORED\s+AS\s+DIRECTORIES)/i,/^(?:STRING)/i,/^(?:STRUCT)/i,/^(?:TABLES)/i,/^(?:TABLESAMPLE)/i,/^(?:TBLPROPERTIES)/i,/^(?:TEMPORARY)/i,/^(?:TERMINATED)/i,/^(?:TEXTFILE)/i,/^(?:TINYINT)/i,/^(?:TOUCH)/i,/^(?:TRANSACTIONS)/i,/^(?:UNARCHIVE)/i,/^(?:UNIONTYPE)/i,/^(?:USE)/i,/^(?:VIEW)/i,/^(?:WAIT)/i,/^(?:WEEK)/i,/^(?:WINDOW)/i,/^(?:YEAR)/i,/^(?:\.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:ADD)/i,/^(?:AGGREGATE)/i,/^(?:AVRO)/i,/^(?:CACHED)/i,/^(?:CASCADE)/i,/^(?:CHANGE)/i,/^(?:CLOSE_FN)/i,/^(?:COLUMN)/i,/^(?:COLUMNS)/i,/^(?:COMMENT)/i,/^(?:COMPUTE)/i,/^(?:CREATE)/i,/^(?:DATA)/i,/^(?:DATABASES)/i,/^(?:DELETE)/i,/^(?:DELIMITED)/i,/^(?:DESCRIBE)/i,/^(?:ESCAPED)/i,/^(?:EXPLAIN)/i,/^(?:EXTERNAL)/i,/^(?:EXTENDED)/i,/^(?:FIELDS)/i,/^(?:FILEFORMAT)/i,/^(?:FILES)/i,/^(?:FINALIZE_FN)/i,/^(?:FIRST)/i,/^(?:FORMAT)/i,/^(?:FORMATTED)/i,/^(?:FUNCTION)/i,/^(?:FUNCTIONS)/i,/^(?:GROUP)/i,/^(?:HASH)/i,/^(?:ILIKE)/i,/^(?:INCREMENTAL)/i,/^(?:INSERT)/i,/^(?:INTERVAL)/i,/^(?:INTERMEDIATE)/i,/^(?:INIT_FN)/i,/^(?:INVALIDATE)/i,/^(?:INPATH)/i,/^(?:IREGEXP)/i,/^(?:KEY)/i,/^(?:KUDU)/i,/^(?:LAST)/i,/^(?:LIKE\s+PARQUET)/i,/^(?:LIMIT)/i,/^(?:LINES)/i,/^(?:LOAD)/i,/^(?:LOCATION)/i,/^(?:MERGE_FN)/i,/^(?:METADATA)/i,/^(?:NULLS)/i,/^(?:OFFSET)/i,/^(?:ORC)/i,/^(?:OVERWRITE)/i,/^(?:PARQUET)/i,/^(?:PARTITIONED)/i,/^(?:PARTITIONS)/i,/^(?:PREPARE_FN)/i,/^(?:PRIMARY)/i,/^(?:RCFILE)/i,/^(?:RANGE)/i,/^(?:REAL)/i,/^(?:REFRESH)/i,/^(?:RENAME)/i,/^(?:REPEATABLE)/i,/^(?:REPLACE)/i,/^(?:REPLICATION)/i,/^(?:RESTRICT)/i,/^(?:RETURNS)/i,/^(?:REVOKE)/i,/^(?:SEQUENCEFILE)/i,/^(?:SERDEPROPERTIES)/i,/^(?:SCHEMAS)/i,/^(?:SERIALIZE_FN)/i,/^(?:SERVER)/i,/^(?:SORT)/i,/^(?:STATS)/i,/^(?:STORED)/i,/^(?:STRAIGHT_JOIN)/i,/^(?:SYMBOL)/i,/^(?:TABLE)/i,/^(?:TABLES)/i,/^(?:TABLESAMPLE)/i,/^(?:TBLPROPERTIES)/i,/^(?:TERMINATED)/i,/^(?:TEXTFILE)/i,/^(?:UNCACHED)/i,/^(?:UPDATE_FN)/i,/^(?:UPSERT)/i,/^(?:URI)/i,/^(?:USING)/i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:FIRST_VALUE\s*\()/i,/^(?:LAG\s*\()/i,/^(?:LAST_VALUE\s*\()/i,/^(?:LEAD\s*\()/i,/^(?:RANK\s*\()/i,/^(?:ROW_NUMBER\s*\()/i,/^(?:CUME_DIST\s*\()/i,/^(?:PERCENT_RANK\s*\()/i,/^(?:NTILE\s*\()/i,/^(?:PERCENT_RANK\s*\()/i,/^(?:SYSTEM\s*\()/i,/^(?:[0-9]+)/i,/^(?:[0-9]+(?:[YSL]|BD)?)/i,/^(?:[0-9]+E)/i,/^(?:[A-Za-z0-9_]+)/i,/^(?:\u2020)/i,/^(?:\u2021)/i,/^(?:\s+['])/i,/^(?:[^'\u2020\u2021]+)/i,/^(?:['])/i,/^(?:$)/i,/^(?:&&)/i,/^(?:\|\|)/i,/^(?:=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:!=)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:<>)/i,/^(?:<=>)/i,/^(?:-)/i,/^(?:\*)/i,/^(?:\+)/i,/^(?:\/)/i,/^(?:%)/i,/^(?:\|)/i,/^(?:\^)/i,/^(?:&)/i,/^(?:,)/i,/^(?:\.)/i,/^(?::)/i,/^(?:;)/i,/^(?:~)/i,/^(?:!)/i,/^(?:\()/i,/^(?:\))/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\$\{[^}]*\})/i,/^(?:`)/i,/^(?:[^`]+)/i,/^(?:`)/i,/^(?:')/i,/^(?:(?:\\\\|\\[']|[^'])+)/i,/^(?:')/i,/^(?:")/i,/^(?:(?:\\\\|\\["]|[^"])+)/i,/^(?:")/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i], conditions: {"hdfs":{"rules":[427,428,429,430,431,432,476],"inclusive":false},"doubleQuotedValue":{"rules":[469,470,479],"inclusive":false},"singleQuotedValue":{"rules":[466,467,478],"inclusive":false},"backtickedValue":{"rules":[463,464,477],"inclusive":false},"between":{"rules":[0,1,2,3,4,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,410,411,412,413,414,415,416,417,423,424,425,426,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,468,471,472,473,480],"inclusive":true},"hive":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,410,411,412,413,414,415,416,417,418,419,423,424,425,426,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,468,471,472,474,480],"inclusive":true},"impala":{"rules":[0,1,2,3,4,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,420,421,422,423,424,425,426,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,468,471,472,475,480],"inclusive":true},"INITIAL":{"rules":[0,1,2,3,4,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,410,411,412,413,414,415,416,417,423,424,425,426,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,468,471,472,480],"inclusive":true}} }); return lexer; diff --git a/core/sqlSyntaxParser.js b/core/sqlSyntaxParser.js index ac15620..45c18cc 100644 --- a/core/sqlSyntaxParser.js +++ b/core/sqlSyntaxParser.js @@ -9165,7 +9165,7 @@ case 480:console.log(yy_.yytext); break; } }, -rules: [/^(?:\s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(?:DEFERRED)/i,/^(?:DEFINED)/i,/^(?:DELIMITED)/i,/^(?:DEPENDENCY)/i,/^(?:DESC)/i,/^(?:DIRECTORY)/i,/^(?:DISABLE)/i,/^(?:DISTRIBUTE)/i,/^(?:DOUBLE\s+PRECISION)/i,/^(?:ESCAPED)/i,/^(?:ENABLE)/i,/^(?:EXCHANGE)/i,/^(?:EXPLAIN)/i,/^(?:EXPORT)/i,/^(?:FIELDS)/i,/^(?:FILE)/i,/^(?:FILEFORMAT)/i,/^(?:FIRST)/i,/^(?:FORMAT)/i,/^(?:FORMATTED)/i,/^(?:FUNCTION)/i,/^(?:FUNCTIONS)/i,/^(?:HOUR)/i,/^(?:IDXPROPERTIES)/i,/^(?:INDEX)/i,/^(?:INDEXES)/i,/^(?:INPATH)/i,/^(?:INPUTFORMAT)/i,/^(?:ITEMS)/i,/^(?:JAR)/i,/^(?:KEY)/i,/^(?:KEYS)/i,/^(?:LINES)/i,/^(?:LOAD)/i,/^(?:LOCATION)/i,/^(?:LOCK)/i,/^(?:LOCKS)/i,/^(?:MATCHED)/i,/^(?:MERGE)/i,/^(?:METADATA)/i,/^(?:MINUTE)/i,/^(?:MONTH)/i,/^(?:MSCK)/i,/^(?:NORELY)/i,/^(?:NOSCAN)/i,/^(?:NOVALIDATE)/i,/^(?:NO_DROP)/i,/^(?:OFFLINE)/i,/^(?:ORC)/i,/^(?:OUTPUTFORMAT)/i,/^(?:OVERWRITE)/i,/^(?:OVERWRITE\s+DIRECTORY)/i,/^(?:OWNER)/i,/^(?:PARQUET)/i,/^(?:PARTITIONED)/i,/^(?:PARTITIONS)/i,/^(?:PERCENT)/i,/^(?:PRIVILEGES)/i,/^(?:PURGE)/i,/^(?:QUARTER)/i,/^(?:RCFILE)/i,/^(?:REBUILD)/i,/^(?:RELOAD)/i,/^(?:RELY)/i,/^(?:REPAIR)/i,/^(?:REPLICATION)/i,/^(?:RECOVER)/i,/^(?:RENAME)/i,/^(?:REPLACE)/i,/^(?:RESTRICT)/i,/^(?:ROLE)/i,/^(?:ROLES)/i,/^(?:SECOND)/i,/^(?:SCHEMA)/i,/^(?:SCHEMAS)/i,/^(?:SEQUENCEFILE)/i,/^(?:SERDE)/i,/^(?:SERDEPROPERTIES)/i,/^(?:SETS)/i,/^(?:SHOW)/i,/^(?:SHOW_DATABASE)/i,/^(?:SKEWED)/i,/^(?:SKEWED LOCATION)/i,/^(?:SORT)/i,/^(?:SORTED)/i,/^(?:STATISTICS)/i,/^(?:STORED)/i,/^(?:STORED\s+AS\s+DIRECTORIES)/i,/^(?:STRING)/i,/^(?:STRUCT)/i,/^(?:TABLES)/i,/^(?:TABLESAMPLE)/i,/^(?:TBLPROPERTIES)/i,/^(?:TEMPORARY)/i,/^(?:TERMINATED)/i,/^(?:TEXTFILE)/i,/^(?:TINYINT)/i,/^(?:TOUCH)/i,/^(?:TRANSACTIONS)/i,/^(?:UNARCHIVE)/i,/^(?:UNIONTYPE)/i,/^(?:USE)/i,/^(?:VIEW)/i,/^(?:WAIT)/i,/^(?:WEEK)/i,/^(?:WINDOW)/i,/^(?:YEAR)/i,/^(?:\.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:ADD)/i,/^(?:AGGREGATE)/i,/^(?:AVRO)/i,/^(?:CACHED)/i,/^(?:CASCADE)/i,/^(?:CHANGE)/i,/^(?:CLOSE_FN)/i,/^(?:COLUMN)/i,/^(?:COLUMNS)/i,/^(?:COMMENT)/i,/^(?:COMPUTE)/i,/^(?:CREATE)/i,/^(?:DATA)/i,/^(?:DATABASES)/i,/^(?:DELETE)/i,/^(?:DELIMITED)/i,/^(?:DESCRIBE)/i,/^(?:ESCAPED)/i,/^(?:EXPLAIN)/i,/^(?:EXTERNAL)/i,/^(?:EXTENDED)/i,/^(?:FIELDS)/i,/^(?:FILEFORMAT)/i,/^(?:FILES)/i,/^(?:FINALIZE_FN)/i,/^(?:FIRST)/i,/^(?:FORMAT)/i,/^(?:FORMATTED)/i,/^(?:FUNCTION)/i,/^(?:FUNCTIONS)/i,/^(?:GROUP)/i,/^(?:HASH)/i,/^(?:ILIKE)/i,/^(?:INCREMENTAL)/i,/^(?:INSERT)/i,/^(?:INTERVAL)/i,/^(?:INTERMEDIATE)/i,/^(?:INIT_FN)/i,/^(?:INVALIDATE)/i,/^(?:INPATH)/i,/^(?:IREGEXP)/i,/^(?:KEY)/i,/^(?:KUDU)/i,/^(?:LAST)/i,/^(?:LIKE\s+PARQUET)/i,/^(?:LIMIT)/i,/^(?:LINES)/i,/^(?:LOAD)/i,/^(?:LOCATION)/i,/^(?:MERGE_FN)/i,/^(?:METADATA)/i,/^(?:NULLS)/i,/^(?:OFFSET)/i,/^(?:ORC)/i,/^(?:OVERWRITE)/i,/^(?:PARQUET)/i,/^(?:PARTITIONED)/i,/^(?:PARTITIONS)/i,/^(?:PREPARE_FN)/i,/^(?:PRIMARY)/i,/^(?:RCFILE)/i,/^(?:RANGE)/i,/^(?:REAL)/i,/^(?:REFRESH)/i,/^(?:RENAME)/i,/^(?:REPEATABLE)/i,/^(?:REPLACE)/i,/^(?:REPLICATION)/i,/^(?:RESTRICT)/i,/^(?:RETURNS)/i,/^(?:REVOKE)/i,/^(?:SEQUENCEFILE)/i,/^(?:SERDEPROPERTIES)/i,/^(?:SCHEMAS)/i,/^(?:SERIALIZE_FN)/i,/^(?:SERVER)/i,/^(?:SORT)/i,/^(?:STATS)/i,/^(?:STORED)/i,/^(?:STRAIGHT_JOIN)/i,/^(?:SYMBOL)/i,/^(?:TABLE)/i,/^(?:TABLES)/i,/^(?:TABLESAMPLE)/i,/^(?:TBLPROPERTIES)/i,/^(?:TERMINATED)/i,/^(?:TEXTFILE)/i,/^(?:UNCACHED)/i,/^(?:UPDATE_FN)/i,/^(?:UPSERT)/i,/^(?:URI)/i,/^(?:USING)/i,/^(?:PARTITION\s+VALUE\s)/i,/^(?:ANALYTIC)/i,/^(?:ANTI)/i,/^(?:ARRAY)/i,/^(?:BLOCK_SIZE)/i,/^(?:COMPRESSION)/i,/^(?:CURR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:SEMI)/i,/^(?:SET)/i,/^(?:SHOW)/i,/^(?:SMALLINT)/i,/^(?:STRING)/i,/^(?:TABLE)/i,/^(?:THEN)/i,/^(?:TIMESTAMP)/i,/^(?:TINYINT)/i,/^(?:TO)/i,/^(?:TRUE)/i,/^(?:TRUNCATE)/i,/^(?:UNBOUNDED)/i,/^(?:UPDATE)/i,/^(?:USE)/i,/^(?:UNION)/i,/^(?:VIEW)/i,/^(?:VARCHAR)/i,/^(?:VALUES)/i,/^(?:WHEN)/i,/^(?:WHERE)/i,/^(?:WITH)/i,/^(?:OVER)/i,/^(?:ROLE)/i,/^(?:AVG\s*\()/i,/^(?:CAST\s*\()/i,/^(?:COUNT\s*\()/i,/^(?:MAX\s*\()/i,/^(?:MIN\s*\()/i,/^(?:STDDEV_POP\s*\()/i,/^(?:STDDEV_SAMP\s*\()/i,/^(?:SUM\s*\()/i,/^(?:VARIANCE\s*\()/i,/^(?:VAR_POP\s*\()/i,/^(?:VAR_SAMP\s*\()/i,/^(?:COLLECT_SET\s*\()/i,/^(?:COLLECT_LIST\s*\()/i,/^(?:CORR\s*\()/i,/^(?:COVAR_POP\s*\()/i,/^(?:COVAR_SAMP\s*\()/i,/^(?:EXTRACT\s*\()/i,/^(?:HISTOGRAM_NUMERIC\s*\()/i,/^(?:NTILE\s*\()/i,/^(?:PERCENTILE\s*\()/i,/^(?:PERCENTILE_APPROX\s*\()/i,/^(?:APPX_MEDIAN\s*\()/i,/^(?:EXTRACT\s*\()/i,/^(?:GROUP_CONCAT\s*\()/i,/^(?:NDV\s*\()/i,/^(?:STDDEV\s*\()/i,/^(?:VARIANCE_POP\s*\()/i,/^(?:VARIANCE_SAMP\s*\()/i,/^(?:CUME_DIST\s*\()/i,/^(?:DENSE_RANK\s*\()/i,/^(?:FIRST_VALUE\s*\()/i,/^(?:LAG\s*\()/i,/^(?:LAST_VALUE\s*\()/i,/^(?:LEAD\s*\()/i,/^(?:RANK\s*\()/i,/^(?:ROW_NUMBER\s*\()/i,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:FIELDS)/i,/^(?:FILE)/i,/^(?:FILEFORMAT)/i,/^(?:FIRST)/i,/^(?:FORMAT)/i,/^(?:FORMATTED)/i,/^(?:FUNCTION)/i,/^(?:FUNCTIONS)/i,/^(?:HOUR)/i,/^(?:IDXPROPERTIES)/i,/^(?:INDEX)/i,/^(?:INDEXES)/i,/^(?:INPATH)/i,/^(?:INPUTFORMAT)/i,/^(?:ITEMS)/i,/^(?:JAR)/i,/^(?:KEY)/i,/^(?:KEYS)/i,/^(?:LINES)/i,/^(?:LOAD)/i,/^(?:LOCATION)/i,/^(?:LOCK)/i,/^(?:LOCKS)/i,/^(?:MATCHED)/i,/^(?:MERGE)/i,/^(?:METADATA)/i,/^(?:MINUTE)/i,/^(?:MONTH)/i,/^(?:MSCK)/i,/^(?:NORELY)/i,/^(?:NOSCAN)/i,/^(?:NOVALIDATE)/i,/^(?:NO_DROP)/i,/^(?:OFFLINE)/i,/^(?:ORC)/i,/^(?:OUTPUTFORMAT)/i,/^(?:OVERWRITE)/i,/^(?:OVERWRITE\s+DIRECTORY)/i,/^(?:OWNER)/i,/^(?:PARQUET)/i,/^(?:PARTITIONED)/i,/^(?:PARTITIONS)/i,/^(?:PERCENT)/i,/^(?:PRIVILEGES)/i,/^(?:PURGE)/i,/^(?:QUARTER)/i,/^(?:RCFILE)/i,/^(?:REBUILD)/i,/^(?:RELOAD)/i,/^(?:RELY)/i,/^(?:REPAIR)/i,/^(?:REPLICATION)/i,/^(?:RECOVER)/i,/^(?:RENAME)/i,/^(?:REPLACE)/i,/^(?:RESTRICT)/i,/^(?:ROLE)/i,/^(?:ROLES)/i,/^(?:SECOND)/i,/^(?:SCHEMA)/i,/^(?:SCHEMAS)/i,/^(?:SEQUENCEFILE)/i,/^(?:SERDE)/i,/^(?:SERDEPROPERTIES)/i,/^(?:SETS)/i,/^(?:SHOW)/i,/^(?:SHOW_DATABASE)/i,/^(?:SKEWED)/i,/^(?:SKEWED LOCATION)/i,/^(?:SORT)/i,/^(?:SORTED)/i,/^(?:STATISTICS)/i,/^(?:STORED)/i,/^(?:STORED\s+AS\s+DIRECTORIES)/i,/^(?:STRING)/i,/^(?:STRUCT)/i,/^(?:TABLES)/i,/^(?:TABLESAMPLE)/i,/^(?:TBLPROPERTIES)/i,/^(?:TEMPORARY)/i,/^(?:TERMINATED)/i,/^(?:TEXTFILE)/i,/^(?:TINYINT)/i,/^(?:TOUCH)/i,/^(?:TRANSACTIONS)/i,/^(?:UNARCHIVE)/i,/^(?:UNIONTYPE)/i,/^(?:USE)/i,/^(?:VIEW)/i,/^(?:WAIT)/i,/^(?:WEEK)/i,/^(?:WINDOW)/i,/^(?:YEAR)/i,/^(?:\.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:ADD)/i,/^(?:AGGREGATE)/i,/^(?:AVRO)/i,/^(?:CACHED)/i,/^(?:CASCADE)/i,/^(?:CHANGE)/i,/^(?:CLOSE_FN)/i,/^(?:COLUMN)/i,/^(?:COLUMNS)/i,/^(?:COMMENT)/i,/^(?:COMPUTE)/i,/^(?:CREATE)/i,/^(?:DATA)/i,/^(?:DATABASES)/i,/^(?:DELETE)/i,/^(?:DELIMITED)/i,/^(?:DESCRIBE)/i,/^(?:ESCAPED)/i,/^(?:EXPLAIN)/i,/^(?:EXTERNAL)/i,/^(?:EXTENDED)/i,/^(?:FIELDS)/i,/^(?:FILEFORMAT)/i,/^(?:FILES)/i,/^(?:FINALIZE_FN)/i,/^(?:FIRST)/i,/^(?:FORMAT)/i,/^(?:FORMATTED)/i,/^(?:FUNCTION)/i,/^(?:FUNCTIONS)/i,/^(?:GROUP)/i,/^(?:HASH)/i,/^(?:ILIKE)/i,/^(?:INCREMENTAL)/i,/^(?:INSERT)/i,/^(?:INTERVAL)/i,/^(?:INTERMEDIATE)/i,/^(?:INIT_FN)/i,/^(?:INVALIDATE)/i,/^(?:INPATH)/i,/^(?:IREGEXP)/i,/^(?:KEY)/i,/^(?:KUDU)/i,/^(?:LAST)/i,/^(?:LIKE\s+PARQUET)/i,/^(?:LIMIT)/i,/^(?:LINES)/i,/^(?:LOAD)/i,/^(?:LOCATION)/i,/^(?:MERGE_FN)/i,/^(?:METADATA)/i,/^(?:NULLS)/i,/^(?:OFFSET)/i,/^(?:ORC)/i,/^(?:OVERWRITE)/i,/^(?:PARQUET)/i,/^(?:PARTITIONED)/i,/^(?:PARTITIONS)/i,/^(?:PREPARE_FN)/i,/^(?:PRIMARY)/i,/^(?:RCFILE)/i,/^(?:RANGE)/i,/^(?:REAL)/i,/^(?:REFRESH)/i,/^(?:RENAME)/i,/^(?:REPEATABLE)/i,/^(?:REPLACE)/i,/^(?:REPLICATION)/i,/^(?:RESTRICT)/i,/^(?:RETURNS)/i,/^(?:REVOKE)/i,/^(?:SEQUENCEFILE)/i,/^(?:SERDEPROPERTIES)/i,/^(?:SCHEMAS)/i,/^(?:SERIALIZE_FN)/i,/^(?:SERVER)/i,/^(?:SORT)/i,/^(?:STATS)/i,/^(?:STORED)/i,/^(?:STRAIGHT_JOIN)/i,/^(?:SYMBOL)/i,/^(?:TABLE)/i,/^(?:TABLES)/i,/^(?:TABLESAMPLE)/i,/^(?:TBLPROPERTIES)/i,/^(?:TERMINATED)/i,/^(?:TEXTFILE)/i,/^(?:UNCACHED)/i,/^(?:UPDATE_FN)/i,/^(?:UPSERT)/i,/^(?:URI)/i,/^(?:USING)/i,/^(?:PARTITION\s+VALUE\s)/i,/^(?:ANALYTIC)/i,/^(?:ANTI)/i,/^(?:ARRAY)/i,/^(?:BLOCK_SIZE)/i,/^(?:COMPRESSION)/i,/^(?:CURRENT)/i,/^(?:DEFAULT)/i,/^(?:ENCODING)/i,/^(?:GRANT)/i,/^(?:MAP)/i,/^(?:RECOVER)/i,/^(?:ROLE)/i,/^(?:ROLES)/i,/^(?:STRUCT)/i,/^(?:UNKNOWN)/i,/^(?:\[BROADCAST\])/i,/^(?:\[NOSHUFFLE\])/i,/^(?:\[SHUFFLE\])/i,/^(?:\.\.\.)/i,/^(?:\.)/i,/^(?:\[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i,/^(?:VARCHAR)/i,/^(?:VALUES)/i,/^(?:WHEN)/i,/^(?:WHERE)/i,/^(?:WITH)/i,/^(?:OVER)/i,/^(?:ROLE)/i,/^(?:AVG\s*\()/i,/^(?:CAST\s*\()/i,/^(?:COUNT\s*\()/i,/^(?:MAX\s*\()/i,/^(?:MIN\s*\()/i,/^(?:STDDEV_POP\s*\()/i,/^(?:STDDEV_SAMP\s*\()/i,/^(?:SUM\s*\()/i,/^(?:VARIANCE\s*\()/i,/^(?:VAR_POP\s*\()/i,/^(?:VAR_SAMP\s*\()/i,/^(?:COLLECT_SET\s*\()/i,/^(?:COLLECT_LIST\s*\()/i,/^(?:CORR\s*\()/i,/^(?:COVAR_POP\s*\()/i,/^(?:COVAR_SAMP\s*\()/i,/^(?:EXTRACT\s*\()/i,/^(?:HISTOGRAM_NUMERIC\s*\()/i,/^(?:NTILE\s*\()/i,/^(?:PERCENTILE\s*\()/i,/^(?:PERCENTILE_APPROX\s*\()/i,/^(?:APPX_MEDIAN\s*\()/i,/^(?:EXTRACT\s*\()/i,/^(?:GROUP_CONCAT\s*\()/i,/^(?:NDV\s*\()/i,/^(?:STDDEV\s*\()/i,/^(?:VARIANCE_POP\s*\()/i,/^(?:VARIANCE_SAMP\s*\()/i,/^(?:CUME_DIST\s*\()/i,/^(?:DENSE_RANK\s*\()/i,/^(?:FIRST_VALUE\s*\()/i,/^(?:LAG\s*\()/i,/^(?:LAST_VALUE\s*\()/i,/^(?:LEAD\s*\()/i,/^(?:RANK\s*\()/i,/^(?:ROW_NUMBER\s*\()/i,/^(?:CUME_DIST\s*\()/i,/^(?:PERCENT_RANK\s*\()/i,/^(?:NTILE\s*\()/i,/^(?:PERCENT_RANK\s*\()/i,/^(?:SYSTEM\s*\()/i,/^(?:[0-9]+)/i,/^(?:[0-9]+(?:[YSL]|BD)?)/i,/^(?:[0-9]+E)/i,/^(?:[A-Za-z0-9_]+)/i,/^(?:\u2020)/i,/^(?:\u2021)/i,/^(?:\s+['])/i,/^(?:[^'\u2020\u2021]+)/i,/^(?:['])/i,/^(?:$)/i,/^(?:&&)/i,/^(?:\|\|)/i,/^(?:=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:!=)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:<>)/i,/^(?:<=>)/i,/^(?:-)/i,/^(?:\*)/i,/^(?:\+)/i,/^(?:\/)/i,/^(?:%)/i,/^(?:\|)/i,/^(?:\^)/i,/^(?:&)/i,/^(?:,)/i,/^(?:\.)/i,/^(?::)/i,/^(?:;)/i,/^(?:~)/i,/^(?:!)/i,/^(?:\()/i,/^(?:\))/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\$\{[^}]*\})/i,/^(?:`)/i,/^(?:[^`]+)/i,/^(?:`)/i,/^(?:')/i,/^(?:(?:\\\\|\\[']|[^'])+)/i,/^(?:')/i,/^(?:")/i,/^(?:(?:\\\\|\\["]|[^"])+)/i,/^(?:")/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i,/^(?:.)/i], conditions: {"hdfs":{"rules":[427,428,429,430,431,432,476],"inclusive":false},"doubleQuotedValue":{"rules":[469,470,479],"inclusive":false},"singleQuotedValue":{"rules":[466,467,478],"inclusive":false},"backtickedValue":{"rules":[463,464,477],"inclusive":false},"between":{"rules":[0,1,2,3,4,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,410,411,412,413,414,415,416,417,423,424,425,426,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,468,471,472,473,480],"inclusive":true},"hive":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,410,411,412,413,414,415,416,417,418,419,423,424,425,426,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,468,471,472,474,480],"inclusive":true},"impala":{"rules":[0,1,2,3,4,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,420,421,422,423,424,425,426,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,468,471,472,475,480],"inclusive":true},"INITIAL":{"rules":[0,1,2,3,4,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,410,411,412,413,414,415,416,417,423,424,425,426,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,465,468,471,472,480],"inclusive":true}} }); return lexer; diff --git a/jison/sql.jisonlex b/jison/sql.jisonlex index 18236a4..e32828c 100755 --- a/jison/sql.jisonlex +++ b/jison/sql.jisonlex @@ -521,7 +521,7 @@ ROW_NUMBER\s*\( { yy.lexer.unput('('); yytext = 'row_ \` { this.popState(); return 'BACKTICK'; } \' { this.begin('singleQuotedValue'); return 'SINGLE_QUOTE'; } -(?:\\[']|[^'])+ { +(?:\\\\|\\[']|[^'])+ { if (parser.handleQuotedValueWithCursor(this, yytext, yylloc, '\'')) { return 'PARTIAL_VALUE'; } @@ -530,7 +530,7 @@ ROW_NUMBER\s*\( { yy.lexer.unput('('); yytext = 'row_ \' { this.popState(); return 'SINGLE_QUOTE'; } \" { this.begin('doubleQuotedValue'); return 'DOUBLE_QUOTE'; } -(?:\\["]|[^"])+ { +(?:\\\\|\\["]|[^"])+ { if (parser.handleQuotedValueWithCursor(this, yytext, yylloc, '"')) { return 'PARTIAL_VALUE'; } diff --git a/package.json b/package.json index 68cc0c4..666ee88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dt-sql-parser", - "version": "1.1.7", + "version": "1.1.8", "description": "sql,hive,parser ", "keywords":["hive","hql","sql","parser"], "main": "index.js", diff --git a/test/example.js b/test/example.js index 7c0f944..36b5577 100644 --- a/test/example.js +++ b/test/example.js @@ -1,9 +1,12 @@ const example={ - test0:`--alter table sx_622_1 add partition(pa=${"${bdp.system.bizdate}"}); - SELECT muyun_test_down1.id, muyun_test_down1.name, muyun_test_down2.age - FROM muyun_test_down1 - JOIN muyun_test_down2 - ON muyun_test_down1.id = muyun_test_down2.id + test0:`create table t_csv( + id int, + name string, + address string, + sex tinyint + )row format serde'org.apache.hadoop.hive.serde2.OpenCSVSerde'with serdeproperties( + "separatorChar"=",", + "quoteChar"="'","escapeChar"="")stored as textfile; `, test1:`/*asf*/create table sql_task_comment_test(id int comment 'id') comment 'sql test'; --sdfsss`, diff --git a/test/index.js b/test/index.js index 212769b..edb97c1 100644 --- a/test/index.js +++ b/test/index.js @@ -1,13 +1,15 @@ const dtSqlParser=require("../index"); const example=require("./example"); const testMap=Object.entries(example); +const filterSql=dtSqlParser.filter.filterComments; +const splitSql=dtSqlParser.filter.splitSql; for(let [key,value] of testMap){ console.log(`******${key}********`) console.log(value) console.log(`******result********`) - console.log(dtSqlParser.parser.parseSyntax(value)); - // console.log(dtSqlParser.filter.splitSql(value)) + // console.log(dtSqlParser.parser.parseSyntax(value)); + console.log(splitSql(filterSql(value))) console.log(`********************`) }