support format g4 (#232)
* chore: install antlr-format-cli to format g4 files * style: format all g4 files * chore: apply antlr-format to lint-staged
This commit is contained in:
parent
17eba1f2aa
commit
14a5214e82
@ -1,4 +1,5 @@
|
||||
module.exports = {
|
||||
'*.js': [`prettier --write`],
|
||||
'*.ts': [`prettier --write`],
|
||||
'*.g4': [`antlr-format -c ./antlr.format.json -v`],
|
||||
};
|
||||
|
34
antlr.format.json
Normal file
34
antlr.format.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"main": {
|
||||
"alignTrailingComments": true,
|
||||
"columnLimit": 150,
|
||||
"minEmptyLines": 1,
|
||||
"maxEmptyLinesToKeep": 1,
|
||||
"reflowComments": false,
|
||||
"useTab": false,
|
||||
"allowShortRulesOnASingleLine": false,
|
||||
"allowShortBlocksOnASingleLine": true,
|
||||
"alignSemicolons": "hanging",
|
||||
"alignColons": "hanging",
|
||||
"spaceBeforeAssignmentOperators": false,
|
||||
"keepEmptyLinesAtTheStartOfBlocks": true
|
||||
},
|
||||
"lexer": {
|
||||
"alignTrailingComments": true,
|
||||
"columnLimit": 150,
|
||||
"maxEmptyLinesToKeep": 1,
|
||||
"reflowComments": false,
|
||||
"useTab": false,
|
||||
"allowShortRulesOnASingleLine": true,
|
||||
"allowShortBlocksOnASingleLine": true,
|
||||
"minEmptyLines": 0,
|
||||
"alignSemicolons": "none",
|
||||
"alignColons": "trailing",
|
||||
"singleLineOverrulesHangingColon": true,
|
||||
"alignLexerCommands": true,
|
||||
"alignLabels": true,
|
||||
"alignTrailers": true,
|
||||
"spaceBeforeAssignmentOperators": false,
|
||||
"groupedAlignments": true
|
||||
}
|
||||
}
|
@ -28,6 +28,7 @@
|
||||
"release": "node ./scripts/release.js",
|
||||
"lint": "prettier --check '**/*.ts' --config ./.prettierrc",
|
||||
"lint-fix": "prettier --write '**/*.ts' --config ./.prettierrc",
|
||||
"format-g4": "antlr-format -c ./antlr.format.json -v ./src/grammar/**/*.g4",
|
||||
"cleanComment": "node ./scripts/cleanCommentCli.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
@ -39,6 +40,7 @@
|
||||
"@swc/jest": "^0.2.26",
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/node": "^18.15.11",
|
||||
"antlr-format-cli": "^1.2.1",
|
||||
"antlr4ts-cli": "^0.5.0-alpha.4",
|
||||
"chalk": "4.1.2",
|
||||
"commitizen": "^4.3.0",
|
||||
|
128
pnpm-lock.yaml
128
pnpm-lock.yaml
@ -8,6 +8,7 @@ specifiers:
|
||||
'@swc/jest': ^0.2.26
|
||||
'@types/jest': ^29.5.1
|
||||
'@types/node': ^18.15.11
|
||||
antlr-format-cli: ^1.2.1
|
||||
antlr4-c3: 3.1.1
|
||||
antlr4ts: 0.5.0-alpha.4
|
||||
antlr4ts-cli: ^0.5.0-alpha.4
|
||||
@ -35,6 +36,7 @@ devDependencies:
|
||||
'@swc/jest': 0.2.26_@swc+core@1.3.60
|
||||
'@types/jest': 29.5.1
|
||||
'@types/node': 18.16.16
|
||||
antlr-format-cli: 1.2.1
|
||||
antlr4ts-cli: 0.5.0-alpha.4
|
||||
chalk: 4.1.2
|
||||
commitizen: 4.3.0_@swc+core@1.3.60
|
||||
@ -351,6 +353,13 @@ packages:
|
||||
'@babel/helper-plugin-utils': 7.21.5
|
||||
dev: true
|
||||
|
||||
/@babel/runtime/7.23.6:
|
||||
resolution: {integrity: sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
dependencies:
|
||||
regenerator-runtime: 0.14.0
|
||||
dev: true
|
||||
|
||||
/@babel/template/7.21.9:
|
||||
resolution: {integrity: sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
@ -587,6 +596,11 @@ packages:
|
||||
'@jridgewell/trace-mapping': 0.3.9
|
||||
dev: true
|
||||
|
||||
/@humanwhocodes/momoa/2.0.4:
|
||||
resolution: {integrity: sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==}
|
||||
engines: {node: '>=10.10.0'}
|
||||
dev: true
|
||||
|
||||
/@hutson/parse-repository-url/3.0.2:
|
||||
resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
@ -899,6 +913,22 @@ packages:
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@readme/better-ajv-errors/1.6.0_ajv@8.12.0:
|
||||
resolution: {integrity: sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ==}
|
||||
engines: {node: '>=14'}
|
||||
peerDependencies:
|
||||
ajv: 4.11.8 - 8
|
||||
dependencies:
|
||||
'@babel/code-frame': 7.21.4
|
||||
'@babel/runtime': 7.23.6
|
||||
'@humanwhocodes/momoa': 2.0.4
|
||||
ajv: 8.12.0
|
||||
chalk: 4.1.2
|
||||
json-to-ast: 2.1.0
|
||||
jsonpointer: 5.0.1
|
||||
leven: 3.1.0
|
||||
dev: true
|
||||
|
||||
/@sinclair/typebox/0.25.24:
|
||||
resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==}
|
||||
dev: true
|
||||
@ -1112,6 +1142,10 @@ packages:
|
||||
pretty-format: 29.5.0
|
||||
dev: true
|
||||
|
||||
/@types/json-schema/7.0.15:
|
||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||
dev: true
|
||||
|
||||
/@types/minimist/1.2.2:
|
||||
resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
|
||||
dev: true
|
||||
@ -1233,12 +1267,32 @@ packages:
|
||||
engines: {node: '>=12'}
|
||||
dev: true
|
||||
|
||||
/antlr-format-cli/1.2.1:
|
||||
resolution: {integrity: sha512-vqpoL9x3bXiNnC/vzZG3XOyk2vUAHPmBbI/ufyAqbxQHD27OPuUM4n/6m6NBEZZ7V4U2aEiefnZg2SCaSU89oA==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@readme/better-ajv-errors': 1.6.0_ajv@8.12.0
|
||||
ajv: 8.12.0
|
||||
antlr4ng: 2.0.2
|
||||
commander: 11.1.0
|
||||
glob: 10.3.10
|
||||
ts-json-schema-generator: 1.4.0
|
||||
transitivePeerDependencies:
|
||||
- antlr4ng-cli
|
||||
dev: true
|
||||
|
||||
/antlr4-c3/3.1.1:
|
||||
resolution: {integrity: sha512-S7DixV12kxWexTkQYGvooCgHYU5AjF74oYio+ZNgm0XN3EzxDY3J6Si9GprQ4KksvgWwK//EgZnL/26WB+bOpw==}
|
||||
dependencies:
|
||||
antlr4ts: 0.5.0-alpha.4
|
||||
dev: false
|
||||
|
||||
/antlr4ng/2.0.2:
|
||||
resolution: {integrity: sha512-Fhs3AvhoGigRt3RpHw0wGA7n03j9BpskH9yCUViNB7NtKuCA+imy2orEZ8qcgPG98f7IryEPYlG9sx99f3ZOyw==}
|
||||
peerDependencies:
|
||||
antlr4ng-cli: 1.0.4
|
||||
dev: true
|
||||
|
||||
/antlr4ts-cli/0.5.0-alpha.4:
|
||||
resolution: {integrity: sha512-lVPVBTA2CVHRYILSKilL6Jd4hAumhSZZWA7UbQNQrmaSSj7dPmmYaN4bOmZG79cOy0lS00i4LY68JZZjZMWVrw==}
|
||||
hasBin: true
|
||||
@ -1558,6 +1612,11 @@ packages:
|
||||
engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
|
||||
dev: true
|
||||
|
||||
/code-error-fragment/0.0.230:
|
||||
resolution: {integrity: sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==}
|
||||
engines: {node: '>= 4'}
|
||||
dev: true
|
||||
|
||||
/collect-v8-coverage/1.0.1:
|
||||
resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==}
|
||||
dev: true
|
||||
@ -1587,6 +1646,11 @@ packages:
|
||||
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
|
||||
dev: true
|
||||
|
||||
/commander/11.1.0:
|
||||
resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==}
|
||||
engines: {node: '>=16'}
|
||||
dev: true
|
||||
|
||||
/commander/9.5.0:
|
||||
resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
|
||||
engines: {node: ^12.20.0 || >=14}
|
||||
@ -2312,6 +2376,17 @@ packages:
|
||||
path-is-absolute: 1.0.1
|
||||
dev: true
|
||||
|
||||
/glob/8.1.0:
|
||||
resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
|
||||
engines: {node: '>=12'}
|
||||
dependencies:
|
||||
fs.realpath: 1.0.0
|
||||
inflight: 1.0.6
|
||||
inherits: 2.0.4
|
||||
minimatch: 5.1.6
|
||||
once: 1.4.0
|
||||
dev: true
|
||||
|
||||
/global-dirs/0.1.1:
|
||||
resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==}
|
||||
engines: {node: '>=4'}
|
||||
@ -2348,6 +2423,10 @@ packages:
|
||||
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
|
||||
dev: true
|
||||
|
||||
/grapheme-splitter/1.0.4:
|
||||
resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==}
|
||||
dev: true
|
||||
|
||||
/handlebars/4.7.7:
|
||||
resolution: {integrity: sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==}
|
||||
engines: {node: '>=0.4.7'}
|
||||
@ -3107,6 +3186,14 @@ packages:
|
||||
resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
|
||||
dev: true
|
||||
|
||||
/json-to-ast/2.1.0:
|
||||
resolution: {integrity: sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==}
|
||||
engines: {node: '>= 4'}
|
||||
dependencies:
|
||||
code-error-fragment: 0.0.230
|
||||
grapheme-splitter: 1.0.4
|
||||
dev: true
|
||||
|
||||
/json5/2.2.3:
|
||||
resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
|
||||
engines: {node: '>=6'}
|
||||
@ -3130,6 +3217,11 @@ packages:
|
||||
engines: {'0': node >= 0.2.0}
|
||||
dev: true
|
||||
|
||||
/jsonpointer/5.0.1:
|
||||
resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/kind-of/6.0.3:
|
||||
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@ -3405,6 +3497,13 @@ packages:
|
||||
brace-expansion: 1.1.11
|
||||
dev: true
|
||||
|
||||
/minimatch/5.1.6:
|
||||
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
|
||||
engines: {node: '>=10'}
|
||||
dependencies:
|
||||
brace-expansion: 2.0.1
|
||||
dev: true
|
||||
|
||||
/minimatch/9.0.3:
|
||||
resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
@ -3823,6 +3922,10 @@ packages:
|
||||
strip-indent: 3.0.0
|
||||
dev: true
|
||||
|
||||
/regenerator-runtime/0.14.0:
|
||||
resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==}
|
||||
dev: true
|
||||
|
||||
/require-directory/2.1.1:
|
||||
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@ -3910,6 +4013,11 @@ packages:
|
||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||
dev: true
|
||||
|
||||
/safe-stable-stringify/2.4.3:
|
||||
resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==}
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/safer-buffer/2.1.2:
|
||||
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
|
||||
dev: true
|
||||
@ -4253,6 +4361,20 @@ packages:
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/ts-json-schema-generator/1.4.0:
|
||||
resolution: {integrity: sha512-wm8vyihmGgYpxrqRshmYkWGNwEk+sf3xV2rUgxv8Ryeh7bSpMO7pZQOht+2rS002eDkFTxR7EwRPXVzrS0WJTg==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@types/json-schema': 7.0.15
|
||||
commander: 11.1.0
|
||||
glob: 8.1.0
|
||||
json5: 2.2.3
|
||||
normalize-path: 3.0.0
|
||||
safe-stable-stringify: 2.4.3
|
||||
typescript: 5.2.2
|
||||
dev: true
|
||||
|
||||
/ts-node/10.9.1_0d2585e4297d96d8e906ef9bffd6d443:
|
||||
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
|
||||
hasBin: true
|
||||
@ -4324,6 +4446,12 @@ packages:
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/typescript/5.2.2:
|
||||
resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==}
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/uglify-js/3.17.4:
|
||||
resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==}
|
||||
engines: {node: '>=0.8.0'}
|
||||
|
@ -1,13 +1,15 @@
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing
|
||||
// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true
|
||||
|
||||
lexer grammar FlinkSqlLexer;
|
||||
|
||||
// SKIP
|
||||
|
||||
SPACE : [ \t\r\n]+ -> channel(HIDDEN);
|
||||
COMMENT_INPUT : '/*' .*? '*/' -> channel(HIDDEN);
|
||||
LINE_COMMENT: (
|
||||
('--' | '#') ~[\r\n]* ('\r'? '\n' | EOF)
|
||||
| '--' ('\r'? '\n' | EOF)
|
||||
) -> channel(HIDDEN);
|
||||
LINE_COMMENT: (('--' | '#') ~[\r\n]* ('\r'? '\n' | EOF) | '--' ('\r'? '\n' | EOF)) -> channel(HIDDEN);
|
||||
|
||||
/**
|
||||
* Keywords and Reserved Keywords
|
||||
@ -532,7 +534,6 @@ KW_WEEK :'WEEK';
|
||||
KW_YEARS : 'YEARS';
|
||||
KW_ZONE : 'ZONE';
|
||||
|
||||
|
||||
// Operators. Comparation
|
||||
|
||||
EQUAL_SYMBOL : '=';
|
||||
@ -540,7 +541,6 @@ GREATER_SYMBOL: '>';
|
||||
LESS_SYMBOL : '<';
|
||||
EXCLAMATION_SYMBOL : '!';
|
||||
|
||||
|
||||
// Operators. Bit
|
||||
|
||||
BIT_NOT_OP : '~';
|
||||
@ -548,7 +548,6 @@ BIT_OR_OP: '|';
|
||||
BIT_AND_OP : '&';
|
||||
BIT_XOR_OP : '^';
|
||||
|
||||
|
||||
// Constructors symbols
|
||||
|
||||
DOT : '.';
|
||||
|
@ -1,8 +1,16 @@
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true
|
||||
|
||||
parser grammar FlinkSqlParser;
|
||||
|
||||
options { tokenVocab=FlinkSqlLexer; }
|
||||
options {
|
||||
tokenVocab=FlinkSqlLexer;
|
||||
}
|
||||
|
||||
program: singleStatement* EOF;
|
||||
program
|
||||
: singleStatement* EOF
|
||||
;
|
||||
|
||||
singleStatement
|
||||
: sqlStatement SEMICOLON?
|
||||
@ -10,10 +18,18 @@ singleStatement
|
||||
;
|
||||
|
||||
sqlStatement
|
||||
: ddlStatement | dmlStatement | describeStatement
|
||||
| explainStatement | useStatement | showStatememt
|
||||
| loadStatement | unloadStatememt | setStatememt
|
||||
| resetStatememt | jarStatememt | dtAddStatement
|
||||
: ddlStatement
|
||||
| dmlStatement
|
||||
| describeStatement
|
||||
| explainStatement
|
||||
| useStatement
|
||||
| showStatememt
|
||||
| loadStatement
|
||||
| unloadStatememt
|
||||
| setStatememt
|
||||
| resetStatememt
|
||||
| jarStatememt
|
||||
| dtAddStatement
|
||||
;
|
||||
|
||||
emptyStatement
|
||||
@ -21,13 +37,25 @@ emptyStatement
|
||||
;
|
||||
|
||||
ddlStatement
|
||||
: createTable | createDatabase | createView | createFunction | createCatalog
|
||||
| alterTable | alertView | alterDatabase | alterFunction
|
||||
| dropCatalog | dropTable | dropDatabase | dropView | dropFunction
|
||||
: createTable
|
||||
| createDatabase
|
||||
| createView
|
||||
| createFunction
|
||||
| createCatalog
|
||||
| alterTable
|
||||
| alertView
|
||||
| alterDatabase
|
||||
| alterFunction
|
||||
| dropCatalog
|
||||
| dropTable
|
||||
| dropDatabase
|
||||
| dropView
|
||||
| dropFunction
|
||||
;
|
||||
|
||||
dmlStatement
|
||||
: queryStatement | insertStatement
|
||||
: queryStatement
|
||||
| insertStatement
|
||||
;
|
||||
|
||||
// some statemen
|
||||
@ -36,7 +64,11 @@ describeStatement
|
||||
;
|
||||
|
||||
explainStatement
|
||||
: KW_EXPLAIN (explainDetails | KW_PLAN KW_FOR)? (dmlStatement | insertSimpleStatement | insertMulStatement)
|
||||
: KW_EXPLAIN (explainDetails | KW_PLAN KW_FOR)? (
|
||||
dmlStatement
|
||||
| insertSimpleStatement
|
||||
| insertMulStatement
|
||||
)
|
||||
;
|
||||
|
||||
explainDetails
|
||||
@ -44,7 +76,9 @@ explainDetails
|
||||
;
|
||||
|
||||
explainDetail
|
||||
: KW_CHANGELOG_MODE | KW_JSON_EXECUTION_PLAN | KW_ESTIMATED_COST
|
||||
: KW_CHANGELOG_MODE
|
||||
| KW_JSON_EXECUTION_PLAN
|
||||
| KW_ESTIMATED_COST
|
||||
;
|
||||
|
||||
useStatement
|
||||
@ -91,7 +125,13 @@ jarStatememt
|
||||
dtAddStatement
|
||||
: KW_ADD KW_JAR KW_WITH dtFilePath (KW_AS uid)?
|
||||
| KW_ADD KW_FILE KW_WITH dtFilePath (KW_AS uid)? (KW_RENAME uid)?
|
||||
| KW_ADD (KW_PYTHON_FILES | KW_PYTHON_REQUIREMENTS | KW_PYTHON_DEPENDENCIES | KW_PYTHON_JAR | KW_PYTHON_ARCHIVES) KW_WITH dtFilePath KW_RENAME uid
|
||||
| KW_ADD (
|
||||
KW_PYTHON_FILES
|
||||
| KW_PYTHON_REQUIREMENTS
|
||||
| KW_PYTHON_DEPENDENCIES
|
||||
| KW_PYTHON_JAR
|
||||
| KW_PYTHON_ARCHIVES
|
||||
) KW_WITH dtFilePath KW_RENAME uid
|
||||
| KW_ADD KW_PYTHON_PARAMETER dtFilePath
|
||||
| KW_ADD KW_ENGINE KW_FILE KW_WITH dtFilePath KW_RENAME uid KW_KEY uid
|
||||
| KW_ADD KW_CONFIG KW_FILE KW_WITH dtFilePath KW_FOR uid KW_AS uid
|
||||
@ -108,16 +148,9 @@ createTable
|
||||
;
|
||||
|
||||
simpleCreateTable
|
||||
: KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tablePathCreate
|
||||
LR_BRACKET
|
||||
columnOptionDefinition (COMMA columnOptionDefinition)*
|
||||
(COMMA watermarkDefinition)?
|
||||
(COMMA tableConstraint)?
|
||||
(COMMA selfDefinitionClause)?
|
||||
RR_BRACKET
|
||||
commentSpec?
|
||||
partitionDefinition?
|
||||
withOption
|
||||
: KW_CREATE KW_TEMPORARY? KW_TABLE ifNotExists? tablePathCreate LR_BRACKET columnOptionDefinition (
|
||||
COMMA columnOptionDefinition
|
||||
)* (COMMA watermarkDefinition)? (COMMA tableConstraint)? (COMMA selfDefinitionClause)? RR_BRACKET commentSpec? partitionDefinition? withOption
|
||||
likeDefinition?
|
||||
;
|
||||
|
||||
@ -141,10 +174,12 @@ physicalColumnDefinition
|
||||
|
||||
columnNameCreate
|
||||
: uid
|
||||
| expression;
|
||||
| expression
|
||||
;
|
||||
|
||||
columnName
|
||||
: uid | expression
|
||||
: uid
|
||||
| expression
|
||||
;
|
||||
|
||||
columnNameList
|
||||
@ -153,9 +188,21 @@ columnNameList
|
||||
|
||||
columnType
|
||||
: typeName=(KW_DATE | KW_BOOLEAN | KW_NULL)
|
||||
| typeName=(KW_CHAR | KW_VARCHAR | KW_STRING | KW_BINARY | KW_VARBINARY | KW_BYTES
|
||||
| KW_TINYINT | KW_SMALLINT |KW_INT | KW_INTEGER | KW_BIGINT
|
||||
| KW_TIME | KW_TIMESTAMP_LTZ | KW_DATETIME
|
||||
| typeName=(
|
||||
KW_CHAR
|
||||
| KW_VARCHAR
|
||||
| KW_STRING
|
||||
| KW_BINARY
|
||||
| KW_VARBINARY
|
||||
| KW_BYTES
|
||||
| KW_TINYINT
|
||||
| KW_SMALLINT
|
||||
| KW_INT
|
||||
| KW_INTEGER
|
||||
| KW_BIGINT
|
||||
| KW_TIME
|
||||
| KW_TIMESTAMP_LTZ
|
||||
| KW_DATETIME
|
||||
) lengthOneDimension?
|
||||
| typeName=KW_TIMESTAMP lengthOneDimension? ((KW_WITHOUT | KW_WITH) KW_LOCAL? KW_TIME KW_ZONE)?
|
||||
| typeName=(KW_DECIMAL | KW_DEC | KW_NUMERIC | KW_FLOAT | KW_DOUBLE) lengthTwoOptionalDimension?
|
||||
@ -190,7 +237,8 @@ rowTypeDimension
|
||||
;
|
||||
|
||||
columnConstraint
|
||||
:(KW_CONSTRAINT constraintName)? KW_PRIMARY KW_KEY (KW_NOT KW_ENFORCED)? | KW_NOT? KW_NULL
|
||||
: (KW_CONSTRAINT constraintName)? KW_PRIMARY KW_KEY (KW_NOT KW_ENFORCED)?
|
||||
| KW_NOT? KW_NULL
|
||||
;
|
||||
|
||||
commentSpec
|
||||
@ -271,7 +319,9 @@ createView
|
||||
;
|
||||
|
||||
createFunction
|
||||
: KW_CREATE (KW_TEMPORARY|KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifNotExists? functionNameCreate KW_AS identifier (KW_LANGUAGE (KW_JAVA|KW_SCALA|KW_PYTHON))? usingClause?
|
||||
: KW_CREATE (KW_TEMPORARY | KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifNotExists? functionNameCreate KW_AS identifier (
|
||||
KW_LANGUAGE (KW_JAVA | KW_SCALA | KW_PYTHON)
|
||||
)? usingClause?
|
||||
;
|
||||
|
||||
usingClause
|
||||
@ -287,7 +337,13 @@ jarFileName
|
||||
// it only includes rename, set key, add constraint, drop constraint, add unique
|
||||
|
||||
alterTable
|
||||
: KW_ALTER KW_TABLE ifExists? tablePath (renameDefinition | setKeyValueDefinition | addConstraint | dropConstraint | addUnique)
|
||||
: KW_ALTER KW_TABLE ifExists? tablePath (
|
||||
renameDefinition
|
||||
| setKeyValueDefinition
|
||||
| addConstraint
|
||||
| dropConstraint
|
||||
| addUnique
|
||||
)
|
||||
;
|
||||
|
||||
renameDefinition
|
||||
@ -323,10 +379,11 @@ alterDatabase
|
||||
;
|
||||
|
||||
alterFunction
|
||||
: KW_ALTER (KW_TEMPORARY|KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifExists? functionName KW_AS identifier (KW_LANGUAGE (KW_JAVA|KW_SCALA|KW_PYTHON))? // TODO
|
||||
: KW_ALTER (KW_TEMPORARY | KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifExists? functionName KW_AS identifier (
|
||||
KW_LANGUAGE (KW_JAVA | KW_SCALA | KW_PYTHON)
|
||||
)? // TODO
|
||||
;
|
||||
|
||||
|
||||
// Drop statements
|
||||
|
||||
dropCatalog
|
||||
@ -349,17 +406,16 @@ dropFunction
|
||||
: KW_DROP (KW_TEMPORARY | KW_TEMPORARY KW_SYSTEM)? KW_FUNCTION ifExists? functionName
|
||||
;
|
||||
|
||||
|
||||
// Insert statements
|
||||
|
||||
insertStatement
|
||||
: (KW_EXECUTE? insertSimpleStatement)
|
||||
| insertMulStatementCompatibility | (KW_EXECUTE insertMulStatement)
|
||||
| insertMulStatementCompatibility
|
||||
| (KW_EXECUTE insertMulStatement)
|
||||
;
|
||||
|
||||
insertSimpleStatement
|
||||
: KW_INSERT (KW_INTO | KW_OVERWRITE) tablePath
|
||||
(
|
||||
: KW_INSERT (KW_INTO | KW_OVERWRITE) tablePath (
|
||||
insertPartitionDefinition? columnNameList? queryStatement
|
||||
| valuesDefinition
|
||||
)
|
||||
@ -374,9 +430,7 @@ valuesDefinition
|
||||
;
|
||||
|
||||
valuesRowDefinition
|
||||
: LR_BRACKET
|
||||
constant (COMMA constant)*
|
||||
RR_BRACKET
|
||||
: LR_BRACKET constant (COMMA constant)* RR_BRACKET
|
||||
;
|
||||
|
||||
insertMulStatementCompatibility
|
||||
@ -420,7 +474,10 @@ selectStatement
|
||||
;
|
||||
|
||||
selectClause
|
||||
: KW_SELECT setQuantifier? (ASTERISK_SIGN | projectItemDefinition (COMMA projectItemDefinition)*)
|
||||
: KW_SELECT setQuantifier? (
|
||||
ASTERISK_SIGN
|
||||
| projectItemDefinition (COMMA projectItemDefinition)*
|
||||
)
|
||||
;
|
||||
|
||||
projectItemDefinition
|
||||
@ -563,25 +620,12 @@ namedWindow
|
||||
;
|
||||
|
||||
windowSpec
|
||||
: name=errorCapturingIdentifier?
|
||||
LR_BRACKET
|
||||
partitionByClause?
|
||||
orderByCaluse?
|
||||
windowFrame?
|
||||
RR_BRACKET
|
||||
: name=errorCapturingIdentifier? LR_BRACKET partitionByClause? orderByCaluse? windowFrame? RR_BRACKET
|
||||
;
|
||||
|
||||
matchRecognizeClause
|
||||
: KW_MATCH_RECOGNIZE
|
||||
LR_BRACKET
|
||||
partitionByClause?
|
||||
orderByCaluse?
|
||||
measuresClause?
|
||||
outputMode?
|
||||
afterMatchStrategy?
|
||||
patternDefination?
|
||||
patternVariablesDefination
|
||||
RR_BRACKET ( KW_AS? identifier )?
|
||||
: KW_MATCH_RECOGNIZE LR_BRACKET partitionByClause? orderByCaluse? measuresClause? outputMode? afterMatchStrategy? patternDefination?
|
||||
patternVariablesDefination RR_BRACKET (KW_AS? identifier)?
|
||||
;
|
||||
|
||||
orderByCaluse
|
||||
@ -614,11 +658,7 @@ measuresClause
|
||||
;
|
||||
|
||||
patternDefination
|
||||
: KW_PATTERN
|
||||
LR_BRACKET
|
||||
patternVariable+
|
||||
RR_BRACKET
|
||||
withinClause?
|
||||
: KW_PATTERN LR_BRACKET patternVariable+ RR_BRACKET withinClause?
|
||||
;
|
||||
|
||||
patternVariable
|
||||
@ -654,7 +694,6 @@ withinClause
|
||||
: KW_WITHIN timeIntervalExpression
|
||||
;
|
||||
|
||||
|
||||
// expression
|
||||
|
||||
expression
|
||||
@ -671,10 +710,7 @@ booleanExpression
|
||||
;
|
||||
|
||||
predicate
|
||||
: KW_NOT?
|
||||
kind=KW_BETWEEN (KW_ASYMMETRIC | KW_SYMMETRIC)?
|
||||
lower=valueExpression KW_AND
|
||||
upper=valueExpression
|
||||
: KW_NOT? kind=KW_BETWEEN (KW_ASYMMETRIC | KW_SYMMETRIC)? lower=valueExpression KW_AND upper=valueExpression
|
||||
| KW_NOT? kind=KW_IN LR_BRACKET expression (COMMA expression)* RR_BRACKET
|
||||
| KW_NOT? kind=KW_IN LR_BRACKET queryStatement RR_BRACKET
|
||||
| kind=KW_EXISTS LR_BRACKET queryStatement RR_BRACKET
|
||||
@ -686,7 +722,10 @@ predicate
|
||||
;
|
||||
|
||||
likePredicate
|
||||
: KW_NOT? kind=KW_LIKE quantifier=(KW_ANY | KW_ALL) (LR_BRACKET RR_BRACKET | LR_BRACKET expression (COMMA expression)* RR_BRACKET)
|
||||
: KW_NOT? kind=KW_LIKE quantifier=(KW_ANY | KW_ALL) (
|
||||
LR_BRACKET RR_BRACKET
|
||||
| LR_BRACKET expression (COMMA expression)* RR_BRACKET
|
||||
)
|
||||
| KW_NOT? kind=KW_LIKE pattern=valueExpression (KW_ESCAPE stringLiteral)?
|
||||
;
|
||||
|
||||
@ -758,7 +797,8 @@ correlationName
|
||||
;
|
||||
|
||||
qualifiedName
|
||||
: identifier | dereferenceDefinition
|
||||
: identifier
|
||||
| dereferenceDefinition
|
||||
;
|
||||
|
||||
timeIntervalExpression
|
||||
@ -814,7 +854,8 @@ identifier
|
||||
;
|
||||
|
||||
unquotedIdentifier
|
||||
: DIG_LITERAL | ID_LITERAL
|
||||
: DIG_LITERAL
|
||||
| ID_LITERAL
|
||||
;
|
||||
|
||||
quotedIdentifier
|
||||
@ -870,10 +911,12 @@ withOption
|
||||
;
|
||||
|
||||
ifNotExists
|
||||
: KW_IF KW_NOT KW_EXISTS;
|
||||
: KW_IF KW_NOT KW_EXISTS
|
||||
;
|
||||
|
||||
ifExists
|
||||
: KW_IF KW_EXISTS;
|
||||
: KW_IF KW_EXISTS
|
||||
;
|
||||
|
||||
tablePropertyList
|
||||
: LR_BRACKET tableProperty (COMMA tableProperty)* RR_BRACKET
|
||||
@ -884,7 +927,8 @@ tableProperty
|
||||
;
|
||||
|
||||
tablePropertyKey
|
||||
: identifier | dereferenceDefinition
|
||||
: identifier
|
||||
| dereferenceDefinition
|
||||
| STRING_LITERAL
|
||||
;
|
||||
|
||||
@ -963,7 +1007,9 @@ decimalLiteral
|
||||
;
|
||||
|
||||
booleanLiteral
|
||||
: KW_TRUE | KW_FALSE;
|
||||
: KW_TRUE
|
||||
| KW_FALSE
|
||||
;
|
||||
|
||||
setQuantifier
|
||||
: KW_DISTINCT
|
||||
|
@ -20,6 +20,11 @@
|
||||
* Reference: https://github.com/antlr/grammars-v4/blob/master/sql/hive/v4/HiveLexer.g4
|
||||
*/
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing
|
||||
// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true
|
||||
|
||||
lexer grammar HiveSqlLexer;
|
||||
|
||||
// unsupported option caseInsensitive in antlr4@4.9
|
||||
@ -460,32 +465,17 @@ DOLLAR : '$';
|
||||
|
||||
// LITERALS
|
||||
|
||||
StringLiteral
|
||||
: ( '\'' ( ~('\''|'\\') | ('\\' .) )* '\''
|
||||
| '"' ( ~('"'|'\\') | ('\\' .) )* '"'
|
||||
)+
|
||||
;
|
||||
StringLiteral: ( '\'' ( ~('\'' | '\\') | ('\\' .))* '\'' | '"' ( ~('"' | '\\') | ('\\' .))* '"')+;
|
||||
|
||||
CharSetLiteral
|
||||
: StringLiteral
|
||||
| '0' 'X' (HexDigit | Digit)+
|
||||
;
|
||||
CharSetLiteral: StringLiteral | '0' 'X' (HexDigit | Digit)+;
|
||||
|
||||
IntegralLiteral
|
||||
: Digit+ ('L' | 'S' | 'Y')
|
||||
;
|
||||
IntegralLiteral: Digit+ ('L' | 'S' | 'Y');
|
||||
|
||||
NumberLiteral
|
||||
: Number ('B'? 'D')
|
||||
;
|
||||
NumberLiteral: Number ('B'? 'D');
|
||||
|
||||
ByteLengthLiteral
|
||||
: Digit+ [BKMG]
|
||||
;
|
||||
ByteLengthLiteral: Digit+ [BKMG];
|
||||
|
||||
Number
|
||||
: Digit+ (DOT Digit* Exponent? | Exponent)?
|
||||
;
|
||||
Number: Digit+ (DOT Digit* Exponent? | Exponent)?;
|
||||
|
||||
/*
|
||||
An Identifier can be:
|
||||
@ -508,67 +498,46 @@ An Identifier can be:
|
||||
- hint name
|
||||
- window name
|
||||
*/
|
||||
Identifier
|
||||
: (Letter | Digit) (Letter | Digit | '_')*
|
||||
| QuotedIdentifier
|
||||
| '`' RegexComponent+ '`'
|
||||
;
|
||||
Identifier: (Letter | Digit) (Letter | Digit | '_')* | QuotedIdentifier | '`' RegexComponent+ '`';
|
||||
|
||||
fragment
|
||||
QuotedIdentifier
|
||||
: '`' ('``' | ~'`')* '`'
|
||||
;
|
||||
fragment QuotedIdentifier: '`' ('``' | ~'`')* '`';
|
||||
|
||||
fragment
|
||||
Letter
|
||||
: 'A'..'Z'
|
||||
| 'a'..'z'
|
||||
;
|
||||
fragment Letter: 'A' ..'Z' | 'a' ..'z';
|
||||
|
||||
fragment
|
||||
HexDigit
|
||||
: 'A'..'F'
|
||||
;
|
||||
fragment HexDigit: 'A' ..'F';
|
||||
|
||||
fragment
|
||||
Digit
|
||||
: '0'..'9'
|
||||
;
|
||||
fragment Digit: '0' ..'9';
|
||||
|
||||
fragment
|
||||
Exponent
|
||||
: ('E') ( PLUS|MINUS )? (Digit)+
|
||||
;
|
||||
fragment Exponent: ('E') ( PLUS | MINUS)? (Digit)+;
|
||||
|
||||
fragment
|
||||
RegexComponent
|
||||
: 'A'..'Z' | '0'..'9' | '_'
|
||||
| PLUS | STAR | QUESTION | MINUS | DOT
|
||||
| LPAREN | RPAREN | LSQUARE | RSQUARE | LCURLY | RCURLY
|
||||
| BITWISEXOR | BITWISEOR | DOLLAR | BITWISENOT
|
||||
;
|
||||
fragment RegexComponent:
|
||||
'A' ..'Z'
|
||||
| '0' ..'9'
|
||||
| '_'
|
||||
| PLUS
|
||||
| STAR
|
||||
| QUESTION
|
||||
| MINUS
|
||||
| DOT
|
||||
| LPAREN
|
||||
| RPAREN
|
||||
| LSQUARE
|
||||
| RSQUARE
|
||||
| LCURLY
|
||||
| RCURLY
|
||||
| BITWISEXOR
|
||||
| BITWISEOR
|
||||
| DOLLAR
|
||||
| BITWISENOT;
|
||||
|
||||
CharSetName
|
||||
: '_' (Letter | Digit | '_' | '-' | '.' | ':')+
|
||||
;
|
||||
CharSetName: '_' (Letter | Digit | '_' | '-' | '.' | ':')+;
|
||||
|
||||
WHITE_SPACE
|
||||
: (' '|'\r'|'\t'|'\n') -> channel(HIDDEN)
|
||||
;
|
||||
WHITE_SPACE: (' ' | '\r' | '\t' | '\n') -> channel(HIDDEN);
|
||||
|
||||
LINE_COMMENT
|
||||
: '--' ~('\n' | '\r')* -> channel(HIDDEN)
|
||||
;
|
||||
LINE_COMMENT: '--' ~('\n' | '\r')* -> channel(HIDDEN);
|
||||
|
||||
QUERY_HINT
|
||||
: SHOW_HINT
|
||||
| HIDDEN_HINT
|
||||
;
|
||||
QUERY_HINT: SHOW_HINT | HIDDEN_HINT;
|
||||
|
||||
SHOW_HINT
|
||||
: '/*+' (QUERY_HINT | .)*? '*/' ->channel(HIDDEN)
|
||||
;
|
||||
SHOW_HINT: '/*+' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN);
|
||||
|
||||
HIDDEN_HINT
|
||||
: '/*' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN)
|
||||
;
|
||||
HIDDEN_HINT: '/*' (QUERY_HINT | .)*? '*/' -> channel(HIDDEN);
|
@ -20,6 +20,10 @@
|
||||
* Reference: https://github.com/antlr/grammars-v4/blob/master/sql/hive/v4/HiveParser.g4
|
||||
*/
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true
|
||||
|
||||
parser grammar HiveSqlParser;
|
||||
|
||||
options
|
||||
@ -27,7 +31,9 @@ options
|
||||
tokenVocab=HiveSqlLexer;
|
||||
}
|
||||
|
||||
program : statement* EOF;
|
||||
program
|
||||
: statement* EOF
|
||||
;
|
||||
|
||||
// starting rule
|
||||
statement
|
||||
@ -35,10 +41,7 @@ statement
|
||||
;
|
||||
|
||||
explainStatement
|
||||
: KW_EXPLAIN (
|
||||
explainOption* execStatement
|
||||
| KW_REWRITE queryStatementExpression
|
||||
)
|
||||
: KW_EXPLAIN (explainOption* execStatement | KW_REWRITE queryStatementExpression)
|
||||
;
|
||||
|
||||
explainOption
|
||||
@ -98,24 +101,17 @@ replicationClause
|
||||
;
|
||||
|
||||
exportStatement
|
||||
: KW_EXPORT
|
||||
KW_TABLE tableOrPartition
|
||||
KW_TO StringLiteral
|
||||
replicationClause?
|
||||
: KW_EXPORT KW_TABLE tableOrPartition KW_TO StringLiteral replicationClause?
|
||||
;
|
||||
|
||||
importStatement
|
||||
: KW_IMPORT
|
||||
(KW_EXTERNAL? KW_TABLE tableOrPartition)?
|
||||
KW_FROM path=StringLiteral
|
||||
tableLocation?
|
||||
: KW_IMPORT (KW_EXTERNAL? KW_TABLE tableOrPartition)? KW_FROM path=StringLiteral tableLocation?
|
||||
;
|
||||
|
||||
replDumpStatement
|
||||
: KW_REPL KW_DUMP
|
||||
dbPolicy=replDbPolicy
|
||||
(KW_REPLACE oldDbPolicy=replDbPolicy)?
|
||||
(KW_WITH replConf=replConfigs)?
|
||||
: KW_REPL KW_DUMP dbPolicy=replDbPolicy (KW_REPLACE oldDbPolicy=replDbPolicy)? (
|
||||
KW_WITH replConf=replConfigs
|
||||
)?
|
||||
;
|
||||
|
||||
replDbPolicy
|
||||
@ -123,10 +119,9 @@ replDbPolicy
|
||||
;
|
||||
|
||||
replLoadStatement
|
||||
: KW_REPL KW_LOAD
|
||||
sourceDbPolicy=replDbPolicy
|
||||
(KW_INTO dbName=dbSchemaName)?
|
||||
(KW_WITH replConf=replConfigs)?
|
||||
: KW_REPL KW_LOAD sourceDbPolicy=replDbPolicy (KW_INTO dbName=dbSchemaName)? (
|
||||
KW_WITH replConf=replConfigs
|
||||
)?
|
||||
;
|
||||
|
||||
replConfigs
|
||||
@ -142,9 +137,7 @@ replTableLevelPolicy
|
||||
;
|
||||
|
||||
replStatusStatement
|
||||
: KW_REPL KW_STATUS
|
||||
dbName=dbSchemaName
|
||||
(KW_WITH replConf=replConfigs)?
|
||||
: KW_REPL KW_STATUS dbName=dbSchemaName (KW_WITH replConf=replConfigs)?
|
||||
;
|
||||
|
||||
ddlStatement
|
||||
@ -231,19 +224,12 @@ orReplace
|
||||
;
|
||||
|
||||
createDatabaseStatement
|
||||
: KW_CREATE KW_REMOTE? db_schema
|
||||
ifNotExists?
|
||||
name=dbSchemaNameCreate
|
||||
databaseComment?
|
||||
dbLocation?
|
||||
dbManagedLocation?
|
||||
(KW_WITH KW_DBPROPERTIES dbprops=dbProperties)?
|
||||
| KW_CREATE KW_REMOTE db_schema
|
||||
ifNotExists?
|
||||
name=dbSchemaNameCreate
|
||||
databaseComment?
|
||||
dbConnectorName
|
||||
(KW_WITH KW_DBPROPERTIES dbprops=dbProperties)?
|
||||
: KW_CREATE KW_REMOTE? db_schema ifNotExists? name=dbSchemaNameCreate databaseComment? dbLocation? dbManagedLocation? (
|
||||
KW_WITH KW_DBPROPERTIES dbprops=dbProperties
|
||||
)?
|
||||
| KW_CREATE KW_REMOTE db_schema ifNotExists? name=dbSchemaNameCreate databaseComment? dbConnectorName (
|
||||
KW_WITH KW_DBPROPERTIES dbprops=dbProperties
|
||||
)?
|
||||
;
|
||||
|
||||
dbLocation
|
||||
@ -291,8 +277,7 @@ inputFileFormat
|
||||
;
|
||||
|
||||
tabTypeExpr
|
||||
: id_ (DOT id_)?
|
||||
(id_ (DOT (KW_ELEM_TYPE | KW_KEY_TYPE | KW_VALUE_TYPE | id_))*)?
|
||||
: id_ (DOT id_)? (id_ (DOT (KW_ELEM_TYPE | KW_KEY_TYPE | KW_VALUE_TYPE | id_))*)?
|
||||
;
|
||||
|
||||
partTypeExpr
|
||||
@ -304,8 +289,7 @@ tabPartColTypeExpr
|
||||
;
|
||||
|
||||
descStatement
|
||||
: (KW_DESCRIBE | KW_DESC)
|
||||
(
|
||||
: (KW_DESCRIBE | KW_DESC) (
|
||||
db_schema KW_EXTENDED? dbName=dbSchemaName
|
||||
| KW_DATACONNECTOR KW_EXTENDED? dcName=dbSchemaName
|
||||
| KW_FUNCTION KW_EXTENDED? name=functionNameForDDL
|
||||
@ -315,8 +299,11 @@ descStatement
|
||||
;
|
||||
|
||||
analyzeStatement
|
||||
: KW_ANALYZE KW_TABLE parttype=tableOrPartition
|
||||
( KW_COMPUTE KW_STATISTICS (noscan=KW_NOSCAN | KW_FOR KW_COLUMNS statsColumnName=columnNameList?)?
|
||||
: KW_ANALYZE KW_TABLE parttype=tableOrPartition (
|
||||
KW_COMPUTE KW_STATISTICS (
|
||||
noscan=KW_NOSCAN
|
||||
| KW_FOR KW_COLUMNS statsColumnName=columnNameList?
|
||||
)?
|
||||
| KW_CACHE KW_METADATA
|
||||
)
|
||||
;
|
||||
@ -334,17 +321,29 @@ db_schema
|
||||
showStatement
|
||||
: KW_SHOW (KW_DATABASES | KW_SCHEMAS) (KW_LIKE showStmtIdentifier)?
|
||||
| KW_SHOW isExtended=KW_EXTENDED? KW_TABLES (from_in db_name=dbSchemaName)? filter=showTablesFilterExpr?
|
||||
| KW_SHOW KW_VIEWS (from_in db_name=dbSchemaName)? (KW_LIKE showStmtIdentifier | showStmtIdentifier)?
|
||||
| KW_SHOW KW_MATERIALIZED KW_VIEWS (from_in db_name=dbSchemaName)? (KW_LIKE showStmtIdentifier|showStmtIdentifier)?
|
||||
| KW_SHOW KW_SORTED? KW_COLUMNS from_in tableOrView (from_in db_name=dbSchemaName)? (KW_LIKE showStmtIdentifier|showStmtIdentifier)?
|
||||
| KW_SHOW KW_VIEWS (from_in db_name=dbSchemaName)? (
|
||||
KW_LIKE showStmtIdentifier
|
||||
| showStmtIdentifier
|
||||
)?
|
||||
| KW_SHOW KW_MATERIALIZED KW_VIEWS (from_in db_name=dbSchemaName)? (
|
||||
KW_LIKE showStmtIdentifier
|
||||
| showStmtIdentifier
|
||||
)?
|
||||
| KW_SHOW KW_SORTED? KW_COLUMNS from_in tableOrView (from_in db_name=dbSchemaName)? (
|
||||
KW_LIKE showStmtIdentifier
|
||||
| showStmtIdentifier
|
||||
)?
|
||||
| KW_SHOW KW_FUNCTIONS (KW_LIKE functionNameForDDL)?
|
||||
| KW_SHOW KW_PARTITIONS tabOrViewName=tableOrView partitionSpec? whereClause? orderByClause? limitClause?
|
||||
| KW_SHOW KW_CREATE (db_schema db_name=dbSchemaName | KW_TABLE tabName=tableName)
|
||||
| KW_SHOW KW_TABLE KW_EXTENDED (from_in db_name=dbSchemaName)? KW_LIKE showStmtIdentifier partitionSpec?
|
||||
| KW_SHOW KW_TBLPROPERTIES tableName (LPAREN prptyName=StringLiteral RPAREN)?
|
||||
| KW_SHOW KW_LOCKS (db_schema dbName=dbSchemaName isExtended=KW_EXTENDED? | parttype=partTypeExpr? isExtended=KW_EXTENDED?)
|
||||
| KW_SHOW KW_COMPACTIONS
|
||||
( compactionId
|
||||
| KW_SHOW KW_LOCKS (
|
||||
db_schema dbName=dbSchemaName isExtended=KW_EXTENDED?
|
||||
| parttype=partTypeExpr? isExtended=KW_EXTENDED?
|
||||
)
|
||||
| KW_SHOW KW_COMPACTIONS (
|
||||
compactionId
|
||||
| db_schema dbName=dbSchemaName compactionPool? compactionType? compactionStatus? orderByClause? limitClause?
|
||||
| parttype=partTypeExpr? compactionPool? compactionType? compactionStatus? orderByClause? limitClause?
|
||||
)
|
||||
@ -391,10 +390,7 @@ dropRoleStatement
|
||||
;
|
||||
|
||||
grantPrivileges
|
||||
: KW_GRANT privList=privilegeList
|
||||
privilegeObject?
|
||||
KW_TO principalSpecification
|
||||
withGrantOption?
|
||||
: KW_GRANT privList=privilegeList privilegeObject? KW_TO principalSpecification withGrantOption?
|
||||
;
|
||||
|
||||
revokePrivileges
|
||||
@ -422,11 +418,7 @@ showCurrentRole
|
||||
;
|
||||
|
||||
setRole
|
||||
: KW_SET KW_ROLE
|
||||
( all=KW_ALL
|
||||
| none=KW_NONE
|
||||
| id_
|
||||
)
|
||||
: KW_SET KW_ROLE (all=KW_ALL | none=KW_NONE | id_)
|
||||
;
|
||||
|
||||
showGrants
|
||||
@ -518,9 +510,10 @@ withAdminOption
|
||||
;
|
||||
|
||||
metastoreCheck
|
||||
: KW_MSCK repair=KW_REPAIR?
|
||||
(KW_TABLE tableName
|
||||
(opt=(KW_ADD | KW_DROP | KW_SYNC) parts=KW_PARTITIONS partitionSelectorSpec?)?
|
||||
: KW_MSCK repair=KW_REPAIR? (
|
||||
KW_TABLE tableName (
|
||||
opt=(KW_ADD | KW_DROP | KW_SYNC) parts=KW_PARTITIONS partitionSelectorSpec?
|
||||
)?
|
||||
)
|
||||
;
|
||||
|
||||
@ -539,8 +532,9 @@ resourceType
|
||||
;
|
||||
|
||||
createFunctionStatement
|
||||
: KW_CREATE temp=KW_TEMPORARY? KW_FUNCTION functionNameCreate KW_AS StringLiteral
|
||||
(KW_USING rList=resourceList)?
|
||||
: KW_CREATE temp=KW_TEMPORARY? KW_FUNCTION functionNameCreate KW_AS StringLiteral (
|
||||
KW_USING rList=resourceList
|
||||
)?
|
||||
;
|
||||
|
||||
dropFunctionStatement
|
||||
@ -552,8 +546,7 @@ reloadFunctionsStatement
|
||||
;
|
||||
|
||||
createMacroStatement
|
||||
: KW_CREATE KW_TEMPORARY KW_MACRO Identifier
|
||||
LPAREN columnNameTypeList? RPAREN expression
|
||||
: KW_CREATE KW_TEMPORARY KW_MACRO Identifier LPAREN columnNameTypeList? RPAREN expression
|
||||
;
|
||||
|
||||
dropMacroStatement
|
||||
@ -561,25 +554,21 @@ dropMacroStatement
|
||||
;
|
||||
|
||||
createIndexStatement
|
||||
: KW_CREATE KW_INDEX id_ KW_ON KW_TABLE tableName columnParenthesesList KW_AS indextype=StringLiteral
|
||||
(KW_WITH KW_DEFERRED KW_REBUILD)?
|
||||
(KW_IDXPROPERTIES tableProperties)?
|
||||
(KW_IN KW_TABLE tableName)?
|
||||
(KW_PARTITIONED KW_BY columnParenthesesList)?
|
||||
(tableRowFormat? tableFileFormat)?
|
||||
(KW_LOCATION locn=StringLiteral)?
|
||||
tablePropertiesPrefixed?
|
||||
tableComment?;
|
||||
: KW_CREATE KW_INDEX id_ KW_ON KW_TABLE tableName columnParenthesesList KW_AS indextype=StringLiteral (
|
||||
KW_WITH KW_DEFERRED KW_REBUILD
|
||||
)? (KW_IDXPROPERTIES tableProperties)? (KW_IN KW_TABLE tableName)? (
|
||||
KW_PARTITIONED KW_BY columnParenthesesList
|
||||
)? (tableRowFormat? tableFileFormat)? (KW_LOCATION locn=StringLiteral)? tablePropertiesPrefixed? tableComment?
|
||||
;
|
||||
|
||||
dropIndexStatement
|
||||
: KW_DROP KW_INDEX ifExists? id_ KW_ON tableName;
|
||||
: KW_DROP KW_INDEX ifExists? id_ KW_ON tableName
|
||||
;
|
||||
|
||||
createViewStatement
|
||||
: KW_CREATE orReplace? KW_VIEW ifNotExists? name=viewNameCreate
|
||||
(LPAREN columnNameCommentList RPAREN)? tableComment? viewPartition?
|
||||
tablePropertiesPrefixed?
|
||||
KW_AS
|
||||
selectStatementWithCTE
|
||||
: KW_CREATE orReplace? KW_VIEW ifNotExists? name=viewNameCreate (
|
||||
LPAREN columnNameCommentList RPAREN
|
||||
)? tableComment? viewPartition? tablePropertiesPrefixed? KW_AS selectStatementWithCTE
|
||||
;
|
||||
|
||||
viewPartition
|
||||
@ -612,10 +601,8 @@ dropViewStatement
|
||||
;
|
||||
|
||||
createMaterializedViewStatement
|
||||
: KW_CREATE KW_MATERIALIZED KW_VIEW ifNotExists? name=viewNameCreate
|
||||
rewriteDisabled? tableComment? viewPartition? viewOrganization?
|
||||
tableRowFormat? tableFileFormat? tableLocation?
|
||||
tablePropertiesPrefixed? KW_AS selectStatementWithCTE
|
||||
: KW_CREATE KW_MATERIALIZED KW_VIEW ifNotExists? name=viewNameCreate rewriteDisabled? tableComment? viewPartition? viewOrganization?
|
||||
tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed? KW_AS selectStatementWithCTE
|
||||
;
|
||||
|
||||
dropMaterializedViewStatement
|
||||
@ -623,11 +610,7 @@ dropMaterializedViewStatement
|
||||
;
|
||||
|
||||
createScheduledQueryStatement
|
||||
: KW_CREATE KW_SCHEDULED KW_QUERY name=id_
|
||||
scheduleSpec
|
||||
executedAsSpec?
|
||||
enableSpecification?
|
||||
definedAsSpec
|
||||
: KW_CREATE KW_SCHEDULED KW_QUERY name=id_ scheduleSpec executedAsSpec? enableSpecification? definedAsSpec
|
||||
;
|
||||
|
||||
dropScheduledQueryStatement
|
||||
@ -648,8 +631,9 @@ alterScheduledQueryChange
|
||||
|
||||
scheduleSpec
|
||||
: KW_CRON cronString=StringLiteral
|
||||
| KW_EVERY value=Number? qualifier=intervalQualifiers
|
||||
((KW_AT | KW_OFFSET KW_BY) offsetTs=StringLiteral)?
|
||||
| KW_EVERY value=Number? qualifier=intervalQualifiers (
|
||||
(KW_AT | KW_OFFSET KW_BY) offsetTs=StringLiteral
|
||||
)?
|
||||
;
|
||||
|
||||
executedAsSpec
|
||||
@ -670,8 +654,8 @@ tableComment
|
||||
;
|
||||
|
||||
createTablePartitionSpec
|
||||
: KW_PARTITIONED KW_BY
|
||||
( LPAREN (opt1=createTablePartitionColumnTypeSpec | opt2=createTablePartitionColumnSpec)
|
||||
: KW_PARTITIONED KW_BY (
|
||||
LPAREN (opt1=createTablePartitionColumnTypeSpec | opt2=createTablePartitionColumnSpec)
|
||||
| KW_SPEC LPAREN spec=partitionTransformSpec
|
||||
) RPAREN
|
||||
;
|
||||
@ -699,8 +683,9 @@ partitionTransformType
|
||||
;
|
||||
|
||||
tableBuckets
|
||||
: KW_CLUSTERED KW_BY LPAREN bucketCols=columnNameList RPAREN
|
||||
(KW_SORTED KW_BY LPAREN sortCols=columnNameOrderList RPAREN)? KW_INTO num=Number KW_BUCKETS
|
||||
: KW_CLUSTERED KW_BY LPAREN bucketCols=columnNameList RPAREN (
|
||||
KW_SORTED KW_BY LPAREN sortCols=columnNameOrderList RPAREN
|
||||
)? KW_INTO num=Number KW_BUCKETS
|
||||
;
|
||||
|
||||
tableImplBuckets
|
||||
@ -725,12 +710,14 @@ recordWriter
|
||||
;
|
||||
|
||||
rowFormatSerde
|
||||
: KW_ROW KW_FORMAT KW_SERDE name=StringLiteral (KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)?
|
||||
: KW_ROW KW_FORMAT KW_SERDE name=StringLiteral (
|
||||
KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties
|
||||
)?
|
||||
;
|
||||
|
||||
rowFormatDelimited
|
||||
: KW_ROW KW_FORMAT KW_DELIMITED tableRowFormatFieldIdentifier? tableRowFormatCollItemsIdentifier?
|
||||
tableRowFormatMapKeysIdentifier? tableRowFormatLinesIdentifier? tableRowNullFormat?
|
||||
: KW_ROW KW_FORMAT KW_DELIMITED tableRowFormatFieldIdentifier? tableRowFormatCollItemsIdentifier? tableRowFormatMapKeysIdentifier?
|
||||
tableRowFormatLinesIdentifier? tableRowNullFormat?
|
||||
;
|
||||
|
||||
tableRowFormat
|
||||
@ -760,7 +747,9 @@ keyProperty
|
||||
;
|
||||
|
||||
tableRowFormatFieldIdentifier
|
||||
: KW_FIELDS KW_TERMINATED KW_BY fldIdnt=StringLiteral (KW_ESCAPED KW_BY fldEscape=StringLiteral)?
|
||||
: KW_FIELDS KW_TERMINATED KW_BY fldIdnt=StringLiteral (
|
||||
KW_ESCAPED KW_BY fldEscape=StringLiteral
|
||||
)?
|
||||
;
|
||||
|
||||
tableRowFormatCollItemsIdentifier
|
||||
@ -780,16 +769,15 @@ tableRowNullFormat
|
||||
;
|
||||
|
||||
tableFileFormat
|
||||
: KW_STORED KW_AS KW_INPUTFORMAT
|
||||
inFmt=StringLiteral KW_OUTPUTFORMAT
|
||||
outFmt=StringLiteral
|
||||
(KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)?
|
||||
| KW_STORED KW_BY storageHandler=StringLiteral
|
||||
(KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)?
|
||||
(KW_STORED KW_AS fileformat=id_)?
|
||||
| KW_STORED KW_BY genericSpec=id_
|
||||
(KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)?
|
||||
(KW_STORED KW_AS fileformat=id_)?
|
||||
: KW_STORED KW_AS KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral (
|
||||
KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral
|
||||
)?
|
||||
| KW_STORED KW_BY storageHandler=StringLiteral (
|
||||
KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties
|
||||
)? (KW_STORED KW_AS fileformat=id_)?
|
||||
| KW_STORED KW_BY genericSpec=id_ (KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties)? (
|
||||
KW_STORED KW_AS fileformat=id_
|
||||
)?
|
||||
| KW_STORED KW_AS genericSpec=id_
|
||||
;
|
||||
|
||||
@ -880,13 +868,13 @@ checkConstraint
|
||||
;
|
||||
|
||||
createForeignKey
|
||||
: (KW_CONSTRAINT constraintName=id_)? KW_FOREIGN KW_KEY fkCols=columnParenthesesList
|
||||
KW_REFERENCES tabName=tableName parCols=columnParenthesesList constraintOptsCreate?
|
||||
: (KW_CONSTRAINT constraintName=id_)? KW_FOREIGN KW_KEY fkCols=columnParenthesesList KW_REFERENCES tabName=tableName parCols=columnParenthesesList
|
||||
constraintOptsCreate?
|
||||
;
|
||||
|
||||
alterForeignKeyWithName
|
||||
: KW_CONSTRAINT constraintName=id_ KW_FOREIGN KW_KEY fkCols=columnParenthesesList
|
||||
KW_REFERENCES tabName=tableName parCols=columnParenthesesList constraintOptsAlter?
|
||||
: KW_CONSTRAINT constraintName=id_ KW_FOREIGN KW_KEY fkCols=columnParenthesesList KW_REFERENCES tabName=tableName parCols=columnParenthesesList
|
||||
constraintOptsAlter?
|
||||
;
|
||||
|
||||
skewedValueElement
|
||||
@ -1032,7 +1020,8 @@ type
|
||||
| listType
|
||||
| structType
|
||||
| mapType
|
||||
| unionType;
|
||||
| unionType
|
||||
;
|
||||
|
||||
primitiveType
|
||||
: KW_TINYINT
|
||||
@ -1121,25 +1110,13 @@ regularBody
|
||||
;
|
||||
|
||||
atomSelectStatement
|
||||
: s=selectClause
|
||||
f=fromClause?
|
||||
w=whereClause?
|
||||
g=groupByClause?
|
||||
h=havingClause?
|
||||
win=window_clause?
|
||||
q=qualifyClause?
|
||||
: s=selectClause f=fromClause? w=whereClause? g=groupByClause? h=havingClause? win=window_clause? q=qualifyClause?
|
||||
| LPAREN selectStatement RPAREN
|
||||
| valuesSource
|
||||
;
|
||||
|
||||
selectStatement
|
||||
: a=atomSelectStatement
|
||||
set=setOpSelectStatement?
|
||||
o=orderByClause?
|
||||
c=clusterByClause?
|
||||
d=distributeByClause?
|
||||
sort=sortByClause?
|
||||
l=limitClause?
|
||||
: a=atomSelectStatement set=setOpSelectStatement? o=orderByClause? c=clusterByClause? d=distributeByClause? sort=sortByClause? l=limitClause?
|
||||
;
|
||||
|
||||
setOpSelectStatement
|
||||
@ -1151,35 +1128,15 @@ selectStatementWithCTE
|
||||
;
|
||||
|
||||
body
|
||||
: insertClause
|
||||
selectClause
|
||||
lateralView?
|
||||
whereClause?
|
||||
groupByClause?
|
||||
havingClause?
|
||||
window_clause?
|
||||
qualifyClause?
|
||||
orderByClause?
|
||||
clusterByClause?
|
||||
distributeByClause?
|
||||
sortByClause?
|
||||
limitClause?
|
||||
| selectClause
|
||||
lateralView?
|
||||
whereClause?
|
||||
groupByClause?
|
||||
havingClause?
|
||||
window_clause?
|
||||
qualifyClause?
|
||||
orderByClause?
|
||||
clusterByClause?
|
||||
distributeByClause?
|
||||
sortByClause?
|
||||
limitClause?
|
||||
: insertClause selectClause lateralView? whereClause? groupByClause? havingClause? window_clause? qualifyClause? orderByClause? clusterByClause?
|
||||
distributeByClause? sortByClause? limitClause?
|
||||
| selectClause lateralView? whereClause? groupByClause? havingClause? window_clause? qualifyClause? orderByClause? clusterByClause?
|
||||
distributeByClause? sortByClause? limitClause?
|
||||
;
|
||||
|
||||
insertClause
|
||||
: KW_INSERT ( KW_OVERWRITE destination ifNotExists?
|
||||
: KW_INSERT (
|
||||
KW_OVERWRITE destination ifNotExists?
|
||||
| KW_INTO KW_TABLE? tableOrPartition (LPAREN targetCols=columnNameList RPAREN)?
|
||||
)
|
||||
;
|
||||
@ -1267,6 +1224,7 @@ rollbackStatement
|
||||
setAutoCommitStatement
|
||||
: KW_SET KW_AUTOCOMMIT booleanValueTok
|
||||
;
|
||||
|
||||
/*
|
||||
END user defined transaction boundaries
|
||||
*/
|
||||
@ -1285,6 +1243,7 @@ BEGIN SQL Merge statement
|
||||
mergeStatement
|
||||
: KW_MERGE QUERY_HINT? KW_INTO tableName (KW_AS? id_)? KW_USING joinSourcePart KW_ON expression whenClauses
|
||||
;
|
||||
|
||||
/*
|
||||
Allow 0,1 or 2 WHEN MATCHED clauses and 0 or 1 WHEN NOT MATCHED
|
||||
Each WHEN clause may have AND <boolean predicate>.
|
||||
@ -1311,6 +1270,7 @@ updateOrDelete
|
||||
: KW_UPDATE setColumnsClause
|
||||
| KW_DELETE
|
||||
;
|
||||
|
||||
/*
|
||||
END SQL Merge statement
|
||||
*/
|
||||
@ -1343,7 +1303,8 @@ END SHOW COMPACTIONS statement
|
||||
*/
|
||||
|
||||
alterStatement
|
||||
: KW_ALTER ( KW_TABLE tableName alterTableStatementSuffix
|
||||
: KW_ALTER (
|
||||
KW_TABLE tableName alterTableStatementSuffix
|
||||
| KW_VIEW viewName KW_AS? alterViewStatementSuffix
|
||||
| KW_MATERIALIZED KW_VIEW tableNameTree=viewName alterMaterializedViewStatementSuffix
|
||||
| db_schema alterDatabaseStatementSuffix
|
||||
@ -1465,12 +1426,15 @@ alterStatementSuffixDropConstraint
|
||||
;
|
||||
|
||||
alterStatementSuffixRenameCol
|
||||
: KW_CHANGE KW_COLUMN? oldName=columnName newName=columnNameCreate colType alterColumnConstraint?
|
||||
(KW_COMMENT comment=StringLiteral)? alterStatementChangeColPosition? restrictOrCascade?
|
||||
: KW_CHANGE KW_COLUMN? oldName=columnName newName=columnNameCreate colType alterColumnConstraint? (
|
||||
KW_COMMENT comment=StringLiteral
|
||||
)? alterStatementChangeColPosition? restrictOrCascade?
|
||||
;
|
||||
|
||||
alterStatementSuffixUpdateStatsCol
|
||||
: KW_UPDATE KW_STATISTICS KW_FOR KW_COLUMN? colName=columnName KW_SET tableProperties (KW_COMMENT comment=StringLiteral)?
|
||||
: KW_UPDATE KW_STATISTICS KW_FOR KW_COLUMN? colName=columnName KW_SET tableProperties (
|
||||
KW_COMMENT comment=StringLiteral
|
||||
)?
|
||||
;
|
||||
|
||||
alterStatementSuffixUpdateStats
|
||||
@ -1511,7 +1475,9 @@ alterStatementSuffixRecoverPartitions
|
||||
;
|
||||
|
||||
alterStatementSuffixDropPartitions
|
||||
: KW_DROP ifExists? KW_PARTITION partitionSelectorSpec (COMMA KW_PARTITION partitionSelectorSpec)* dropPartitionsIgnoreClause? KW_PURGE? replicationClause?
|
||||
: KW_DROP ifExists? KW_PARTITION partitionSelectorSpec (
|
||||
COMMA KW_PARTITION partitionSelectorSpec
|
||||
)* dropPartitionsIgnoreClause? KW_PURGE? replicationClause?
|
||||
;
|
||||
|
||||
alterStatementSuffixProperties
|
||||
@ -1525,7 +1491,8 @@ alterViewSuffixProperties
|
||||
;
|
||||
|
||||
alterStatementSuffixSerdeProperties
|
||||
: KW_SET ( KW_SERDE serdeName=StringLiteral (KW_WITH KW_SERDEPROPERTIES tableProperties)?
|
||||
: KW_SET (
|
||||
KW_SERDE serdeName=StringLiteral (KW_WITH KW_SERDEPROPERTIES tableProperties)?
|
||||
| KW_SERDEPROPERTIES tableProperties
|
||||
)
|
||||
| KW_UNSET KW_SERDEPROPERTIES tableProperties
|
||||
@ -1578,7 +1545,9 @@ alterStatementSuffixRenamePart
|
||||
;
|
||||
|
||||
alterStatementSuffixStatsPart
|
||||
: KW_UPDATE KW_STATISTICS KW_FOR KW_COLUMN? colName=columnName KW_SET tableProperties (KW_COMMENT comment=StringLiteral)?
|
||||
: KW_UPDATE KW_STATISTICS KW_FOR KW_COLUMN? colName=columnName KW_SET tableProperties (
|
||||
KW_COMMENT comment=StringLiteral
|
||||
)?
|
||||
;
|
||||
|
||||
alterStatementSuffixMergeFiles
|
||||
@ -1598,7 +1567,9 @@ compactPool
|
||||
;
|
||||
|
||||
alterStatementSuffixCompact
|
||||
: KW_COMPACT compactType=StringLiteral blocking? tableImplBuckets? orderByClause? compactPool? (KW_WITH KW_OVERWRITE KW_TBLPROPERTIES tableProperties)?
|
||||
: KW_COMPACT compactType=StringLiteral blocking? tableImplBuckets? orderByClause? compactPool? (
|
||||
KW_WITH KW_OVERWRITE KW_TBLPROPERTIES tableProperties
|
||||
)?
|
||||
;
|
||||
|
||||
alterStatementSuffixSetOwner
|
||||
@ -1610,20 +1581,21 @@ alterStatementSuffixSetPartSpec
|
||||
;
|
||||
|
||||
alterStatementSuffixExecute
|
||||
: KW_EXECUTE ( KW_ROLLBACK LPAREN rollbackParam=(StringLiteral | Number)
|
||||
: KW_EXECUTE (
|
||||
KW_ROLLBACK LPAREN rollbackParam=(StringLiteral | Number)
|
||||
| KW_EXPIRE_SNAPSHOTS LPAREN expireParam=StringLiteral
|
||||
| KW_SET_CURRENT_SNAPSHOT LPAREN snapshotParam=Number
|
||||
) RPAREN
|
||||
;
|
||||
|
||||
alterIndexStatementSuffix
|
||||
: id_ KW_ON tableName
|
||||
partitionSpec?
|
||||
KW_REBUILD;
|
||||
: id_ KW_ON tableName partitionSpec? KW_REBUILD
|
||||
;
|
||||
|
||||
fileFormat
|
||||
: KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral KW_SERDE serdeCls=StringLiteral
|
||||
(KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral)?
|
||||
: KW_INPUTFORMAT inFmt=StringLiteral KW_OUTPUTFORMAT outFmt=StringLiteral KW_SERDE serdeCls=StringLiteral (
|
||||
KW_INPUTDRIVER inDriver=StringLiteral KW_OUTPUTDRIVER outDriver=StringLiteral
|
||||
)?
|
||||
| genericSpec=id_
|
||||
;
|
||||
|
||||
@ -1655,46 +1627,22 @@ likeTableOrFile
|
||||
Rules for parsing createtable
|
||||
*/
|
||||
createTableStatement
|
||||
: KW_CREATE temp=KW_TEMPORARY? trans=KW_TRANSACTIONAL? ext=KW_EXTERNAL? KW_TABLE ifNotExists? name=tableNameCreate
|
||||
( likeTableOrFile
|
||||
createTablePartitionSpec?
|
||||
tableRowFormat?
|
||||
tableFileFormat?
|
||||
tableLocation?
|
||||
tablePropertiesPrefixed?
|
||||
| (LPAREN columnNameTypeOrConstraintList RPAREN)?
|
||||
tableComment?
|
||||
createTablePartitionSpec?
|
||||
tableBuckets?
|
||||
tableSkewed?
|
||||
tableRowFormat?
|
||||
tableFileFormat?
|
||||
tableLocation?
|
||||
tablePropertiesPrefixed?
|
||||
(KW_AS selectStatementWithCTE)?
|
||||
: KW_CREATE temp=KW_TEMPORARY? trans=KW_TRANSACTIONAL? ext=KW_EXTERNAL? KW_TABLE ifNotExists? name=tableNameCreate (
|
||||
likeTableOrFile createTablePartitionSpec? tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed?
|
||||
| (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? createTablePartitionSpec? tableBuckets? tableSkewed? tableRowFormat?
|
||||
tableFileFormat? tableLocation? tablePropertiesPrefixed? (KW_AS selectStatementWithCTE)?
|
||||
)
|
||||
| KW_CREATE mgd=KW_MANAGED KW_TABLE ifNotExists? name=tableNameCreate
|
||||
( likeTableOrFile
|
||||
tableRowFormat?
|
||||
tableFileFormat?
|
||||
tableLocation?
|
||||
tablePropertiesPrefixed?
|
||||
| (LPAREN columnNameTypeOrConstraintList RPAREN)?
|
||||
tableComment?
|
||||
createTablePartitionSpec?
|
||||
tableBuckets?
|
||||
tableSkewed?
|
||||
tableRowFormat?
|
||||
tableFileFormat?
|
||||
tableLocation?
|
||||
tablePropertiesPrefixed?
|
||||
(KW_AS selectStatementWithCTE)?
|
||||
| KW_CREATE mgd=KW_MANAGED KW_TABLE ifNotExists? name=tableNameCreate (
|
||||
likeTableOrFile tableRowFormat? tableFileFormat? tableLocation? tablePropertiesPrefixed?
|
||||
| (LPAREN columnNameTypeOrConstraintList RPAREN)? tableComment? createTablePartitionSpec? tableBuckets? tableSkewed? tableRowFormat?
|
||||
tableFileFormat? tableLocation? tablePropertiesPrefixed? (KW_AS selectStatementWithCTE)?
|
||||
)
|
||||
;
|
||||
|
||||
createDataConnectorStatement
|
||||
: KW_CREATE KW_DATACONNECTOR ifNotExists? name=id_ dataConnectorType? dataConnectorUrl? dataConnectorComment?
|
||||
(KW_WITH KW_DCPROPERTIES dcprops=dcProperties)?
|
||||
: KW_CREATE KW_DATACONNECTOR ifNotExists? name=id_ dataConnectorType? dataConnectorUrl? dataConnectorComment? (
|
||||
KW_WITH KW_DCPROPERTIES dcprops=dcProperties
|
||||
)?
|
||||
;
|
||||
|
||||
dataConnectorComment
|
||||
@ -1756,7 +1704,9 @@ atomjoinSource
|
||||
;
|
||||
|
||||
joinSource
|
||||
: atomjoinSource (joinToken joinSourcePart (KW_ON expression | KW_USING columnParenthesesList)?)*
|
||||
: atomjoinSource (
|
||||
joinToken joinSourcePart (KW_ON expression | KW_USING columnParenthesesList)?
|
||||
)*
|
||||
;
|
||||
|
||||
joinSourcePart
|
||||
@ -1777,7 +1727,8 @@ uniqueJoinToken
|
||||
|
||||
joinToken
|
||||
: COMMA
|
||||
| ( KW_INNER
|
||||
| (
|
||||
KW_INNER
|
||||
| KW_CROSS
|
||||
| (KW_RIGHT | KW_FULL) KW_OUTER?
|
||||
| KW_LEFT (KW_SEMI | KW_ANTI | KW_OUTER)?
|
||||
@ -1786,7 +1737,8 @@ joinToken
|
||||
|
||||
lateralView
|
||||
: KW_LATERAL KW_VIEW KW_OUTER function_ tableAlias (KW_AS id_ (COMMA id_)*)?
|
||||
| COMMA? KW_LATERAL ( KW_VIEW function_ tableAlias (KW_AS id_ (COMMA id_)*)?
|
||||
| COMMA? KW_LATERAL (
|
||||
KW_VIEW function_ tableAlias (KW_AS id_ (COMMA id_)*)?
|
||||
| KW_TABLE LPAREN valuesClause RPAREN KW_AS? tableAlias (LPAREN id_ (COMMA id_)* RPAREN)?
|
||||
)
|
||||
;
|
||||
@ -1796,8 +1748,9 @@ tableAlias
|
||||
;
|
||||
|
||||
tableBucketSample
|
||||
: KW_TABLESAMPLE LPAREN KW_BUCKET numerator=Number KW_OUT KW_OF denominator=Number
|
||||
(KW_ON expr+=expression (COMMA expr+=expression)*)? RPAREN
|
||||
: KW_TABLESAMPLE LPAREN KW_BUCKET numerator=Number KW_OUT KW_OF denominator=Number (
|
||||
KW_ON expr+=expression (COMMA expr+=expression)*
|
||||
)? RPAREN
|
||||
;
|
||||
|
||||
splitSample
|
||||
@ -1810,11 +1763,14 @@ tableSample
|
||||
;
|
||||
|
||||
tableSource
|
||||
: tabname=tableOrView props=tableProperties? ts=tableSample? asOf=asOfClause? (KW_AS? alias=id_)?
|
||||
: tabname=tableOrView props=tableProperties? ts=tableSample? asOf=asOfClause? (
|
||||
KW_AS? alias=id_
|
||||
)?
|
||||
;
|
||||
|
||||
asOfClause
|
||||
: KW_FOR ( KW_SYSTEM_TIME KW_AS KW_OF asOfTime=expression
|
||||
: KW_FOR (
|
||||
KW_SYSTEM_TIME KW_AS KW_OF asOfTime=expression
|
||||
| KW_FOR KW_SYSTEM_VERSION KW_AS KW_OF asOfVersion=Number
|
||||
)
|
||||
;
|
||||
@ -1876,10 +1832,9 @@ partitionTableFunctionSource
|
||||
;
|
||||
|
||||
partitionedTableFunction
|
||||
: n=id_ LPAREN KW_ON
|
||||
ptfsrc=partitionTableFunctionSource spec=partitioningSpec?
|
||||
(Identifier LPAREN expression RPAREN (COMMA Identifier LPAREN expression RPAREN)*)?
|
||||
RPAREN alias=id_?
|
||||
: n=id_ LPAREN KW_ON ptfsrc=partitionTableFunctionSource spec=partitioningSpec? (
|
||||
Identifier LPAREN expression RPAREN (COMMA Identifier LPAREN expression RPAREN)*
|
||||
)? RPAREN alias=id_?
|
||||
;
|
||||
|
||||
/**
|
||||
@ -1954,11 +1909,9 @@ selectList
|
||||
;
|
||||
|
||||
selectTrfmClause
|
||||
: LPAREN selectExpressionList RPAREN
|
||||
rowFormat recordWriter
|
||||
KW_USING StringLiteral
|
||||
(KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList))?
|
||||
rowFormat recordReader
|
||||
: LPAREN selectExpressionList RPAREN rowFormat recordWriter KW_USING StringLiteral (
|
||||
KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList)
|
||||
)? rowFormat recordReader
|
||||
;
|
||||
|
||||
selectItem
|
||||
@ -1967,11 +1920,9 @@ selectItem
|
||||
;
|
||||
|
||||
trfmClause
|
||||
: (KW_MAP | KW_REDUCE) selectExpressionList
|
||||
rowFormat recordWriter
|
||||
KW_USING StringLiteral
|
||||
(KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList))?
|
||||
rowFormat recordReader
|
||||
: (KW_MAP | KW_REDUCE) selectExpressionList rowFormat recordWriter KW_USING StringLiteral (
|
||||
KW_AS (LPAREN (aliasList | columnNameTypeList) RPAREN | aliasList | columnNameTypeList)
|
||||
)? rowFormat recordReader
|
||||
;
|
||||
|
||||
selectExpression
|
||||
@ -2005,13 +1956,15 @@ window_frame
|
||||
;
|
||||
|
||||
window_range_expression
|
||||
: KW_ROWS ( window_frame_start_boundary
|
||||
: KW_ROWS (
|
||||
window_frame_start_boundary
|
||||
| KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary
|
||||
)
|
||||
;
|
||||
|
||||
window_value_expression
|
||||
: KW_RANGE ( window_frame_start_boundary
|
||||
: KW_RANGE (
|
||||
window_frame_start_boundary
|
||||
| KW_BETWEEN window_frame_boundary KW_AND window_frame_boundary
|
||||
)
|
||||
;
|
||||
@ -2046,15 +1999,14 @@ groupByEmpty
|
||||
|
||||
// standard rollup syntax
|
||||
rollupStandard
|
||||
: (rollup=KW_ROLLUP | cube=KW_CUBE)
|
||||
LPAREN expression (COMMA expression)* RPAREN
|
||||
: (rollup=KW_ROLLUP | cube=KW_CUBE) LPAREN expression (COMMA expression)* RPAREN
|
||||
;
|
||||
|
||||
// old hive rollup syntax
|
||||
rollupOldSyntax
|
||||
: expr=expressionsNotInParenthesis
|
||||
(rollup=KW_WITH KW_ROLLUP | cube=KW_WITH KW_CUBE)?
|
||||
(sets=KW_GROUPING KW_SETS LPAREN groupingSetExpression (COMMA groupingSetExpression)* RPAREN)?
|
||||
: expr=expressionsNotInParenthesis (rollup=KW_WITH KW_ROLLUP | cube=KW_WITH KW_CUBE)? (
|
||||
sets=KW_GROUPING KW_SETS LPAREN groupingSetExpression (COMMA groupingSetExpression)* RPAREN
|
||||
)?
|
||||
;
|
||||
|
||||
groupingSetExpression
|
||||
@ -2150,17 +2102,16 @@ sortByClause
|
||||
|
||||
// TRIM([LEADING|TRAILING|BOTH] trim_characters FROM str)
|
||||
trimFunction
|
||||
: KW_TRIM LPAREN (leading=KW_LEADING | trailing=KW_TRAILING | KW_BOTH)?
|
||||
trim_characters=selectExpression? KW_FROM str=selectExpression RPAREN
|
||||
: KW_TRIM LPAREN (leading=KW_LEADING | trailing=KW_TRAILING | KW_BOTH)? trim_characters=selectExpression? KW_FROM str=selectExpression RPAREN
|
||||
;
|
||||
|
||||
// fun(par1, par2, par3)
|
||||
function_
|
||||
: trimFunction
|
||||
| functionNameForInvoke
|
||||
LPAREN
|
||||
(star=STAR | dist=all_distinct? (selectExpression (COMMA selectExpression)*)?)
|
||||
(
|
||||
| functionNameForInvoke LPAREN (
|
||||
star=STAR
|
||||
| dist=all_distinct? (selectExpression (COMMA selectExpression)*)?
|
||||
) (
|
||||
// SELECT rank(3) WITHIN GROUP (<order by clause>)
|
||||
RPAREN within=KW_WITHIN KW_GROUP LPAREN ordBy=orderByClause RPAREN
|
||||
// No null treatment: SELECT first_value(b) OVER (<window spec>)
|
||||
@ -2201,27 +2152,15 @@ internalFunctionName // Hive Internal Function
|
||||
;
|
||||
|
||||
castExpression
|
||||
: KW_CAST
|
||||
LPAREN
|
||||
expression
|
||||
KW_AS
|
||||
toType=primitiveType
|
||||
(fmt=KW_FORMAT StringLiteral)?
|
||||
RPAREN
|
||||
: KW_CAST LPAREN expression KW_AS toType=primitiveType (fmt=KW_FORMAT StringLiteral)? RPAREN
|
||||
;
|
||||
|
||||
caseExpression
|
||||
: KW_CASE expression
|
||||
(KW_WHEN expression KW_THEN expression)+
|
||||
(KW_ELSE expression)?
|
||||
KW_END
|
||||
: KW_CASE expression (KW_WHEN expression KW_THEN expression)+ (KW_ELSE expression)? KW_END
|
||||
;
|
||||
|
||||
whenExpression
|
||||
: KW_CASE
|
||||
(KW_WHEN expression KW_THEN expression)+
|
||||
(KW_ELSE expression)?
|
||||
KW_END
|
||||
: KW_CASE (KW_WHEN expression KW_THEN expression)+ (KW_ELSE expression)? KW_END
|
||||
;
|
||||
|
||||
floorExpression
|
||||
@ -2363,7 +2302,9 @@ precedenceBitwiseXorOperator
|
||||
;
|
||||
|
||||
precedenceBitwiseXorExpression
|
||||
: precedenceUnaryPrefixExpression (precedenceBitwiseXorOperator precedenceUnaryPrefixExpression)*
|
||||
: precedenceUnaryPrefixExpression (
|
||||
precedenceBitwiseXorOperator precedenceUnaryPrefixExpression
|
||||
)*
|
||||
;
|
||||
|
||||
precedenceStarOperator
|
||||
@ -2392,7 +2333,6 @@ precedenceConcatenateOperator
|
||||
|
||||
precedenceConcatenateExpression
|
||||
: precedencePlusExpression (precedenceConcatenateOperator plus=precedencePlusExpression)*
|
||||
|
||||
;
|
||||
|
||||
precedenceAmpersandOperator
|
||||
@ -2483,8 +2423,8 @@ precedenceEqualOperator
|
||||
;
|
||||
|
||||
precedenceEqualExpression
|
||||
: precedenceSimilarExpression
|
||||
( equal+=precedenceEqualOperator p+=precedenceSimilarExpression
|
||||
: precedenceSimilarExpression (
|
||||
equal+=precedenceEqualOperator p+=precedenceSimilarExpression
|
||||
| dist+=precedenceDistinctOperator p+=precedenceSimilarExpression
|
||||
)*
|
||||
;
|
||||
@ -2988,8 +2928,10 @@ rpUnassignList
|
||||
;
|
||||
|
||||
createResourcePlanStatement
|
||||
: KW_CREATE KW_RESOURCE KW_PLAN ifNotExists?
|
||||
(name=id_ KW_LIKE likeName=id_ | name=id_ (KW_WITH rpAssignList)?)
|
||||
: KW_CREATE KW_RESOURCE KW_PLAN ifNotExists? (
|
||||
name=id_ KW_LIKE likeName=id_
|
||||
| name=id_ (KW_WITH rpAssignList)?
|
||||
)
|
||||
;
|
||||
|
||||
withReplace
|
||||
@ -3131,13 +3073,12 @@ triggerActionExpressionStandalone
|
||||
;
|
||||
|
||||
createTriggerStatement
|
||||
: KW_CREATE KW_TRIGGER rpName=id_ DOT triggerName=id_
|
||||
KW_WHEN triggerExpression KW_DO triggerActionExpression
|
||||
: KW_CREATE KW_TRIGGER rpName=id_ DOT triggerName=id_ KW_WHEN triggerExpression KW_DO triggerActionExpression
|
||||
;
|
||||
|
||||
alterTriggerStatement
|
||||
: KW_ALTER KW_TRIGGER rpName=id_ DOT triggerName=id_
|
||||
( KW_WHEN triggerExpression KW_DO triggerActionExpression
|
||||
: KW_ALTER KW_TRIGGER rpName=id_ DOT triggerName=id_ (
|
||||
KW_WHEN triggerExpression KW_DO triggerActionExpression
|
||||
| (KW_ADD KW_TO | KW_DROP KW_FROM) (KW_POOL poolName=poolPath | KW_UNMANAGED)
|
||||
)
|
||||
;
|
||||
@ -3147,7 +3088,8 @@ dropTriggerStatement
|
||||
;
|
||||
|
||||
poolAssign
|
||||
: ( KW_ALLOC_FRACTION EQUAL allocFraction=Number
|
||||
: (
|
||||
KW_ALLOC_FRACTION EQUAL allocFraction=Number
|
||||
| KW_QUERY_PARALLELISM EQUAL parallelism=Number
|
||||
| KW_SCHEDULING_POLICY EQUAL policy=StringLiteral
|
||||
| KW_PATH EQUAL path=poolPath
|
||||
@ -3159,13 +3101,12 @@ poolAssignList
|
||||
;
|
||||
|
||||
createPoolStatement
|
||||
: KW_CREATE KW_POOL rpName=id_ DOT poolPath
|
||||
KW_WITH poolAssignList
|
||||
: KW_CREATE KW_POOL rpName=id_ DOT poolPath KW_WITH poolAssignList
|
||||
;
|
||||
|
||||
alterPoolStatement
|
||||
: KW_ALTER KW_POOL rpName=id_ DOT poolPath
|
||||
( KW_SET poolAssignList
|
||||
: KW_ALTER KW_POOL rpName=id_ DOT poolPath (
|
||||
KW_SET poolAssignList
|
||||
| KW_UNSET KW_SCHEDULING_POLICY
|
||||
| (KW_ADD | KW_DROP) KW_TRIGGER triggerName=id_
|
||||
)
|
||||
@ -3176,20 +3117,19 @@ dropPoolStatement
|
||||
;
|
||||
|
||||
createMappingStatement
|
||||
: KW_CREATE mappingType=(KW_USER | KW_GROUP | KW_APPLICATION)
|
||||
KW_MAPPING name=StringLiteral
|
||||
KW_IN rpName=id_ (KW_TO path=poolPath | unmanaged)
|
||||
(KW_WITH KW_ORDER order=Number)?
|
||||
: KW_CREATE mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_ (
|
||||
KW_TO path=poolPath
|
||||
| unmanaged
|
||||
) (KW_WITH KW_ORDER order=Number)?
|
||||
;
|
||||
|
||||
alterMappingStatement
|
||||
: KW_ALTER mappingType=(KW_USER | KW_GROUP | KW_APPLICATION)
|
||||
KW_MAPPING name=StringLiteral
|
||||
KW_IN rpName=id_ (KW_TO path=poolPath | unmanaged)
|
||||
(KW_WITH KW_ORDER order=Number)?
|
||||
: KW_ALTER mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_ (
|
||||
KW_TO path=poolPath
|
||||
| unmanaged
|
||||
) (KW_WITH KW_ORDER order=Number)?
|
||||
;
|
||||
|
||||
dropMappingStatement
|
||||
: KW_DROP mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING
|
||||
name=StringLiteral KW_IN rpName=id_
|
||||
: KW_DROP mappingType=(KW_USER | KW_GROUP | KW_APPLICATION) KW_MAPPING name=StringLiteral KW_IN rpName=id_
|
||||
;
|
@ -19,9 +19,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing
|
||||
// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true
|
||||
|
||||
lexer grammar ImpalaSqlLexer;
|
||||
|
||||
options { caseInsensitive = true; }
|
||||
options {
|
||||
caseInsensitive=true;
|
||||
}
|
||||
|
||||
KW_ADD : 'ADD';
|
||||
KW_ALL : 'ALL';
|
||||
@ -286,84 +293,43 @@ QUESTION : '?';
|
||||
|
||||
RIGHT_ARROW: '->';
|
||||
|
||||
STRING
|
||||
: '\'' ( ~'\'' | '\'\'' )* '\''
|
||||
| '"' ( ~'"' | '""' )* '"'
|
||||
;
|
||||
STRING: '\'' ( ~'\'' | '\'\'')* '\'' | '"' ( ~'"' | '""')* '"';
|
||||
|
||||
UNICODE_STRING
|
||||
: 'U&\'' ( ~'\'' | '\'\'' )* '\''
|
||||
;
|
||||
UNICODE_STRING: 'U&\'' ( ~'\'' | '\'\'')* '\'';
|
||||
|
||||
// Note: we allow any character inside the binary literal and validate
|
||||
// its a correct literal when the AST is being constructed. This
|
||||
// allows us to provide more meaningful error messages to the user
|
||||
BINARY_LITERAL
|
||||
: 'X\'' (~'\'')* '\''
|
||||
;
|
||||
BINARY_LITERAL: 'X\'' (~'\'')* '\'';
|
||||
|
||||
INTEGER_VALUE
|
||||
: DIGIT+
|
||||
;
|
||||
INTEGER_VALUE: DIGIT+;
|
||||
|
||||
DECIMAL_VALUE
|
||||
: DIGIT+ '.' DIGIT*
|
||||
| '.' DIGIT+
|
||||
;
|
||||
DECIMAL_VALUE: DIGIT+ '.' DIGIT* | '.' DIGIT+;
|
||||
|
||||
DOUBLE_VALUE
|
||||
: DIGIT+ ('.' DIGIT*)? EXPONENT
|
||||
| '.' DIGIT+ EXPONENT
|
||||
;
|
||||
DOUBLE_VALUE: DIGIT+ ('.' DIGIT*)? EXPONENT | '.' DIGIT+ EXPONENT;
|
||||
|
||||
IDENTIFIER
|
||||
: (LETTER | '_') (LETTER | DIGIT | '_' | '@' | ':')*
|
||||
;
|
||||
IDENTIFIER: (LETTER | '_') (LETTER | DIGIT | '_' | '@' | ':')*;
|
||||
|
||||
DIGIT_IDENTIFIER
|
||||
: DIGIT (LETTER | DIGIT | '_' | '@' | ':')+
|
||||
;
|
||||
DIGIT_IDENTIFIER: DIGIT (LETTER | DIGIT | '_' | '@' | ':')+;
|
||||
|
||||
QUOTED_IDENTIFIER
|
||||
: '"' ( ~'"' | '""' )* '"'
|
||||
;
|
||||
QUOTED_IDENTIFIER: '"' ( ~'"' | '""')* '"';
|
||||
|
||||
BACKQUOTED_IDENTIFIER
|
||||
: '`' ( ~'`' | '``' )* '`'
|
||||
;
|
||||
BACKQUOTED_IDENTIFIER: '`' ( ~'`' | '``')* '`';
|
||||
|
||||
TIME_WITH_TIME_ZONE
|
||||
: 'TIME' WS 'WITH' WS 'TIME' WS 'ZONE'
|
||||
;
|
||||
TIME_WITH_TIME_ZONE: 'TIME' WS 'WITH' WS 'TIME' WS 'ZONE';
|
||||
|
||||
TIMESTAMP_WITH_TIME_ZONE
|
||||
: 'TIMESTAMP' WS 'WITH' WS 'TIME' WS 'ZONE'
|
||||
;
|
||||
TIMESTAMP_WITH_TIME_ZONE: 'TIMESTAMP' WS 'WITH' WS 'TIME' WS 'ZONE';
|
||||
|
||||
DOUBLE_PRECISION
|
||||
: 'DOUBLE' WS 'PRECISION'
|
||||
;
|
||||
DOUBLE_PRECISION: 'DOUBLE' WS 'PRECISION';
|
||||
|
||||
fragment EXPONENT
|
||||
: 'E' [+-]? DIGIT+
|
||||
;
|
||||
fragment EXPONENT: 'E' [+-]? DIGIT+;
|
||||
|
||||
fragment DIGIT
|
||||
: [0-9]
|
||||
;
|
||||
fragment DIGIT: [0-9];
|
||||
|
||||
fragment LETTER
|
||||
: [A-Z]
|
||||
;
|
||||
fragment LETTER: [A-Z];
|
||||
|
||||
SIMPLE_COMMENT
|
||||
: '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN)
|
||||
;
|
||||
SIMPLE_COMMENT: '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN);
|
||||
|
||||
BRACKETED_COMMENT
|
||||
: '/*' .*? '*/' -> channel(HIDDEN)
|
||||
;
|
||||
BRACKETED_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
|
||||
|
||||
WS
|
||||
: [ \r\n\t]+ -> channel(HIDDEN)
|
||||
;
|
||||
WS: [ \r\n\t]+ -> channel(HIDDEN);
|
@ -12,6 +12,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true
|
||||
|
||||
parser grammar ImpalaSqlParser;
|
||||
|
||||
options
|
||||
@ -19,7 +23,9 @@ options
|
||||
tokenVocab=ImpalaSqlLexer;
|
||||
}
|
||||
|
||||
program: singleStatement* EOF;
|
||||
program
|
||||
: singleStatement* EOF
|
||||
;
|
||||
|
||||
singleStatement
|
||||
: sqlStatement SEMICOLON?
|
||||
@ -50,7 +56,9 @@ sqlStatement
|
||||
| refreshStatement
|
||||
;
|
||||
|
||||
useStatement: KW_USE databaseNamePath;
|
||||
useStatement
|
||||
: KW_USE databaseNamePath
|
||||
;
|
||||
|
||||
createStatement
|
||||
: createSchema
|
||||
@ -64,59 +72,56 @@ createStatement
|
||||
;
|
||||
|
||||
createTableSelect
|
||||
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate
|
||||
(LPAREN columnDefinition (COMMA columnDefinition)* (COMMA constraintSpecification)? RPAREN)?
|
||||
(KW_PARTITIONED KW_BY (partitionedBy | createColumnAliases) )?
|
||||
createCommonItem
|
||||
(KW_AS queryStatement)?
|
||||
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate (
|
||||
LPAREN columnDefinition (COMMA columnDefinition)* (COMMA constraintSpecification)? RPAREN
|
||||
)? (KW_PARTITIONED KW_BY (partitionedBy | createColumnAliases))? createCommonItem (
|
||||
KW_AS queryStatement
|
||||
)?
|
||||
;
|
||||
|
||||
createTableLike
|
||||
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate
|
||||
KW_LIKE (tableNamePath | KW_PARQUET parquet=stringLiteral)
|
||||
(KW_PARTITIONED KW_BY partitionedBy)?
|
||||
createCommonItem
|
||||
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate KW_LIKE (
|
||||
tableNamePath
|
||||
| KW_PARQUET parquet=stringLiteral
|
||||
) (KW_PARTITIONED KW_BY partitionedBy)? createCommonItem
|
||||
;
|
||||
|
||||
createKuduTableAsSelect
|
||||
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate
|
||||
(LPAREN kuduTableElement (COMMA kuduTableElement)* (COMMA KW_PRIMARY KW_KEY columnAliases)? RPAREN)?
|
||||
(KW_PRIMARY KW_KEY columnAliases?)?
|
||||
(KW_PARTITION KW_BY kuduPartitionClause)?
|
||||
(KW_COMMENT stringLiteral)?
|
||||
KW_STORED KW_AS KW_KUDU
|
||||
(KW_TBLPROPERTIES tblProp=properties)?
|
||||
(KW_AS queryStatement)?
|
||||
: KW_CREATE KW_EXTERNAL? KW_TABLE ifNotExists? tableNameCreate (
|
||||
LPAREN kuduTableElement (COMMA kuduTableElement)* (COMMA KW_PRIMARY KW_KEY columnAliases)? RPAREN
|
||||
)? (KW_PRIMARY KW_KEY columnAliases?)? (KW_PARTITION KW_BY kuduPartitionClause)? (
|
||||
KW_COMMENT stringLiteral
|
||||
)? KW_STORED KW_AS KW_KUDU (KW_TBLPROPERTIES tblProp=properties)? (KW_AS queryStatement)?
|
||||
;
|
||||
|
||||
createView: KW_CREATE KW_VIEW ifNotExists? viewNameCreate viewColumns? (KW_COMMENT stringLiteral)? (KW_TBLPROPERTIES tblProp=properties)? KW_AS queryStatement;
|
||||
|
||||
createSchema:
|
||||
KW_CREATE (KW_SCHEMA | KW_DATABASE) ifNotExists? databaseNameCreate
|
||||
(KW_COMMENT comment=stringLiteral)? (KW_LOCATION location=stringLiteral)?
|
||||
createView
|
||||
: KW_CREATE KW_VIEW ifNotExists? viewNameCreate viewColumns? (KW_COMMENT stringLiteral)? (
|
||||
KW_TBLPROPERTIES tblProp=properties
|
||||
)? KW_AS queryStatement
|
||||
;
|
||||
|
||||
createRole: KW_CREATE KW_ROLE name=identifier;
|
||||
createSchema
|
||||
: KW_CREATE (KW_SCHEMA | KW_DATABASE) ifNotExists? databaseNameCreate (
|
||||
KW_COMMENT comment=stringLiteral
|
||||
)? (KW_LOCATION location=stringLiteral)?
|
||||
;
|
||||
|
||||
createRole
|
||||
: KW_CREATE KW_ROLE name=identifier
|
||||
;
|
||||
|
||||
createAggregateFunction
|
||||
: KW_CREATE KW_AGGREGATE? KW_FUNCTION ifNotExists? functionNameCreate (LPAREN(type (COMMA type)*)? RPAREN)?
|
||||
KW_RETURNS type
|
||||
(KW_INTERMEDIATE type)?
|
||||
KW_LOCATION STRING
|
||||
(KW_INIT_FN EQ STRING)?
|
||||
KW_UPDATE_FN EQ STRING
|
||||
KW_MERGE_FN EQ STRING
|
||||
(KW_PREPARE_FN EQ STRING)?
|
||||
(KW_CLOSEFN EQ STRING)?
|
||||
(KW_SERIALIZE_FN EQ STRING)?
|
||||
(KW_FINALIZE_FN EQ STRING)?
|
||||
: KW_CREATE KW_AGGREGATE? KW_FUNCTION ifNotExists? functionNameCreate (
|
||||
LPAREN (type (COMMA type)*)? RPAREN
|
||||
)? KW_RETURNS type (KW_INTERMEDIATE type)? KW_LOCATION STRING (KW_INIT_FN EQ STRING)? KW_UPDATE_FN EQ STRING KW_MERGE_FN EQ STRING (
|
||||
KW_PREPARE_FN EQ STRING
|
||||
)? (KW_CLOSEFN EQ STRING)? (KW_SERIALIZE_FN EQ STRING)? (KW_FINALIZE_FN EQ STRING)?
|
||||
;
|
||||
|
||||
createFunction
|
||||
: KW_CREATE KW_FUNCTION ifNotExists? functionNameCreate (LPAREN(type (COMMA type)*)? RPAREN)?
|
||||
(KW_RETURNS type)?
|
||||
KW_LOCATION STRING
|
||||
KW_SYMBOL EQ symbol=stringLiteral
|
||||
: KW_CREATE KW_FUNCTION ifNotExists? functionNameCreate (LPAREN (type (COMMA type)*)? RPAREN)? (
|
||||
KW_RETURNS type
|
||||
)? KW_LOCATION STRING KW_SYMBOL EQ symbol=stringLiteral
|
||||
;
|
||||
|
||||
alterStatement
|
||||
@ -140,54 +145,122 @@ alterStatement
|
||||
| alterTableOwner
|
||||
;
|
||||
|
||||
alterDatabase: KW_ALTER KW_DATABASE databaseNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) identifier;
|
||||
alterDatabase
|
||||
: KW_ALTER KW_DATABASE databaseNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) identifier
|
||||
;
|
||||
|
||||
alterStatsKey: KW_ALTER KW_TABLE tableNamePath KW_SET KW_COLUMN KW_STATS columnNamePath LPAREN statsKey EQ stringLiteral (COMMA statsKey EQ stringLiteral)? RPAREN;
|
||||
alterStatsKey
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_SET KW_COLUMN KW_STATS columnNamePath LPAREN statsKey EQ stringLiteral (
|
||||
COMMA statsKey EQ stringLiteral
|
||||
)? RPAREN
|
||||
;
|
||||
|
||||
alterPartitionCache: KW_ALTER KW_TABLE tableNamePath (KW_PARTITION expression)? KW_SET ((KW_CACHED KW_IN stringLiteral (KW_WITH KW_REPLICATION EQ number)?) | KW_UNCACHED);
|
||||
alterPartitionCache
|
||||
: KW_ALTER KW_TABLE tableNamePath (KW_PARTITION expression)? KW_SET (
|
||||
(KW_CACHED KW_IN stringLiteral (KW_WITH KW_REPLICATION EQ number)?)
|
||||
| KW_UNCACHED
|
||||
)
|
||||
;
|
||||
|
||||
changeColumnDefine: KW_ALTER KW_TABLE tableNamePath KW_CHANGE KW_COLUMN columnSpecWithKudu;
|
||||
changeColumnDefine
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_CHANGE KW_COLUMN columnSpecWithKudu
|
||||
;
|
||||
|
||||
alterDropSingleColumn: KW_ALTER KW_TABLE tableNamePath KW_DROP (KW_COLUMN)? columnNamePath;
|
||||
alterDropSingleColumn
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_DROP (KW_COLUMN)? columnNamePath
|
||||
;
|
||||
|
||||
alterTableOwner: KW_ALTER KW_TABLE tableNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) identifier;
|
||||
alterTableOwner
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) identifier
|
||||
;
|
||||
|
||||
replaceOrAddColumns: KW_ALTER KW_TABLE tableNamePath (KW_REPLACE | KW_ADD ifNotExists?) KW_COLUMNS LPAREN columnSpecWithKudu (COMMA columnSpecWithKudu)*? RPAREN;
|
||||
replaceOrAddColumns
|
||||
: KW_ALTER KW_TABLE tableNamePath (KW_REPLACE | KW_ADD ifNotExists?) KW_COLUMNS LPAREN columnSpecWithKudu (
|
||||
COMMA columnSpecWithKudu
|
||||
)*? RPAREN
|
||||
;
|
||||
|
||||
addSingleColumn: KW_ALTER KW_TABLE tableNamePath KW_ADD KW_COLUMN ifNotExists? createColumnSpecWithKudu;
|
||||
addSingleColumn
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_ADD KW_COLUMN ifNotExists? createColumnSpecWithKudu
|
||||
;
|
||||
|
||||
alterTableNonKuduOrKuduOnly: KW_ALTER KW_TABLE tableNamePath KW_ALTER (KW_COLUMN)? columnNamePath (KW_SET (kuduStorageAttr | KW_COMMENT stringLiteral ) | KW_DROP KW_DEFAULT);
|
||||
alterTableNonKuduOrKuduOnly
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_ALTER (KW_COLUMN)? columnNamePath (
|
||||
KW_SET (kuduStorageAttr | KW_COMMENT stringLiteral)
|
||||
| KW_DROP KW_DEFAULT
|
||||
)
|
||||
;
|
||||
|
||||
addPartitionByRangeOrValue: KW_ALTER KW_TABLE tableNamePath KW_ADD ifNotExists? (KW_PARTITION expression (KW_LOCATION stringLiteral)? (cacheSpec)? | KW_RANGE KW_PARTITION kuduPartitionSpec);
|
||||
addPartitionByRangeOrValue
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_ADD ifNotExists? (
|
||||
KW_PARTITION expression (KW_LOCATION stringLiteral)? (cacheSpec)?
|
||||
| KW_RANGE KW_PARTITION kuduPartitionSpec
|
||||
)
|
||||
;
|
||||
|
||||
alterFormat: KW_ALTER KW_TABLE tableNamePath (KW_PARTITION expression)? KW_SET ((KW_FILEFORMAT fileFormat) | (KW_ROW KW_FORMAT rowFormat) | (KW_LOCATION stringLiteral) | (KW_TBLPROPERTIES tblProp=properties) | (KW_SERDEPROPERTIES tblProp=properties));
|
||||
alterFormat
|
||||
: KW_ALTER KW_TABLE tableNamePath (KW_PARTITION expression)? KW_SET (
|
||||
(KW_FILEFORMAT fileFormat)
|
||||
| (KW_ROW KW_FORMAT rowFormat)
|
||||
| (KW_LOCATION stringLiteral)
|
||||
| (KW_TBLPROPERTIES tblProp=properties)
|
||||
| (KW_SERDEPROPERTIES tblProp=properties)
|
||||
)
|
||||
;
|
||||
|
||||
recoverPartitions: KW_ALTER KW_TABLE tableNamePath KW_RECOVER KW_PARTITIONS;
|
||||
recoverPartitions
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_RECOVER KW_PARTITIONS
|
||||
;
|
||||
|
||||
dropPartitionByRangeOrValue: KW_ALTER KW_TABLE tableNamePath KW_DROP ifExists? (KW_PARTITION expression KW_PURGE? | KW_RANGE KW_PARTITION kuduPartitionSpec);
|
||||
dropPartitionByRangeOrValue
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_DROP ifExists? (
|
||||
KW_PARTITION expression KW_PURGE?
|
||||
| KW_RANGE KW_PARTITION kuduPartitionSpec
|
||||
)
|
||||
;
|
||||
|
||||
alterView: KW_ALTER KW_VIEW viewNamePath viewColumns? KW_AS queryStatement;
|
||||
alterView
|
||||
: KW_ALTER KW_VIEW viewNamePath viewColumns? KW_AS queryStatement
|
||||
;
|
||||
|
||||
renameView: KW_ALTER KW_VIEW viewNamePath KW_RENAME KW_TO viewNamePath;
|
||||
renameView
|
||||
: KW_ALTER KW_VIEW viewNamePath KW_RENAME KW_TO viewNamePath
|
||||
;
|
||||
|
||||
alterViewOwner: KW_ALTER KW_VIEW viewNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) qualifiedName;
|
||||
alterViewOwner
|
||||
: KW_ALTER KW_VIEW viewNamePath KW_SET KW_OWNER (KW_USER | KW_ROLE) qualifiedName
|
||||
;
|
||||
|
||||
renameTable: KW_ALTER KW_TABLE tableNamePath KW_RENAME KW_TO tableNamePath;
|
||||
renameTable
|
||||
: KW_ALTER KW_TABLE tableNamePath KW_RENAME KW_TO tableNamePath
|
||||
;
|
||||
|
||||
alterUnSetOrSetViewTblproperties: KW_ALTER KW_VIEW viewNamePath (KW_UNSET | KW_SET) KW_TBLPROPERTIES tblProp=properties;
|
||||
alterUnSetOrSetViewTblproperties
|
||||
: KW_ALTER KW_VIEW viewNamePath (KW_UNSET | KW_SET) KW_TBLPROPERTIES tblProp=properties
|
||||
;
|
||||
|
||||
truncateTableStatement: KW_TRUNCATE KW_TABLE? ifExists? tableNamePath;
|
||||
truncateTableStatement
|
||||
: KW_TRUNCATE KW_TABLE? ifExists? tableNamePath
|
||||
;
|
||||
|
||||
describeStatement: KW_DESCRIBE KW_DATABASE? (KW_FORMATTED | KW_EXTENDED)? qualifiedName;
|
||||
describeStatement
|
||||
: KW_DESCRIBE KW_DATABASE? (KW_FORMATTED | KW_EXTENDED)? qualifiedName
|
||||
;
|
||||
|
||||
computeStatement
|
||||
: computeStats
|
||||
| computeIncrementalStats
|
||||
;
|
||||
|
||||
computeStats: KW_COMPUTE KW_STATS tableNamePath (columnAliases)? (KW_TABLESAMPLE KW_SYSTEM LPAREN number RPAREN (KW_REPEATABLE LPAREN number RPAREN)?)?;
|
||||
computeStats
|
||||
: KW_COMPUTE KW_STATS tableNamePath (columnAliases)? (
|
||||
KW_TABLESAMPLE KW_SYSTEM LPAREN number RPAREN (KW_REPEATABLE LPAREN number RPAREN)?
|
||||
)?
|
||||
;
|
||||
|
||||
computeIncrementalStats: KW_COMPUTE KW_INCREMENTAL KW_STATS tableNamePath (KW_PARTITION expression)?;
|
||||
computeIncrementalStats
|
||||
: KW_COMPUTE KW_INCREMENTAL KW_STATS tableNamePath (KW_PARTITION expression)?
|
||||
;
|
||||
|
||||
dropStatement
|
||||
: dropRole
|
||||
@ -198,41 +271,65 @@ dropStatement
|
||||
| dropSchema
|
||||
;
|
||||
|
||||
dropSchema: KW_DROP (KW_SCHEMA | KW_DATABASE) (ifExists)? databaseNamePath (KW_CASCADE | KW_RESTRICT)?;
|
||||
dropSchema
|
||||
: KW_DROP (KW_SCHEMA | KW_DATABASE) (ifExists)? databaseNamePath (KW_CASCADE | KW_RESTRICT)?
|
||||
;
|
||||
|
||||
dropView: KW_DROP KW_VIEW ifExists? viewNamePath;
|
||||
dropView
|
||||
: KW_DROP KW_VIEW ifExists? viewNamePath
|
||||
;
|
||||
|
||||
dropTable: KW_DROP KW_TABLE ifExists? tableNamePath KW_PURGE?;
|
||||
dropTable
|
||||
: KW_DROP KW_TABLE ifExists? tableNamePath KW_PURGE?
|
||||
;
|
||||
|
||||
dropIncrementalStats: KW_DROP KW_INCREMENTAL? KW_STATS tableNamePath (KW_PARTITION expression)?;
|
||||
dropIncrementalStats
|
||||
: KW_DROP KW_INCREMENTAL? KW_STATS tableNamePath (KW_PARTITION expression)?
|
||||
;
|
||||
|
||||
dropFunction: KW_DROP KW_AGGREGATE? KW_FUNCTION ifExists? functionNamePath (LPAREN(type (COMMA type)*)? RPAREN)?;
|
||||
dropFunction
|
||||
: KW_DROP KW_AGGREGATE? KW_FUNCTION ifExists? functionNamePath (
|
||||
LPAREN (type (COMMA type)*)? RPAREN
|
||||
)?
|
||||
;
|
||||
|
||||
dropRole: KW_DROP KW_ROLE name=identifier;
|
||||
dropRole
|
||||
: KW_DROP KW_ROLE name=identifier
|
||||
;
|
||||
|
||||
grantStatement
|
||||
: grantRole
|
||||
| grant
|
||||
;
|
||||
|
||||
grantRole: KW_GRANT KW_ROLE identifier KW_TO KW_GROUP identifier;
|
||||
grantRole
|
||||
: KW_GRANT KW_ROLE identifier KW_TO KW_GROUP identifier
|
||||
;
|
||||
|
||||
grant: KW_GRANT privilege KW_ON objectType (qualifiedName)? KW_TO grantee=principal;
|
||||
grant
|
||||
: KW_GRANT privilege KW_ON objectType (qualifiedName)? KW_TO grantee=principal
|
||||
;
|
||||
|
||||
revokeStatement
|
||||
: revokeRole
|
||||
| revoke
|
||||
;
|
||||
|
||||
revokeRole: KW_REVOKE KW_ROLE identifier KW_FROM KW_GROUP identifier;
|
||||
revokeRole
|
||||
: KW_REVOKE KW_ROLE identifier KW_FROM KW_GROUP identifier
|
||||
;
|
||||
|
||||
revoke: KW_REVOKE (KW_GRANT KW_OPTION KW_FOR)? privilege KW_ON objectType (qualifiedName)? KW_FROM (grantee=principal | (KW_ROLE)? identifier);
|
||||
revoke
|
||||
: KW_REVOKE (KW_GRANT KW_OPTION KW_FOR)? privilege KW_ON objectType (qualifiedName)? KW_FROM (
|
||||
grantee=principal
|
||||
| (KW_ROLE)? identifier
|
||||
)
|
||||
;
|
||||
|
||||
insertStatement
|
||||
: with? KW_INSERT (KW_INTO | KW_OVERWRITE) KW_TABLE? tableNamePath
|
||||
columnAliases?
|
||||
(KW_PARTITION LPAREN expression(COMMA expression)*RPAREN)?
|
||||
queryStatement
|
||||
: with? KW_INSERT (KW_INTO | KW_OVERWRITE) KW_TABLE? tableNamePath columnAliases? (
|
||||
KW_PARTITION LPAREN expression (COMMA expression)* RPAREN
|
||||
)? queryStatement
|
||||
;
|
||||
|
||||
deleteStatement
|
||||
@ -240,13 +337,25 @@ deleteStatement
|
||||
| deleteTableRef
|
||||
;
|
||||
|
||||
delete: KW_DELETE KW_FROM? tableNamePath (KW_WHERE booleanExpression)?;
|
||||
delete
|
||||
: KW_DELETE KW_FROM? tableNamePath (KW_WHERE booleanExpression)?
|
||||
;
|
||||
|
||||
deleteTableRef: KW_DELETE tableNamePath (KW_AS? identifier)? KW_FROM (relation (COMMA relation)*)? (KW_WHERE booleanExpression)?;
|
||||
deleteTableRef
|
||||
: KW_DELETE tableNamePath (KW_AS? identifier)? KW_FROM (relation (COMMA relation)*)? (
|
||||
KW_WHERE booleanExpression
|
||||
)?
|
||||
;
|
||||
|
||||
updateStatement: KW_UPDATE tableNamePath KW_SET assignmentList (KW_FROM relation (COMMA relation)*)? (KW_WHERE booleanExpression)?;
|
||||
updateStatement
|
||||
: KW_UPDATE tableNamePath KW_SET assignmentList (KW_FROM relation (COMMA relation)*)? (
|
||||
KW_WHERE booleanExpression
|
||||
)?
|
||||
;
|
||||
|
||||
upsertStatement: KW_UPSERT KW_INTO KW_TABLE? tableNamePath columnAliases? queryStatement;
|
||||
upsertStatement
|
||||
: KW_UPSERT KW_INTO KW_TABLE? tableNamePath columnAliases? queryStatement
|
||||
;
|
||||
|
||||
showStatement
|
||||
: showRoles
|
||||
@ -264,59 +373,80 @@ showStatement
|
||||
;
|
||||
|
||||
showSchemas
|
||||
: KW_SHOW (KW_SCHEMAS | KW_DATABASES)
|
||||
(KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*)?
|
||||
: KW_SHOW (KW_SCHEMAS | KW_DATABASES) (
|
||||
KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*
|
||||
)?
|
||||
;
|
||||
|
||||
showTables
|
||||
:
|
||||
KW_SHOW KW_TABLES (KW_IN tableNamePath)?
|
||||
(KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*)?
|
||||
: KW_SHOW KW_TABLES (KW_IN tableNamePath)? (
|
||||
KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*
|
||||
)?
|
||||
;
|
||||
|
||||
showFunctions
|
||||
:
|
||||
KW_SHOW (KW_AGGREGATE | KW_ANALYTIC)? KW_FUNCTIONS (KW_IN databaseNamePath)?
|
||||
(KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*)?
|
||||
: KW_SHOW (KW_AGGREGATE | KW_ANALYTIC)? KW_FUNCTIONS (KW_IN databaseNamePath)? (
|
||||
KW_LIKE? pattern=stringLiteral (BITWISEOR stringLiteral)*
|
||||
)?
|
||||
;
|
||||
|
||||
showCreateTable: KW_SHOW KW_CREATE KW_TABLE tableNamePath;
|
||||
showCreateTable
|
||||
: KW_SHOW KW_CREATE KW_TABLE tableNamePath
|
||||
;
|
||||
|
||||
showCreateView: KW_SHOW KW_CREATE KW_VIEW viewNamePath;
|
||||
showCreateView
|
||||
: KW_SHOW KW_CREATE KW_VIEW viewNamePath
|
||||
;
|
||||
|
||||
showTableStats: KW_SHOW KW_TABLE KW_STATS tableNamePath;
|
||||
showTableStats
|
||||
: KW_SHOW KW_TABLE KW_STATS tableNamePath
|
||||
;
|
||||
|
||||
showColumnStats: KW_SHOW KW_COLUMN KW_STATS tableNamePath;
|
||||
showColumnStats
|
||||
: KW_SHOW KW_COLUMN KW_STATS tableNamePath
|
||||
;
|
||||
|
||||
showPartitions: KW_SHOW (KW_RANGE)? KW_PARTITIONS tableNamePath;
|
||||
showPartitions
|
||||
: KW_SHOW (KW_RANGE)? KW_PARTITIONS tableNamePath
|
||||
;
|
||||
|
||||
showFiles: KW_SHOW KW_FILES KW_IN tableNamePath (KW_PARTITION LPAREN expression (COMMA expression)?RPAREN)?;
|
||||
showFiles
|
||||
: KW_SHOW KW_FILES KW_IN tableNamePath (
|
||||
KW_PARTITION LPAREN expression (COMMA expression)? RPAREN
|
||||
)?
|
||||
;
|
||||
|
||||
showRoles: KW_SHOW (KW_CURRENT)? KW_ROLES;
|
||||
showRoles
|
||||
: KW_SHOW (KW_CURRENT)? KW_ROLES
|
||||
;
|
||||
|
||||
showRoleGrant: KW_SHOW KW_ROLE KW_GRANT KW_GROUP identifier;
|
||||
showRoleGrant
|
||||
: KW_SHOW KW_ROLE KW_GRANT KW_GROUP identifier
|
||||
;
|
||||
|
||||
showGrants
|
||||
: showDatabaseGrant
|
||||
| showTableGrant
|
||||
| showColumnGrant
|
||||
| KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier
|
||||
(KW_ON (KW_SERVER | KW_URI) (qualifiedName)?)?
|
||||
| KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (
|
||||
KW_ON (KW_SERVER | KW_URI) (qualifiedName)?
|
||||
)?
|
||||
;
|
||||
|
||||
showDatabaseGrant:
|
||||
KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier
|
||||
(KW_ON KW_DATABASE (databaseNamePath)?)?
|
||||
showDatabaseGrant
|
||||
: KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (
|
||||
KW_ON KW_DATABASE (databaseNamePath)?
|
||||
)?
|
||||
;
|
||||
|
||||
showTableGrant:
|
||||
KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier
|
||||
(KW_ON KW_TABLE (tableNamePath)?)?
|
||||
showTableGrant
|
||||
: KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (KW_ON KW_TABLE (tableNamePath)?)?
|
||||
;
|
||||
|
||||
showColumnGrant:
|
||||
KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier
|
||||
(KW_ON KW_COLUMN (columnNamePath)?)?
|
||||
showColumnGrant
|
||||
: KW_SHOW KW_GRANT (KW_USER | KW_ROLE | KW_GROUP) identifier (
|
||||
KW_ON KW_COLUMN (columnNamePath)?
|
||||
)?
|
||||
;
|
||||
|
||||
addCommentStatement
|
||||
@ -325,32 +455,57 @@ addCommentStatement
|
||||
| addColumnComments
|
||||
;
|
||||
|
||||
addDatabaseComments: KW_COMMENT KW_ON KW_DATABASE databaseNamePath KW_IS (stringLiteral | KW_NULL);
|
||||
|
||||
addTableComments: KW_COMMENT KW_ON KW_TABLE tableNamePath KW_IS (stringLiteral | KW_NULL);
|
||||
|
||||
addColumnComments: KW_COMMENT KW_ON KW_COLUMN columnNamePath KW_IS (stringLiteral | KW_NULL);
|
||||
|
||||
explainStatement: KW_EXPLAIN sqlStatement;
|
||||
|
||||
setStatement: KW_SET (KW_ALL | identifier EQ expression)?;
|
||||
|
||||
shutdownStatement: COLON KW_SHUTDOWN LPAREN (stringLiteral? | stringLiteral (COMMA expression)? | expression) RPAREN;
|
||||
|
||||
invalidateMetaStatement: KW_INVALIDATE KW_METADATA tableNamePath;
|
||||
|
||||
loadDataStatement:
|
||||
KW_LOAD KW_DATA KW_INPATH STRING (KW_OVERWRITE)? KW_INTO KW_TABLE tableNamePath
|
||||
(KW_PARTITION LPAREN expression (COMMA expression)?RPAREN)?
|
||||
addDatabaseComments
|
||||
: KW_COMMENT KW_ON KW_DATABASE databaseNamePath KW_IS (stringLiteral | KW_NULL)
|
||||
;
|
||||
|
||||
refreshStatement: refreshMeta | refreshAuth | refreshFunction;
|
||||
addTableComments
|
||||
: KW_COMMENT KW_ON KW_TABLE tableNamePath KW_IS (stringLiteral | KW_NULL)
|
||||
;
|
||||
|
||||
refreshMeta: KW_REFRESH tableNamePath (KW_PARTITION LPAREN expression (COMMA expression)*? RPAREN)?;
|
||||
addColumnComments
|
||||
: KW_COMMENT KW_ON KW_COLUMN columnNamePath KW_IS (stringLiteral | KW_NULL)
|
||||
;
|
||||
|
||||
refreshAuth: KW_REFRESH KW_AUTHORIZATION;
|
||||
explainStatement
|
||||
: KW_EXPLAIN sqlStatement
|
||||
;
|
||||
|
||||
refreshFunction: KW_REFRESH KW_FUNCTIONS functionNamePath;
|
||||
setStatement
|
||||
: KW_SET (KW_ALL | identifier EQ expression)?
|
||||
;
|
||||
|
||||
shutdownStatement
|
||||
: COLON KW_SHUTDOWN LPAREN (stringLiteral? | stringLiteral (COMMA expression)? | expression) RPAREN
|
||||
;
|
||||
|
||||
invalidateMetaStatement
|
||||
: KW_INVALIDATE KW_METADATA tableNamePath
|
||||
;
|
||||
|
||||
loadDataStatement
|
||||
: KW_LOAD KW_DATA KW_INPATH STRING (KW_OVERWRITE)? KW_INTO KW_TABLE tableNamePath (
|
||||
KW_PARTITION LPAREN expression (COMMA expression)? RPAREN
|
||||
)?
|
||||
;
|
||||
|
||||
refreshStatement
|
||||
: refreshMeta
|
||||
| refreshAuth
|
||||
| refreshFunction
|
||||
;
|
||||
|
||||
refreshMeta
|
||||
: KW_REFRESH tableNamePath (KW_PARTITION LPAREN expression (COMMA expression)*? RPAREN)?
|
||||
;
|
||||
|
||||
refreshAuth
|
||||
: KW_REFRESH KW_AUTHORIZATION
|
||||
;
|
||||
|
||||
refreshFunction
|
||||
: KW_REFRESH KW_FUNCTIONS functionNamePath
|
||||
;
|
||||
|
||||
ifExists
|
||||
: KW_IF KW_EXISTS
|
||||
@ -360,38 +515,61 @@ ifNotExists
|
||||
: KW_IF KW_NOT KW_EXISTS
|
||||
;
|
||||
|
||||
tableNameCreate: qualifiedName;
|
||||
tableNameCreate
|
||||
: qualifiedName
|
||||
;
|
||||
|
||||
databaseNameCreate: qualifiedName;
|
||||
databaseNameCreate
|
||||
: qualifiedName
|
||||
;
|
||||
|
||||
viewNameCreate: qualifiedName;
|
||||
viewNameCreate
|
||||
: qualifiedName
|
||||
;
|
||||
|
||||
functionNameCreate: qualifiedName;
|
||||
functionNameCreate
|
||||
: qualifiedName
|
||||
;
|
||||
|
||||
columnNamePathCreate: qualifiedName;
|
||||
columnNamePathCreate
|
||||
: qualifiedName
|
||||
;
|
||||
|
||||
databaseNamePath: qualifiedName;
|
||||
databaseNamePath
|
||||
: qualifiedName
|
||||
;
|
||||
|
||||
tableNamePath: identifier (DOT identifier)*;
|
||||
tableNamePath
|
||||
: identifier (DOT identifier)*
|
||||
;
|
||||
|
||||
viewNamePath: identifier (DOT identifier)*;
|
||||
viewNamePath
|
||||
: identifier (DOT identifier)*
|
||||
;
|
||||
|
||||
functionNamePath: reservedKeywordsUsedAsFuncName | qualifiedName;
|
||||
functionNamePath
|
||||
: reservedKeywordsUsedAsFuncName
|
||||
| qualifiedName
|
||||
;
|
||||
|
||||
columnNamePath: qualifiedName;
|
||||
columnNamePath
|
||||
: qualifiedName
|
||||
;
|
||||
|
||||
tableOrViewPath: tableNamePath | viewNamePath;
|
||||
tableOrViewPath
|
||||
: tableNamePath
|
||||
| viewNamePath
|
||||
;
|
||||
|
||||
createCommonItem
|
||||
:
|
||||
(KW_SORT KW_BY columnAliases)?
|
||||
(KW_COMMENT comment=stringLiteral)?
|
||||
(KW_ROW KW_FORMAT rowFormat)?
|
||||
(KW_WITH KW_SERDEPROPERTIES serdProp=properties)?
|
||||
(KW_STORED KW_AS fileFormat)?
|
||||
(KW_LOCATION location=stringLiteral)?
|
||||
(KW_CACHED KW_IN cacheName=qualifiedName (KW_WITH KW_REPLICATION EQ INTEGER_VALUE )? | KW_UNCACHED)?
|
||||
(KW_TBLPROPERTIES tblProp=properties)?
|
||||
: (KW_SORT KW_BY columnAliases)? (KW_COMMENT comment=stringLiteral)? (
|
||||
KW_ROW KW_FORMAT rowFormat
|
||||
)? (KW_WITH KW_SERDEPROPERTIES serdProp=properties)? (KW_STORED KW_AS fileFormat)? (
|
||||
KW_LOCATION location=stringLiteral
|
||||
)? (
|
||||
KW_CACHED KW_IN cacheName=qualifiedName (KW_WITH KW_REPLICATION EQ INTEGER_VALUE)?
|
||||
| KW_UNCACHED
|
||||
)? (KW_TBLPROPERTIES tblProp=properties)?
|
||||
;
|
||||
|
||||
assignmentList
|
||||
@ -403,7 +581,9 @@ assignmentItem
|
||||
;
|
||||
|
||||
viewColumns
|
||||
: LPAREN columnNamePath (KW_COMMENT stringLiteral)? (COMMA identifier (KW_COMMENT stringLiteral)?)* RPAREN
|
||||
: LPAREN columnNamePath (KW_COMMENT stringLiteral)? (
|
||||
COMMA identifier (KW_COMMENT stringLiteral)?
|
||||
)* RPAREN
|
||||
;
|
||||
|
||||
queryStatement
|
||||
@ -415,13 +595,18 @@ with
|
||||
;
|
||||
|
||||
constraintSpecification
|
||||
:
|
||||
KW_PRIMARY KW_KEY columnAliases (KW_DISABLE)? (KW_NOVALIDATE | COMMA KW_NOVALIDATE)? (KW_RELY | COMMA KW_RELY)? ((COMMA foreignKeySpecification | foreignKeySpecification) (COMMA foreignKeySpecification)*?)?
|
||||
: KW_PRIMARY KW_KEY columnAliases (KW_DISABLE)? (KW_NOVALIDATE | COMMA KW_NOVALIDATE)? (
|
||||
KW_RELY
|
||||
| COMMA KW_RELY
|
||||
)? (
|
||||
(COMMA foreignKeySpecification | foreignKeySpecification) (COMMA foreignKeySpecification)*?
|
||||
)?
|
||||
;
|
||||
|
||||
foreignKeySpecification
|
||||
:
|
||||
KW_FOREIGN KW_KEY columnAliases KW_REFERENCES tableNamePath columnAliases (KW_DISABLE)? (KW_NOVALIDATE)? (KW_RELY)?
|
||||
: KW_FOREIGN KW_KEY columnAliases KW_REFERENCES tableNamePath columnAliases (KW_DISABLE)? (
|
||||
KW_NOVALIDATE
|
||||
)? (KW_RELY)?
|
||||
;
|
||||
|
||||
columnDefinition
|
||||
@ -433,7 +618,9 @@ kuduTableElement
|
||||
;
|
||||
|
||||
kuduColumnDefinition
|
||||
: columnNamePathCreate type (kuduAttributes kuduAttributes*?)? (KW_COMMENT stringLiteral)? (KW_PRIMARY KW_KEY )?
|
||||
: columnNamePathCreate type (kuduAttributes kuduAttributes*?)? (KW_COMMENT stringLiteral)? (
|
||||
KW_PRIMARY KW_KEY
|
||||
)?
|
||||
;
|
||||
|
||||
columnSpecWithKudu
|
||||
@ -472,7 +659,8 @@ fileFormat
|
||||
;
|
||||
|
||||
kuduPartitionClause
|
||||
: (hashClause (COMMA hashClause)*? (COMMA rangeClause)?) | rangeClause
|
||||
: (hashClause (COMMA hashClause)*? (COMMA rangeClause)?)
|
||||
| rangeClause
|
||||
;
|
||||
|
||||
hashClause
|
||||
@ -480,11 +668,14 @@ hashClause
|
||||
;
|
||||
|
||||
rangeClause
|
||||
: KW_RANGE columnAliases? LPAREN (KW_PARTITION kuduPartitionSpec (COMMA KW_PARTITION kuduPartitionSpec)*?) RPAREN
|
||||
: KW_RANGE columnAliases? LPAREN (
|
||||
KW_PARTITION kuduPartitionSpec (COMMA KW_PARTITION kuduPartitionSpec)*?
|
||||
) RPAREN
|
||||
;
|
||||
|
||||
kuduPartitionSpec
|
||||
: KW_VALUE partitionCol expression | (expression rangeOperator)? KW_VALUES (rangeOperator expression)?
|
||||
: KW_VALUE partitionCol expression
|
||||
| (expression rangeOperator)? KW_VALUES (rangeOperator expression)?
|
||||
;
|
||||
|
||||
cacheSpec
|
||||
@ -528,17 +719,19 @@ sortedBy
|
||||
;
|
||||
|
||||
rowFormat
|
||||
: KW_DELIMITED (KW_FIELDS KW_TERMINATED KW_BY stringLiteral (KW_ESCAPED KW_BY stringLiteral)?)? (KW_LINES KW_TERMINATED KW_BY stringLiteral)?
|
||||
: KW_DELIMITED (KW_FIELDS KW_TERMINATED KW_BY stringLiteral (KW_ESCAPED KW_BY stringLiteral)?)? (
|
||||
KW_LINES KW_TERMINATED KW_BY stringLiteral
|
||||
)?
|
||||
;
|
||||
|
||||
property
|
||||
: identifier (EQ expression)?
|
||||
;
|
||||
|
||||
queryNoWith:
|
||||
queryTerm
|
||||
(KW_ORDER KW_BY sortItem (COMMA sortItem)*)?
|
||||
(KW_LIMIT rows=expression (KW_OFFSET offset=INTEGER_VALUE )?)?
|
||||
queryNoWith
|
||||
: queryTerm (KW_ORDER KW_BY sortItem (COMMA sortItem)*)? (
|
||||
KW_LIMIT rows=expression (KW_OFFSET offset=INTEGER_VALUE)?
|
||||
)?
|
||||
;
|
||||
|
||||
queryTerm
|
||||
@ -559,11 +752,11 @@ sortItem
|
||||
;
|
||||
|
||||
querySpecification
|
||||
: KW_SELECT setQuantifier? (KW_STRAIGHT_JOIN)? selectItem (COMMA selectItem)*
|
||||
(KW_FROM relation (COMMA relation)*)?
|
||||
(KW_WHERE where=booleanExpression)?
|
||||
(KW_GROUP KW_BY groupBy)?
|
||||
(KW_HAVING having=booleanExpression)?
|
||||
: KW_SELECT setQuantifier? (KW_STRAIGHT_JOIN)? selectItem (COMMA selectItem)* (
|
||||
KW_FROM relation (COMMA relation)*
|
||||
)? (KW_WHERE where=booleanExpression)? (KW_GROUP KW_BY groupBy)? (
|
||||
KW_HAVING having=booleanExpression
|
||||
)?
|
||||
;
|
||||
|
||||
groupBy
|
||||
@ -595,8 +788,8 @@ selectItem
|
||||
;
|
||||
|
||||
relation
|
||||
: left=relation
|
||||
( KW_CROSS KW_JOIN right=sampledRelation
|
||||
: left=relation (
|
||||
KW_CROSS KW_JOIN right=sampledRelation
|
||||
| joinType KW_JOIN rightRelation=relation joinCriteria
|
||||
) # joinRelation
|
||||
| sampledRelation # relationDefault
|
||||
@ -622,7 +815,9 @@ joinCriteria
|
||||
|
||||
sampledRelation
|
||||
: aliasedRelation (
|
||||
KW_TABLESAMPLE sampleType LPAREN percentage=expression RPAREN (KW_REPEATABLE LPAREN seed=expression RPAREN)?
|
||||
KW_TABLESAMPLE sampleType LPAREN percentage=expression RPAREN (
|
||||
KW_REPEATABLE LPAREN seed=expression RPAREN
|
||||
)?
|
||||
)?
|
||||
;
|
||||
|
||||
@ -650,13 +845,22 @@ relationPrimary
|
||||
| parenthesizedRelation
|
||||
;
|
||||
|
||||
subQueryRelation: LPAREN queryStatement RPAREN;
|
||||
subQueryRelation
|
||||
: LPAREN queryStatement RPAREN
|
||||
;
|
||||
|
||||
unnest: KW_UNNEST LPAREN expression (COMMA expression)* RPAREN (KW_WITH KW_ORDINALITY)?;
|
||||
unnest
|
||||
: KW_UNNEST LPAREN expression (COMMA expression)* RPAREN (KW_WITH KW_ORDINALITY)?
|
||||
;
|
||||
|
||||
parenthesizedRelation: LPAREN relation RPAREN;
|
||||
parenthesizedRelation
|
||||
: LPAREN relation RPAREN
|
||||
;
|
||||
|
||||
columnItem: columnNamePath | expression;
|
||||
columnItem
|
||||
: columnNamePath
|
||||
| expression
|
||||
;
|
||||
|
||||
expression
|
||||
: booleanExpression
|
||||
@ -675,7 +879,9 @@ predicate[ParserRuleContext value]
|
||||
| KW_NOT? KW_BETWEEN lower=valueExpression KW_AND upper=valueExpression # between
|
||||
| KW_NOT? KW_IN LPAREN expression (COMMA expression)* RPAREN # inList
|
||||
| KW_NOT? KW_IN subQueryRelation # inSubquery
|
||||
| KW_NOT? (KW_LIKE | KW_ILIKE | KW_RLIKE) pattern=valueExpression (KW_ESCAPE escape=valueExpression)? #like
|
||||
| KW_NOT? (KW_LIKE | KW_ILIKE | KW_RLIKE) pattern=valueExpression (
|
||||
KW_ESCAPE escape=valueExpression
|
||||
)? # like
|
||||
| (KW_REGEXP | KW_IREGEXP) pattern=valueExpression # REGEXP
|
||||
| KW_IS KW_NOT? (KW_NULL | KW_UNKNOWN | KW_TRUE | KW_FALSE) # nullOrUnKnownOrBooleanPredicate
|
||||
| KW_IS KW_NOT? KW_DISTINCT KW_FROM right=valueExpression # distinctFrom
|
||||
@ -703,8 +909,9 @@ primaryExpression
|
||||
| LPAREN expression (KW_AS type)? (COMMA expression (KW_AS type)?)*? RPAREN # rowConstructor
|
||||
| KW_ROW LPAREN expression (COMMA expression)* RPAREN # rowConstructor
|
||||
| functionNamePath LPAREN ASTERISK RPAREN filter? over? # functionCall
|
||||
| functionNamePath LPAREN (setQuantifier? expression (COMMA expression)*)?
|
||||
(KW_ORDER KW_BY sortItem (COMMA sortItem)*)? RPAREN filter? over? #functionCall
|
||||
| functionNamePath LPAREN (setQuantifier? expression (COMMA expression)*)? (
|
||||
KW_ORDER KW_BY sortItem (COMMA sortItem)*
|
||||
)? RPAREN filter? over? # functionCall
|
||||
| identifier RIGHT_ARROW expression # lambda
|
||||
| LPAREN (identifier (COMMA identifier)*)? RPAREN RIGHT_ARROW expression # lambda
|
||||
| LPAREN queryStatement RPAREN # subqueryExpression
|
||||
@ -737,15 +944,23 @@ stringLiteral
|
||||
;
|
||||
|
||||
comparisonOperator
|
||||
: EQ | NEQ | LT | LTE | GT | GTE
|
||||
: EQ
|
||||
| NEQ
|
||||
| LT
|
||||
| LTE
|
||||
| GT
|
||||
| GTE
|
||||
;
|
||||
|
||||
comparisonQuantifier
|
||||
: KW_ALL | KW_SOME | KW_ANY
|
||||
: KW_ALL
|
||||
| KW_SOME
|
||||
| KW_ANY
|
||||
;
|
||||
|
||||
booleanValue
|
||||
: KW_TRUE | KW_FALSE
|
||||
: KW_TRUE
|
||||
| KW_FALSE
|
||||
;
|
||||
|
||||
interval
|
||||
@ -756,11 +971,25 @@ interval
|
||||
;
|
||||
|
||||
intervalField
|
||||
: KW_YEAR | KW_YEARS | KW_MONTH | KW_MONTHS | KW_DAY | KW_DAYS | KW_HOUR | KW_HOURS | KW_MINUTE | KW_MINUTES | KW_SECOND | KW_SECONDS
|
||||
: KW_YEAR
|
||||
| KW_YEARS
|
||||
| KW_MONTH
|
||||
| KW_MONTHS
|
||||
| KW_DAY
|
||||
| KW_DAYS
|
||||
| KW_HOUR
|
||||
| KW_HOURS
|
||||
| KW_MINUTE
|
||||
| KW_MINUTES
|
||||
| KW_SECOND
|
||||
| KW_SECONDS
|
||||
;
|
||||
|
||||
normalForm
|
||||
: KW_NFD | KW_NFC | KW_NFKD | KW_NFKC
|
||||
: KW_NFD
|
||||
| KW_NFC
|
||||
| KW_NFKD
|
||||
| KW_NFKC
|
||||
;
|
||||
|
||||
type
|
||||
@ -772,7 +1001,8 @@ type
|
||||
;
|
||||
|
||||
typeParameter
|
||||
: INTEGER_VALUE | type
|
||||
: INTEGER_VALUE
|
||||
| type
|
||||
;
|
||||
|
||||
baseType
|
||||
@ -791,11 +1021,9 @@ filter
|
||||
;
|
||||
|
||||
over
|
||||
: KW_OVER LPAREN
|
||||
(KW_PARTITION KW_BY partition+=expression (COMMA partition+=expression)*)?
|
||||
(KW_ORDER KW_BY sortItem (COMMA sortItem)*)?
|
||||
windowFrame?
|
||||
RPAREN
|
||||
: KW_OVER LPAREN (KW_PARTITION KW_BY partition+=expression (COMMA partition+=expression)*)? (
|
||||
KW_ORDER KW_BY sortItem (COMMA sortItem)*
|
||||
)? windowFrame? RPAREN
|
||||
;
|
||||
|
||||
/**
|
||||
@ -826,11 +1054,22 @@ pathSpecification
|
||||
;
|
||||
|
||||
privilege
|
||||
: KW_ALL | KW_ALTER | KW_DROP | KW_CREATE | KW_INSERT | KW_REFRESH | KW_SELECT (LPAREN columnName=identifier RPAREN)?
|
||||
: KW_ALL
|
||||
| KW_ALTER
|
||||
| KW_DROP
|
||||
| KW_CREATE
|
||||
| KW_INSERT
|
||||
| KW_REFRESH
|
||||
| KW_SELECT (LPAREN columnName=identifier RPAREN)?
|
||||
;
|
||||
|
||||
objectType
|
||||
: KW_SERVER | KW_URI | KW_DATABASE | KW_TABLE
|
||||
: KW_SERVER
|
||||
| KW_URI
|
||||
| KW_DATABASE
|
||||
| KW_TABLE
|
||||
;
|
||||
|
||||
qualifiedName
|
||||
: identifier (DOT identifier)*
|
||||
;
|
||||
|
@ -25,21 +25,26 @@ THE SOFTWARE.
|
||||
|
||||
// https://github.com/antlr/grammars-v4/blob/master/sql/mysql/Positive-Technologies/MySqlLexer.g4
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing
|
||||
// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true
|
||||
|
||||
lexer grammar MySqlLexer;
|
||||
|
||||
options { caseInsensitive = true; }
|
||||
|
||||
channels { MYSQLCOMMENT, ERRORCHANNEL }
|
||||
options {
|
||||
caseInsensitive=true;
|
||||
}
|
||||
|
||||
channels {
|
||||
MYSQLCOMMENT,
|
||||
ERRORCHANNEL
|
||||
}
|
||||
|
||||
SPACE : [ \t\r\n]+ -> channel(HIDDEN);
|
||||
SPEC_MYSQL_COMMENT : '/*!' .+? '*/' -> channel(MYSQLCOMMENT);
|
||||
COMMENT_INPUT : '/*' .*? '*/' -> channel(HIDDEN);
|
||||
LINE_COMMENT: (
|
||||
('--' [ \t]* | '#') ~[\r\n]* ('\r'? '\n' | EOF)
|
||||
| '--' ('\r'? '\n' | EOF)
|
||||
) -> channel(HIDDEN);
|
||||
|
||||
LINE_COMMENT: (('--' [ \t]* | '#') ~[\r\n]* ('\r'? '\n' | EOF) | '--' ('\r'? '\n' | EOF)) -> channel(HIDDEN);
|
||||
|
||||
// Keywords
|
||||
// Common Keywords
|
||||
@ -285,7 +290,6 @@ KW_ENUM: 'ENUM';
|
||||
KW_VARYING : 'VARYING';
|
||||
KW_SERIAL : 'SERIAL';
|
||||
|
||||
|
||||
// Interval type Keywords
|
||||
|
||||
KW_YEAR_MONTH : 'YEAR_MONTH';
|
||||
@ -755,7 +759,6 @@ KW_X509: 'X509';
|
||||
KW_XA : 'XA';
|
||||
KW_XML : 'XML';
|
||||
|
||||
|
||||
// Interval type Keywords
|
||||
|
||||
KW_QUARTER : 'QUARTER';
|
||||
@ -767,7 +770,6 @@ KW_WEEK: 'WEEK';
|
||||
KW_SECOND : 'SECOND';
|
||||
KW_MICROSECOND : 'MICROSECOND';
|
||||
|
||||
|
||||
// PRIVILEGES
|
||||
|
||||
KW_ADMIN : 'ADMIN';
|
||||
@ -823,7 +825,6 @@ KW_TABLE_ENCRYPTION_ADMIN: 'TABLE_ENCRYPTION_ADMIN';
|
||||
KW_VERSION_TOKEN_ADMIN : 'VERSION_TOKEN_ADMIN';
|
||||
KW_XA_RECOVER_ADMIN : 'XA_RECOVER_ADMIN';
|
||||
|
||||
|
||||
// Charsets
|
||||
|
||||
KW_ARMSCII8 : 'ARMSCII8';
|
||||
@ -868,7 +869,6 @@ KW_UTF8: 'UTF8';
|
||||
KW_UTF8MB3 : 'UTF8MB3';
|
||||
KW_UTF8MB4 : 'UTF8MB4';
|
||||
|
||||
|
||||
// DB Engines
|
||||
|
||||
KW_ARCHIVE : 'ARCHIVE';
|
||||
@ -884,7 +884,6 @@ KW_NDBCLUSTER: 'NDBCLUSTER';
|
||||
KW_PERFORMANCE_SCHEMA : 'PERFORMANCE_SCHEMA';
|
||||
KW_TOKUDB : 'TOKUDB';
|
||||
|
||||
|
||||
// Transaction Levels
|
||||
|
||||
KW_REPEATABLE : 'REPEATABLE';
|
||||
@ -892,7 +891,6 @@ KW_COMMITTED: 'COMMITTED';
|
||||
KW_UNCOMMITTED : 'UNCOMMITTED';
|
||||
KW_SERIALIZABLE : 'SERIALIZABLE';
|
||||
|
||||
|
||||
// Spatial data types
|
||||
|
||||
KW_GEOMETRYCOLLECTION : 'GEOMETRYCOLLECTION';
|
||||
@ -905,7 +903,6 @@ KW_MULTIPOLYGON: 'MULTIPOLYGON';
|
||||
KW_POINT : 'POINT';
|
||||
KW_POLYGON : 'POLYGON';
|
||||
|
||||
|
||||
// Common function names
|
||||
|
||||
KW_CATALOG_NAME : 'CATALOG_NAME';
|
||||
@ -928,7 +925,6 @@ KW_TP_CONNECTION_ADMIN: 'TP_CONNECTION_ADMIN';
|
||||
KW_TYPE : 'TYPE';
|
||||
KW_WEIGHT_STRING : 'WEIGHT_STRING';
|
||||
|
||||
|
||||
// Operators
|
||||
// Operators. Assigns
|
||||
|
||||
@ -942,7 +938,6 @@ AND_ASSIGN: '&=';
|
||||
XOR_ASSIGN : '^=';
|
||||
OR_ASSIGN : '|=';
|
||||
|
||||
|
||||
// Operators. Arithmetics
|
||||
|
||||
STAR : '*';
|
||||
@ -953,7 +948,6 @@ MINUS: '-';
|
||||
DIV : 'DIV';
|
||||
MOD : 'MOD';
|
||||
|
||||
|
||||
// Operators. Comparation
|
||||
|
||||
EQUAL_SYMBOL : '=';
|
||||
@ -961,7 +955,6 @@ GREATER_SYMBOL: '>';
|
||||
LESS_SYMBOL : '<';
|
||||
EXCLAMATION_SYMBOL : '!';
|
||||
|
||||
|
||||
// Operators. Bit
|
||||
|
||||
BIT_NOT_OP : '~';
|
||||
@ -969,7 +962,6 @@ BIT_OR_OP: '|';
|
||||
BIT_AND_OP : '&';
|
||||
BIT_XOR_OP : '^';
|
||||
|
||||
|
||||
// Constructors symbols
|
||||
|
||||
DOT : '.';
|
||||
@ -987,27 +979,22 @@ DOUBLE_QUOTE_SYMB: '"';
|
||||
REVERSE_QUOTE_SYMB : '`';
|
||||
COLON_SYMB : ':';
|
||||
|
||||
fragment QUOTE_SYMB
|
||||
: SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB | REVERSE_QUOTE_SYMB
|
||||
;
|
||||
|
||||
fragment QUOTE_SYMB: SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB | REVERSE_QUOTE_SYMB;
|
||||
|
||||
// Charsets
|
||||
CHARSET_REVERSE_QOUTE_STRING: '`' CHARSET_NAME '`';
|
||||
|
||||
|
||||
// File's sizes
|
||||
FILESIZE_LITERAL: DEC_DIGIT+ ('K' | 'M' | 'G' | 'T');
|
||||
|
||||
|
||||
// Literal Primitives
|
||||
START_NATIONAL_STRING_LITERAL : 'N' SQUOTA_STRING;
|
||||
STRING_LITERAL : DQUOTA_STRING | SQUOTA_STRING | BQUOTA_STRING;
|
||||
DECIMAL_LITERAL : DEC_DIGIT+;
|
||||
HEXADECIMAL_LITERAL: 'X' '\'' (HEX_DIGIT HEX_DIGIT)+ '\''
|
||||
| '0X' HEX_DIGIT+;
|
||||
HEXADECIMAL_LITERAL : 'X' '\'' (HEX_DIGIT HEX_DIGIT)+ '\'' | '0X' HEX_DIGIT+;
|
||||
|
||||
REAL_LITERAL: DEC_DIGIT* '.' DEC_DIGIT+
|
||||
REAL_LITERAL:
|
||||
DEC_DIGIT* '.' DEC_DIGIT+
|
||||
| DEC_DIGIT+ '.' EXPONENT_NUM_PART
|
||||
| DEC_DIGIT* '.' (DEC_DIGIT+ EXPONENT_NUM_PART)
|
||||
| DEC_DIGIT+ EXPONENT_NUM_PART;
|
||||
@ -1015,38 +1002,60 @@ NULL_SPEC_LITERAL: '\\' 'N';
|
||||
BIT_STRING : BIT_STRING_L;
|
||||
STRING_CHARSET_NAME : '_' CHARSET_NAME;
|
||||
|
||||
|
||||
// Identifiers
|
||||
|
||||
ID: ID_LITERAL;
|
||||
// DOUBLE_QUOTE_ID: '"' ~'"'+ '"';
|
||||
REVERSE_QUOTE_ID : BQUOTA_STRING;
|
||||
HOST_IP_ADDRESS : (AT_SIGN IP_ADDRESS);
|
||||
LOCAL_ID: AT_SIGN
|
||||
(
|
||||
STRING_LITERAL | [A-Z0-9._$\u0080-\uFFFF]+
|
||||
);
|
||||
GLOBAL_ID: AT_SIGN AT_SIGN
|
||||
(
|
||||
[A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING
|
||||
);
|
||||
PERSIST_ID: AT_SIGN AT_SIGN
|
||||
(
|
||||
[A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING
|
||||
);
|
||||
|
||||
LOCAL_ID : AT_SIGN ( STRING_LITERAL | [A-Z0-9._$\u0080-\uFFFF]+);
|
||||
GLOBAL_ID : AT_SIGN AT_SIGN ( [A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING);
|
||||
PERSIST_ID : AT_SIGN AT_SIGN ( [A-Z0-9._$\u0080-\uFFFF]+ | BQUOTA_STRING);
|
||||
|
||||
// Fragments for Literal primitives
|
||||
|
||||
fragment CHARSET_NAME: KW_ARMSCII8 | KW_ASCII | KW_BIG5 | KW_BINARY | KW_CP1250
|
||||
| KW_CP1251 | KW_CP1256 | KW_CP1257 | KW_CP850
|
||||
| KW_CP852 | KW_CP866 | KW_CP932 | KW_DEC8 | KW_EUCJPMS
|
||||
| KW_EUCKR | KW_GB2312 | KW_GBK | KW_GEOSTD8 | KW_GREEK
|
||||
| KW_HEBREW | KW_HP8 | KW_KEYBCS2 | KW_KOI8R | KW_KOI8U
|
||||
| KW_LATIN1 | KW_LATIN2 | KW_LATIN5 | KW_LATIN7
|
||||
| KW_MACCE | KW_MACROMAN | KW_SJIS | KW_SWE7 | KW_TIS620
|
||||
| KW_UCS2 | KW_UJIS | KW_UTF16 | KW_UTF16LE | KW_UTF32
|
||||
| KW_UTF8 | KW_UTF8MB3 | KW_UTF8MB4;
|
||||
fragment CHARSET_NAME:
|
||||
KW_ARMSCII8
|
||||
| KW_ASCII
|
||||
| KW_BIG5
|
||||
| KW_BINARY
|
||||
| KW_CP1250
|
||||
| KW_CP1251
|
||||
| KW_CP1256
|
||||
| KW_CP1257
|
||||
| KW_CP850
|
||||
| KW_CP852
|
||||
| KW_CP866
|
||||
| KW_CP932
|
||||
| KW_DEC8
|
||||
| KW_EUCJPMS
|
||||
| KW_EUCKR
|
||||
| KW_GB2312
|
||||
| KW_GBK
|
||||
| KW_GEOSTD8
|
||||
| KW_GREEK
|
||||
| KW_HEBREW
|
||||
| KW_HP8
|
||||
| KW_KEYBCS2
|
||||
| KW_KOI8R
|
||||
| KW_KOI8U
|
||||
| KW_LATIN1
|
||||
| KW_LATIN2
|
||||
| KW_LATIN5
|
||||
| KW_LATIN7
|
||||
| KW_MACCE
|
||||
| KW_MACROMAN
|
||||
| KW_SJIS
|
||||
| KW_SWE7
|
||||
| KW_TIS620
|
||||
| KW_UCS2
|
||||
| KW_UJIS
|
||||
| KW_UTF16
|
||||
| KW_UTF16LE
|
||||
| KW_UTF32
|
||||
| KW_UTF8
|
||||
| KW_UTF8MB3
|
||||
| KW_UTF8MB4;
|
||||
|
||||
fragment EXPONENT_NUM_PART : 'E' [-+]? DEC_DIGIT+;
|
||||
fragment ID_LITERAL : [A-Z_$0-9\u0080-\uFFFF]*? [A-Z_$\u0080-\uFFFF]+? [A-Z_$0-9\u0080-\uFFFF]*;
|
||||
@ -1058,7 +1067,6 @@ fragment DEC_DIGIT: [0-9];
|
||||
fragment BIT_STRING_L : 'B' '\'' [01]+ '\'';
|
||||
fragment IP_ADDRESS : [0-9]+ '.' [0-9.]+ | [0-9A-F]* ':' [0-9A-F]* ':' [0-9A-F:]+;
|
||||
|
||||
|
||||
// Last tokens must generate Errors
|
||||
|
||||
ERROR_RECONGNIGION: . -> channel(ERRORCHANNEL);
|
File diff suppressed because it is too large
Load Diff
@ -24,12 +24,16 @@
|
||||
* written authorization from Tunnel Vision Laboratories, LLC.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* This file is an adaptation of antlr's sql/postgresql/PostgreSQLLexer.g4 grammar.
|
||||
* Reference: https://github.com/antlr/grammars-v4/blob/master/sql/postgresql/PostgreSQLLexer.g4
|
||||
*/
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing
|
||||
// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true
|
||||
|
||||
lexer grammar PostgreSQLLexer;
|
||||
|
||||
/**
|
||||
@ -81,25 +85,12 @@ PARAM: '$' ([0-9])+;
|
||||
// this rule does not allow + or - at the end of a multi-character operator
|
||||
|
||||
Operator: (
|
||||
(
|
||||
OperatorCharacter
|
||||
| ('+' | '-')+ (
|
||||
OperatorCharacter
|
||||
| '/' ?
|
||||
)
|
||||
| '/'
|
||||
)+
|
||||
(OperatorCharacter | ('+' | '-')+ ( OperatorCharacter | '/'?) | '/')+
|
||||
| // special handling for the single-character operators + and -
|
||||
[+-]
|
||||
)
|
||||
//TODO somehow rewrite this part without using Actions
|
||||
;
|
||||
); //TODO somehow rewrite this part without using Actions
|
||||
|
||||
OperatorEndingWithPlusMinus: (
|
||||
OperatorCharacterNotAllowPlusMinusAtEnd
|
||||
| '-'
|
||||
| '/'
|
||||
)* OperatorCharacterAllowPlusMinusAtEnd Operator? (
|
||||
OperatorEndingWithPlusMinus: (OperatorCharacterNotAllowPlusMinusAtEnd | '-' | '/')* OperatorCharacterAllowPlusMinusAtEnd Operator? (
|
||||
'+'
|
||||
| '-'
|
||||
)+ -> type (Operator);
|
||||
@ -706,8 +697,7 @@ QuotedIdentifier: UnterminatedQuotedIdentifier '"';
|
||||
UnterminatedQuotedIdentifier: '"' ('""' | ~ [\u0000"])*;
|
||||
// This is a quoted identifier which is terminated but contains a \u0000 character
|
||||
|
||||
InvalidQuotedIdentifier:
|
||||
InvalidUnterminatedQuotedIdentifier '"';
|
||||
InvalidQuotedIdentifier: InvalidUnterminatedQuotedIdentifier '"';
|
||||
// This is a quoted identifier which is unterminated and contains a \u0000 character
|
||||
|
||||
InvalidUnterminatedQuotedIdentifier: '"' ('""' | ~ '"')*;
|
||||
@ -725,15 +715,13 @@ InvalidUnterminatedQuotedIdentifier: '"' ('""' | ~ '"')*;
|
||||
UnicodeQuotedIdentifier: 'U' '&' QuotedIdentifier;
|
||||
// This is a Unicode quoted identifier which only contains valid characters but is not terminated
|
||||
|
||||
UnterminatedUnicodeQuotedIdentifier:
|
||||
'U' '&' UnterminatedQuotedIdentifier;
|
||||
UnterminatedUnicodeQuotedIdentifier: 'U' '&' UnterminatedQuotedIdentifier;
|
||||
// This is a Unicode quoted identifier which is terminated but contains a \u0000 character
|
||||
|
||||
InvalidUnicodeQuotedIdentifier: 'U' '&' InvalidQuotedIdentifier;
|
||||
// This is a Unicode quoted identifier which is unterminated and contains a \u0000 character
|
||||
|
||||
InvalidUnterminatedUnicodeQuotedIdentifier:
|
||||
'U' '&' InvalidUnterminatedQuotedIdentifier;
|
||||
InvalidUnterminatedUnicodeQuotedIdentifier: 'U' '&' InvalidUnterminatedQuotedIdentifier;
|
||||
//
|
||||
|
||||
// CONSTANTS (4.1.2)
|
||||
@ -747,8 +735,7 @@ StringConstant: UnterminatedStringConstant '\'';
|
||||
UnterminatedStringConstant: '\'' ('\'\'' | ~ '\'')*;
|
||||
// String Constants with C-style Escapes (4.1.2.2)
|
||||
|
||||
BeginEscapeStringConstant:
|
||||
'E' '\'' -> more, pushMode (EscapeStringConstantMode);
|
||||
BeginEscapeStringConstant: 'E' '\'' -> more, pushMode (EscapeStringConstantMode);
|
||||
// String Constants with Unicode Escapes (4.1.2.3)
|
||||
|
||||
//
|
||||
@ -761,15 +748,12 @@ BeginEscapeStringConstant:
|
||||
|
||||
// TODO: these rules assume '' is still a valid escape sequence within a Unicode string constant.
|
||||
|
||||
UnicodeEscapeStringConstant:
|
||||
UnterminatedUnicodeEscapeStringConstant '\'';
|
||||
UnicodeEscapeStringConstant: UnterminatedUnicodeEscapeStringConstant '\'';
|
||||
|
||||
UnterminatedUnicodeEscapeStringConstant:
|
||||
'U' '&' UnterminatedStringConstant;
|
||||
UnterminatedUnicodeEscapeStringConstant: 'U' '&' UnterminatedStringConstant;
|
||||
// Dollar-quoted String Constants (4.1.2.4)
|
||||
|
||||
BeginDollarStringConstant:
|
||||
'$' Tag? '$' -> pushMode (DollarQuotedStringMode);
|
||||
BeginDollarStringConstant: '$' Tag? '$' -> pushMode (DollarQuotedStringMode);
|
||||
/* "The tag, if any, of a dollar-quoted string follows the same rules as an unquoted identifier,
|
||||
* except that it cannot contain a dollar sign."
|
||||
*/
|
||||
@ -781,22 +765,17 @@ BinaryStringConstant: UnterminatedBinaryStringConstant '\'';
|
||||
|
||||
UnterminatedBinaryStringConstant: 'B' '\'' [01]*;
|
||||
|
||||
InvalidBinaryStringConstant:
|
||||
InvalidUnterminatedBinaryStringConstant '\'';
|
||||
InvalidBinaryStringConstant: InvalidUnterminatedBinaryStringConstant '\'';
|
||||
|
||||
InvalidUnterminatedBinaryStringConstant:
|
||||
'B' UnterminatedStringConstant;
|
||||
InvalidUnterminatedBinaryStringConstant: 'B' UnterminatedStringConstant;
|
||||
|
||||
HexadecimalStringConstant:
|
||||
UnterminatedHexadecimalStringConstant '\'';
|
||||
HexadecimalStringConstant: UnterminatedHexadecimalStringConstant '\'';
|
||||
|
||||
UnterminatedHexadecimalStringConstant: 'X' '\'' [0-9a-fA-F]*;
|
||||
|
||||
InvalidHexadecimalStringConstant:
|
||||
InvalidUnterminatedHexadecimalStringConstant '\'';
|
||||
InvalidHexadecimalStringConstant: InvalidUnterminatedHexadecimalStringConstant '\'';
|
||||
|
||||
InvalidUnterminatedHexadecimalStringConstant:
|
||||
'X' UnterminatedStringConstant;
|
||||
InvalidUnterminatedHexadecimalStringConstant: 'X' UnterminatedStringConstant;
|
||||
// Numeric Constants (4.1.2.6)
|
||||
|
||||
Integral: Digits;
|
||||
@ -804,8 +783,7 @@ Integral: Digits;
|
||||
NumericFail: Digits '..';
|
||||
|
||||
Numeric:
|
||||
Digits '.' Digits? /*? replaced with + to solve problem with DOT_DOT .. but this surely must be rewriten */
|
||||
(
|
||||
Digits '.' Digits? /*? replaced with + to solve problem with DOT_DOT .. but this surely must be rewriten */ (
|
||||
'E' [+-]? Digits
|
||||
)?
|
||||
| '.' Digits ('E' [+-]? Digits)?
|
||||
@ -833,14 +811,7 @@ Newline: ('\r' '\n'? | '\n') -> channel (HIDDEN);
|
||||
|
||||
LineComment: '--' ~ [\r\n]* -> channel (HIDDEN);
|
||||
|
||||
BlockComment: (
|
||||
'/*' (
|
||||
'/'* BlockComment
|
||||
| ~ [/*]
|
||||
| '/'+ ~ [/*]
|
||||
| '*'+ ~ [/*]
|
||||
)* '*'* '*/'
|
||||
) -> channel (HIDDEN);
|
||||
BlockComment: ('/*' ( '/'* BlockComment | ~ [/*] | '/'+ ~ [/*] | '*'+ ~ [/*])* '*'* '*/') -> channel (HIDDEN);
|
||||
|
||||
UnterminatedBlockComment:
|
||||
'/*' (
|
||||
@ -852,9 +823,7 @@ UnterminatedBlockComment:
|
||||
('/'+ ~ [/*] | '*'+ ~ [/*])
|
||||
)*
|
||||
// Handle the case of / or * characters at the end of the file, or a nested unterminated block comment
|
||||
('/'+ | '*'+ | '/'* UnterminatedBlockComment)?
|
||||
// Optional assertion to make sure this rule is working as intended
|
||||
;
|
||||
('/'+ | '*'+ | '/'* UnterminatedBlockComment)?; // Optional assertion to make sure this rule is working as intended
|
||||
//
|
||||
|
||||
// META-COMMANDS
|
||||
@ -863,8 +832,7 @@ UnterminatedBlockComment:
|
||||
|
||||
// http://www.postgresql.org/docs/9.3/static/app-psql.html
|
||||
|
||||
MetaCommand:
|
||||
'\\' (~ [\r\n\\"] | '"' ~ [\r\n"]* '"')* ('"' ~ [\r\n"]*)?;
|
||||
MetaCommand: '\\' (~ [\r\n\\"] | '"' ~ [\r\n"]* '"')* ('"' ~ [\r\n"]*)?;
|
||||
|
||||
EndMetaCommand: '\\\\';
|
||||
//
|
||||
@ -882,8 +850,7 @@ EndMetaCommand: '\\\\';
|
||||
ErrorCharacter: .;
|
||||
|
||||
mode EscapeStringConstantMode;
|
||||
EscapeStringConstant:
|
||||
EscapeStringText '\'' -> mode (AfterEscapeStringConstantMode);
|
||||
EscapeStringConstant: EscapeStringText '\'' -> mode (AfterEscapeStringConstantMode);
|
||||
|
||||
UnterminatedEscapeStringConstant:
|
||||
EscapeStringText
|
||||
@ -896,8 +863,7 @@ fragment EscapeStringText: (
|
||||
// two-digit hex escapes are still valid when treated as single-digit escapes
|
||||
'x' [0-9a-fA-F]
|
||||
| 'u' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]
|
||||
| 'U' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]
|
||||
[0-9a-fA-F] [0-9a-fA-F]
|
||||
| 'U' [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]
|
||||
|
|
||||
// Any character other than the Unicode escapes can follow a backslash. Some have
|
||||
// special meaning, but that doesn't affect the syntax.
|
||||
@ -906,8 +872,7 @@ fragment EscapeStringText: (
|
||||
| ~ ['\\]
|
||||
)*;
|
||||
|
||||
InvalidEscapeStringConstant:
|
||||
InvalidEscapeStringText '\'' -> mode (AfterEscapeStringConstantMode);
|
||||
InvalidEscapeStringConstant: InvalidEscapeStringText '\'' -> mode (AfterEscapeStringConstantMode);
|
||||
|
||||
InvalidUnterminatedEscapeStringConstant:
|
||||
InvalidEscapeStringText
|
||||
@ -917,8 +882,7 @@ InvalidUnterminatedEscapeStringConstant:
|
||||
fragment InvalidEscapeStringText: ('\'\'' | '\\' . | ~ ['\\])*;
|
||||
|
||||
mode AfterEscapeStringConstantMode;
|
||||
AfterEscapeStringConstantMode_Whitespace:
|
||||
Whitespace -> type (Whitespace), channel (HIDDEN);
|
||||
AfterEscapeStringConstantMode_Whitespace: Whitespace -> type (Whitespace), channel (HIDDEN);
|
||||
|
||||
AfterEscapeStringConstantMode_Newline:
|
||||
Newline -> type (Newline), channel (HIDDEN), mode (AfterEscapeStringConstantWithNewlineMode);
|
||||
@ -929,8 +893,7 @@ mode AfterEscapeStringConstantWithNewlineMode;
|
||||
AfterEscapeStringConstantWithNewlineMode_Whitespace:
|
||||
Whitespace -> type (Whitespace), channel (HIDDEN);
|
||||
|
||||
AfterEscapeStringConstantWithNewlineMode_Newline:
|
||||
Newline -> type (Newline), channel (HIDDEN);
|
||||
AfterEscapeStringConstantWithNewlineMode_Newline: Newline -> type (Newline), channel (HIDDEN);
|
||||
|
||||
AfterEscapeStringConstantWithNewlineMode_Continued:
|
||||
'\'' -> more, mode (EscapeStringConstantMode);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -23,6 +23,11 @@
|
||||
* Reference: https://github.com/antlr/grammars-v4/blob/master/sql/plsql/PlSqlLexer.g4
|
||||
*/
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing
|
||||
// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true
|
||||
|
||||
lexer grammar PlSqlLexer;
|
||||
|
||||
options {
|
||||
@ -2384,14 +2389,23 @@ PERIOD: '.';
|
||||
UNSIGNED_INTEGER : [0-9]+;
|
||||
APPROXIMATE_NUM_LIT : FLOAT_FRAGMENT ('E' ('+' | '-')? (FLOAT_FRAGMENT | [0-9]+))? ('D' | 'F')?;
|
||||
|
||||
|
||||
// Rule #--- <CHAR_STRING> is a base for Rule #065 <char_string_lit> , it incorporates <character_representation>
|
||||
// and a superfluous subtoken typecasting of the "QUOTE"
|
||||
CHAR_STRING: '\'' (~('\'' | '\r' | '\n') | '\'' '\'' | NEWLINE)* '\'';
|
||||
|
||||
// See https://livesql.oracle.com/apex/livesql/file/content_CIREYU9EA54EOKQ7LAMZKRF6P.html
|
||||
// TODO: context sensitive string quotes (any characted after quote)
|
||||
CHAR_STRING_PERL : 'Q' '\'' (QS_ANGLE | QS_BRACE | QS_BRACK | QS_PAREN | QS_EXCLAM | QS_SHARP | QS_QUOTE | QS_DQUOTE) '\'' -> type(CHAR_STRING);
|
||||
CHAR_STRING_PERL:
|
||||
'Q' '\'' (
|
||||
QS_ANGLE
|
||||
| QS_BRACE
|
||||
| QS_BRACK
|
||||
| QS_PAREN
|
||||
| QS_EXCLAM
|
||||
| QS_SHARP
|
||||
| QS_QUOTE
|
||||
| QS_DQUOTE
|
||||
) '\'' -> type(CHAR_STRING);
|
||||
fragment QS_ANGLE : '<' .*? '>';
|
||||
fragment QS_BRACE : '{' .*? '}';
|
||||
fragment QS_BRACK : '[' .*? ']';
|
||||
@ -2419,18 +2433,13 @@ HASH_OP: '#';
|
||||
|
||||
SQ: '\'';
|
||||
|
||||
BINDVAR
|
||||
: ':' SIMPLE_LETTER (SIMPLE_LETTER | [0-9] | '_')*
|
||||
BINDVAR:
|
||||
':' SIMPLE_LETTER (SIMPLE_LETTER | [0-9] | '_')*
|
||||
| ':' DELIMITED_ID // not used in SQL but spotted in v$sqltext when using cursor_sharing
|
||||
| ':' UNSIGNED_INTEGER
|
||||
| QUESTION_MARK // not in SQL, not in Oracle, not in OCI, use this for JDBC
|
||||
;
|
||||
| QUESTION_MARK; // not in SQL, not in Oracle, not in OCI, use this for JDBC
|
||||
|
||||
NOT_EQUAL_OP: '!='
|
||||
| '<>'
|
||||
| '^='
|
||||
| '~='
|
||||
;
|
||||
NOT_EQUAL_OP : '!=' | '<>' | '^=' | '~=';
|
||||
CARRET_OPERATOR_PART : '^';
|
||||
TILDE_OPERATOR_PART : '~';
|
||||
EXCLAMATION_OPERATOR_PART : '!';
|
||||
@ -2452,7 +2461,8 @@ INTRODUCER: '_';
|
||||
SINGLE_LINE_COMMENT : '--' ~('\r' | '\n')* NEWLINE_EOF -> channel(HIDDEN);
|
||||
MULTI_LINE_COMMENT : '/*' .*? '*/' -> channel(HIDDEN);
|
||||
// https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve034.htm#SQPUG054
|
||||
REMARK_COMMENT: 'REM' {this.IsNewlineAtPos(-4)}? 'ARK'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF -> channel(HIDDEN);
|
||||
REMARK_COMMENT:
|
||||
'REM' {this.IsNewlineAtPos(-4)}? 'ARK'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF -> channel(HIDDEN);
|
||||
|
||||
// https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve032.htm#SQPUG052
|
||||
PROMPT_MESSAGE: 'PRO' {this.IsNewlineAtPos(-4)}? 'MPT'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF;
|
||||
@ -2460,10 +2470,8 @@ PROMPT_MESSAGE: 'PRO' {this.IsNewlineAtPos(-4)}? 'MPT'? (' ' ~('\r' | '\n')
|
||||
// TODO: should starts with newline
|
||||
START_CMD
|
||||
//: 'STA' 'RT'? SPACE ~('\r' | '\n')* NEWLINE_EOF
|
||||
// https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12002.htm
|
||||
// https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12003.htm
|
||||
: '@' {this.IsNewlineAtPos(-2)}? '@'? ~('\r' | '\n')* NEWLINE_EOF
|
||||
;
|
||||
: // https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12002.htm
|
||||
'@' {this.IsNewlineAtPos(-2)}? '@'? ~('\r' | '\n')* NEWLINE_EOF; // https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12003.htm
|
||||
|
||||
REGULAR_ID: SIMPLE_LETTER (SIMPLE_LETTER | '$' | '_' | '#' | [0-9])*;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,6 +18,11 @@
|
||||
* Reference: https://github.com/apache/spark/blob/master/sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseLexer.g4
|
||||
*/
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons none, alignColons trailing
|
||||
// $antlr-format singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, groupedAlignments true
|
||||
|
||||
lexer grammar SparkSqlLexer;
|
||||
|
||||
@members {
|
||||
@ -423,99 +428,51 @@ HENT_START: '/*+';
|
||||
HENT_END : '*/';
|
||||
QUESTION : '?';
|
||||
|
||||
STRING_LITERAL
|
||||
: '\'' ( ~('\''|'\\') | ('\\' .) )* '\''
|
||||
| 'R\'' (~'\'')* '\''
|
||||
| 'R"'(~'"')* '"'
|
||||
;
|
||||
STRING_LITERAL: '\'' ( ~('\'' | '\\') | ('\\' .))* '\'' | 'R\'' (~'\'')* '\'' | 'R"' (~'"')* '"';
|
||||
|
||||
DOUBLEQUOTED_STRING
|
||||
:'"' ( ~('"'|'\\') | ('\\' .) )* '"'
|
||||
;
|
||||
DOUBLEQUOTED_STRING: '"' ( ~('"' | '\\') | ('\\' .))* '"';
|
||||
|
||||
// NOTE: If you move a numeric literal, you should modify `ParserUtils.toExprAlias()`
|
||||
// which assumes all numeric literals are between `BIGINT_LITERAL` and `BIGDECIMAL_LITERAL`.
|
||||
|
||||
BIGINT_LITERAL
|
||||
: DIGIT+ 'L'
|
||||
;
|
||||
BIGINT_LITERAL: DIGIT+ 'L';
|
||||
|
||||
SMALLINT_LITERAL
|
||||
: DIGIT+ 'S'
|
||||
;
|
||||
SMALLINT_LITERAL: DIGIT+ 'S';
|
||||
|
||||
TINYINT_LITERAL
|
||||
: DIGIT+ 'Y'
|
||||
;
|
||||
TINYINT_LITERAL: DIGIT+ 'Y';
|
||||
|
||||
INTEGER_VALUE
|
||||
: DIGIT+
|
||||
;
|
||||
INTEGER_VALUE: DIGIT+;
|
||||
|
||||
EXPONENT_VALUE
|
||||
: DIGIT+ EXPONENT
|
||||
| DECIMAL_DIGITS EXPONENT
|
||||
;
|
||||
EXPONENT_VALUE: DIGIT+ EXPONENT | DECIMAL_DIGITS EXPONENT;
|
||||
|
||||
DECIMAL_VALUE
|
||||
: DECIMAL_DIGITS
|
||||
;
|
||||
DECIMAL_VALUE: DECIMAL_DIGITS;
|
||||
|
||||
FLOAT_LITERAL
|
||||
: DIGIT+ EXPONENT? 'F'
|
||||
| DECIMAL_DIGITS EXPONENT? 'F'
|
||||
;
|
||||
FLOAT_LITERAL: DIGIT+ EXPONENT? 'F' | DECIMAL_DIGITS EXPONENT? 'F';
|
||||
|
||||
DOUBLE_LITERAL
|
||||
: DIGIT+ EXPONENT? 'D'
|
||||
| DECIMAL_DIGITS EXPONENT? 'D'
|
||||
;
|
||||
DOUBLE_LITERAL: DIGIT+ EXPONENT? 'D' | DECIMAL_DIGITS EXPONENT? 'D';
|
||||
|
||||
BIGDECIMAL_LITERAL
|
||||
: DIGIT+ EXPONENT? 'BD'
|
||||
| DECIMAL_DIGITS EXPONENT? 'BD'
|
||||
;
|
||||
BIGDECIMAL_LITERAL: DIGIT+ EXPONENT? 'BD' | DECIMAL_DIGITS EXPONENT? 'BD';
|
||||
|
||||
IDENTIFIER
|
||||
: (LETTER | DIGIT | '_')+
|
||||
;
|
||||
IDENTIFIER: (LETTER | DIGIT | '_')+;
|
||||
|
||||
BACKQUOTED_IDENTIFIER
|
||||
: '`' ( ~'`' | '``' )* '`'
|
||||
;
|
||||
BACKQUOTED_IDENTIFIER: '`' ( ~'`' | '``')* '`';
|
||||
|
||||
fragment DECIMAL_DIGITS
|
||||
: DIGIT+ '.' DIGIT*
|
||||
| '.' DIGIT+
|
||||
;
|
||||
fragment DECIMAL_DIGITS: DIGIT+ '.' DIGIT* | '.' DIGIT+;
|
||||
|
||||
fragment EXPONENT
|
||||
: 'E' [+-]? DIGIT+
|
||||
;
|
||||
fragment EXPONENT: 'E' [+-]? DIGIT+;
|
||||
|
||||
fragment DIGIT
|
||||
: [0-9]
|
||||
;
|
||||
fragment DIGIT: [0-9];
|
||||
|
||||
fragment LETTER
|
||||
: [A-Za-z]
|
||||
;
|
||||
fragment LETTER: [A-Za-z];
|
||||
|
||||
SIMPLE_COMMENT
|
||||
: '--' ('\\\n' | ~[\r\n])* '\r'? '\n'? -> channel(HIDDEN)
|
||||
;
|
||||
SIMPLE_COMMENT: '--' ('\\\n' | ~[\r\n])* '\r'? '\n'? -> channel(HIDDEN);
|
||||
|
||||
BRACKETED_COMMENT
|
||||
: '/*' ( BRACKETED_COMMENT | . )*? ('*/' | {this.markUnclosedComment();} EOF) -> channel(HIDDEN)
|
||||
;
|
||||
BRACKETED_COMMENT:
|
||||
'/*' (BRACKETED_COMMENT | .)*? ('*/' | {this.markUnclosedComment();} EOF) -> channel(HIDDEN);
|
||||
|
||||
WS
|
||||
: [ \r\n\t]+ -> channel(HIDDEN)
|
||||
;
|
||||
WS: [ \r\n\t]+ -> channel(HIDDEN);
|
||||
|
||||
// Catch-all for anything we can't recognize.
|
||||
// We use this to be able to ignore and recover all the text
|
||||
// when splitting statements with DelimiterLexer
|
||||
UNRECOGNIZED
|
||||
: .
|
||||
;
|
||||
UNRECOGNIZED: .;
|
@ -18,9 +18,15 @@
|
||||
* Reference: https://github.com/apache/spark/blob/master/sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4
|
||||
*/
|
||||
|
||||
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false
|
||||
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging
|
||||
// $antlr-format spaceBeforeAssignmentOperators false, keepEmptyLinesAtTheStartOfBlocks true
|
||||
|
||||
parser grammar SparkSqlParser;
|
||||
|
||||
options { tokenVocab = SparkSqlLexer; }
|
||||
options {
|
||||
tokenVocab=SparkSqlLexer;
|
||||
}
|
||||
|
||||
program
|
||||
: singleStatement* EOF
|
||||
@ -36,150 +42,117 @@ statement
|
||||
| KW_USE dbSchemaName
|
||||
| KW_USE dbSchema dbSchemaName
|
||||
| KW_SET KW_CATALOG (identifier | stringLit)
|
||||
| KW_CREATE dbSchema (ifNotExists)? dbSchemaNameCreate
|
||||
(commentSpec |
|
||||
locationSpec |
|
||||
(KW_WITH (KW_DBPROPERTIES | KW_PROPERTIES) propertyList))*
|
||||
| KW_ALTER dbSchema dbSchemaName
|
||||
KW_SET (KW_DBPROPERTIES | KW_PROPERTIES) propertyList
|
||||
| KW_ALTER dbSchema dbSchemaName
|
||||
KW_SET locationSpec
|
||||
| KW_DROP dbSchema (ifExists)? dbSchemaName
|
||||
(KW_RESTRICT | KW_CASCADE)?
|
||||
| KW_SHOW dbSchemas ((KW_FROM | KW_IN) multipartIdentifier)?
|
||||
(KW_LIKE? pattern=stringLit)?
|
||||
| createTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider?
|
||||
createTableClauses
|
||||
(KW_AS? query)?
|
||||
| KW_CREATE KW_TABLE (ifNotExists)? target=tableNameCreate
|
||||
KW_LIKE source=tableName
|
||||
(tableProvider |
|
||||
rowFormat |
|
||||
createFileFormat |
|
||||
locationSpec |
|
||||
(KW_TBLPROPERTIES tableProps=propertyList))*
|
||||
| replaceTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider?
|
||||
createTableClauses
|
||||
(KW_AS? query)?
|
||||
| KW_ANALYZE KW_TABLE tableName partitionSpec? KW_COMPUTE KW_STATISTICS
|
||||
(KW_NOSCAN | KW_FOR KW_COLUMNS columnNameSeq | KW_FOR KW_ALL KW_COLUMNS)?
|
||||
| KW_ANALYZE KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? KW_COMPUTE KW_STATISTICS
|
||||
(KW_NOSCAN)?
|
||||
| KW_ALTER KW_TABLE tableName
|
||||
KW_ADD KW_COLUMN qualifiedColTypeWithPositionForAdd
|
||||
| KW_ALTER KW_TABLE tableName
|
||||
KW_ADD KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForAdd RIGHT_PAREN
|
||||
| KW_ALTER KW_TABLE table=tableName
|
||||
KW_RENAME KW_COLUMN columnName KW_TO columnNameCreate
|
||||
| KW_ALTER KW_TABLE tableName
|
||||
KW_DROP KW_COLUMN (ifExists)? columnName
|
||||
| KW_ALTER KW_TABLE tableName
|
||||
KW_DROP KW_COLUMNS (ifExists)? LEFT_PAREN columnNameSeq RIGHT_PAREN
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName)
|
||||
KW_RENAME KW_TO multipartIdentifier
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName)
|
||||
KW_SET KW_TBLPROPERTIES propertyList
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName)
|
||||
KW_UNSET KW_TBLPROPERTIES (ifExists)? propertyList
|
||||
| KW_ALTER KW_TABLE table=tableName
|
||||
(KW_ALTER | KW_CHANGE) KW_COLUMN? column=columnName
|
||||
alterColumnAction?
|
||||
| KW_ALTER KW_TABLE table=tableName partitionSpec?
|
||||
KW_CHANGE KW_COLUMN?
|
||||
colName=columnName colType colPosition?
|
||||
| KW_ALTER KW_TABLE table=tableName partitionSpec?
|
||||
KW_REPLACE KW_COLUMNS
|
||||
LEFT_PAREN qualifiedColTypeWithPositionSeqForReplace
|
||||
RIGHT_PAREN
|
||||
| KW_ALTER KW_TABLE tableName (partitionSpec)?
|
||||
KW_SET KW_SERDE stringLit (KW_WITH KW_SERDEPROPERTIES propertyList)?
|
||||
| KW_ALTER KW_TABLE tableName (partitionSpec)?
|
||||
KW_SET KW_SERDEPROPERTIES propertyList
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_ADD (ifNotExists)?
|
||||
partitionSpecLocation+
|
||||
| KW_ALTER KW_TABLE tableName
|
||||
partitionSpec KW_RENAME KW_TO partitionSpec
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName)
|
||||
KW_DROP (ifExists)? partitionSpec (COMMA partitionSpec)* KW_PURGE?
|
||||
| KW_ALTER KW_TABLE tableName
|
||||
(partitionSpec)? KW_SET locationSpec
|
||||
| KW_CREATE dbSchema (ifNotExists)? dbSchemaNameCreate (
|
||||
commentSpec
|
||||
| locationSpec
|
||||
| (KW_WITH (KW_DBPROPERTIES | KW_PROPERTIES) propertyList)
|
||||
)*
|
||||
| KW_ALTER dbSchema dbSchemaName KW_SET (KW_DBPROPERTIES | KW_PROPERTIES) propertyList
|
||||
| KW_ALTER dbSchema dbSchemaName KW_SET locationSpec
|
||||
| KW_DROP dbSchema (ifExists)? dbSchemaName (KW_RESTRICT | KW_CASCADE)?
|
||||
| KW_SHOW dbSchemas ((KW_FROM | KW_IN) multipartIdentifier)? (KW_LIKE? pattern=stringLit)?
|
||||
| createTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? createTableClauses (
|
||||
KW_AS? query
|
||||
)?
|
||||
| KW_CREATE KW_TABLE (ifNotExists)? target=tableNameCreate KW_LIKE source=tableName (
|
||||
tableProvider
|
||||
| rowFormat
|
||||
| createFileFormat
|
||||
| locationSpec
|
||||
| (KW_TBLPROPERTIES tableProps=propertyList)
|
||||
)*
|
||||
| replaceTableHeader (LEFT_PAREN createOrReplaceTableColTypeList RIGHT_PAREN)? tableProvider? createTableClauses (
|
||||
KW_AS? query
|
||||
)?
|
||||
| KW_ANALYZE KW_TABLE tableName partitionSpec? KW_COMPUTE KW_STATISTICS (
|
||||
KW_NOSCAN
|
||||
| KW_FOR KW_COLUMNS columnNameSeq
|
||||
| KW_FOR KW_ALL KW_COLUMNS
|
||||
)?
|
||||
| KW_ANALYZE KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? KW_COMPUTE KW_STATISTICS (KW_NOSCAN)?
|
||||
| KW_ALTER KW_TABLE tableName KW_ADD KW_COLUMN qualifiedColTypeWithPositionForAdd
|
||||
| KW_ALTER KW_TABLE tableName KW_ADD KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForAdd RIGHT_PAREN
|
||||
| KW_ALTER KW_TABLE table=tableName KW_RENAME KW_COLUMN columnName KW_TO columnNameCreate
|
||||
| KW_ALTER KW_TABLE tableName KW_DROP KW_COLUMN (ifExists)? columnName
|
||||
| KW_ALTER KW_TABLE tableName KW_DROP KW_COLUMNS (ifExists)? LEFT_PAREN columnNameSeq RIGHT_PAREN
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_RENAME KW_TO multipartIdentifier
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_SET KW_TBLPROPERTIES propertyList
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_UNSET KW_TBLPROPERTIES (ifExists)? propertyList
|
||||
| KW_ALTER KW_TABLE table=tableName (KW_ALTER | KW_CHANGE) KW_COLUMN? column=columnName alterColumnAction?
|
||||
| KW_ALTER KW_TABLE table=tableName partitionSpec? KW_CHANGE KW_COLUMN? colName=columnName colType colPosition?
|
||||
| KW_ALTER KW_TABLE table=tableName partitionSpec? KW_REPLACE KW_COLUMNS LEFT_PAREN qualifiedColTypeWithPositionSeqForReplace RIGHT_PAREN
|
||||
| KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET KW_SERDE stringLit (
|
||||
KW_WITH KW_SERDEPROPERTIES propertyList
|
||||
)?
|
||||
| KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET KW_SERDEPROPERTIES propertyList
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_ADD (ifNotExists)? partitionSpecLocation+
|
||||
| KW_ALTER KW_TABLE tableName partitionSpec KW_RENAME KW_TO partitionSpec
|
||||
| KW_ALTER (KW_TABLE tableName | KW_VIEW viewName) KW_DROP (ifExists)? partitionSpec (
|
||||
COMMA partitionSpec
|
||||
)* KW_PURGE?
|
||||
| KW_ALTER KW_TABLE tableName (partitionSpec)? KW_SET locationSpec
|
||||
| KW_ALTER KW_TABLE tableName KW_RECOVER KW_PARTITIONS
|
||||
| KW_DROP KW_TABLE (ifExists)? tableName KW_PURGE?
|
||||
| KW_DROP KW_VIEW (ifExists)? viewName
|
||||
| KW_CREATE (KW_OR KW_REPLACE)? (KW_GLOBAL? KW_TEMPORARY)?
|
||||
KW_VIEW (ifNotExists)? viewNameCreate
|
||||
identifierCommentList?
|
||||
(commentSpec |
|
||||
(KW_PARTITIONED KW_ON identifierList) |
|
||||
(KW_TBLPROPERTIES propertyList))*
|
||||
KW_AS query
|
||||
| KW_CREATE (KW_OR KW_REPLACE)? KW_GLOBAL? KW_TEMPORARY KW_VIEW
|
||||
viewNameCreate (LEFT_PAREN colTypeList RIGHT_PAREN)? tableProvider
|
||||
(KW_OPTIONS propertyList)?
|
||||
| KW_CREATE (KW_OR KW_REPLACE)? (KW_GLOBAL? KW_TEMPORARY)? KW_VIEW (ifNotExists)? viewNameCreate identifierCommentList? (
|
||||
commentSpec
|
||||
| (KW_PARTITIONED KW_ON identifierList)
|
||||
| (KW_TBLPROPERTIES propertyList)
|
||||
)* KW_AS query
|
||||
| KW_CREATE (KW_OR KW_REPLACE)? KW_GLOBAL? KW_TEMPORARY KW_VIEW viewNameCreate (
|
||||
LEFT_PAREN colTypeList RIGHT_PAREN
|
||||
)? tableProvider (KW_OPTIONS propertyList)?
|
||||
| KW_ALTER KW_VIEW viewName KW_AS? query
|
||||
| KW_CREATE (KW_OR KW_REPLACE)? KW_TEMPORARY? KW_FUNCTION (ifNotExists)?
|
||||
functionNameCreate KW_AS className=stringLit
|
||||
(KW_USING resource (COMMA resource)*)?
|
||||
| KW_CREATE (KW_OR KW_REPLACE)? KW_TEMPORARY? KW_FUNCTION (ifNotExists)? functionNameCreate KW_AS className=stringLit (
|
||||
KW_USING resource (COMMA resource)*
|
||||
)?
|
||||
| KW_DROP KW_TEMPORARY? KW_FUNCTION (ifExists)? functionName
|
||||
| KW_DECLARE (KW_OR KW_REPLACE)? KW_VARIABLE?
|
||||
functionName dataType? variableDefaultExpression?
|
||||
| KW_DECLARE (KW_OR KW_REPLACE)? KW_VARIABLE? functionName dataType? variableDefaultExpression?
|
||||
| KW_DROP KW_TEMPORARY KW_VARIABLE (ifExists)? (tableName | viewName | functionName)
|
||||
| KW_EXPLAIN (KW_LOGICAL | KW_FORMATTED | KW_EXTENDED | KW_CODEGEN | KW_COST)?
|
||||
statement
|
||||
| KW_SHOW KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)?
|
||||
(KW_LIKE? pattern=stringLit)?
|
||||
| KW_SHOW KW_TABLE KW_EXTENDED ((KW_FROM | KW_IN) ns=dbSchemaName)?
|
||||
KW_LIKE pattern=stringLit partitionSpec?
|
||||
| KW_SHOW KW_TBLPROPERTIES table=tableName
|
||||
(LEFT_PAREN key=propertyKey RIGHT_PAREN)?
|
||||
| KW_SHOW KW_COLUMNS (KW_FROM | KW_IN) table=tableName
|
||||
((KW_FROM | KW_IN) dbSchemaName)?
|
||||
| KW_SHOW KW_VIEWS ((KW_FROM | KW_IN) dbSchemaName)?
|
||||
(KW_LIKE? pattern=stringLit)?
|
||||
| KW_EXPLAIN (KW_LOGICAL | KW_FORMATTED | KW_EXTENDED | KW_CODEGEN | KW_COST)? statement
|
||||
| KW_SHOW KW_TABLES ((KW_FROM | KW_IN) dbSchemaName)? (KW_LIKE? pattern=stringLit)?
|
||||
| KW_SHOW KW_TABLE KW_EXTENDED ((KW_FROM | KW_IN) ns=dbSchemaName)? KW_LIKE pattern=stringLit partitionSpec?
|
||||
| KW_SHOW KW_TBLPROPERTIES table=tableName (LEFT_PAREN key=propertyKey RIGHT_PAREN)?
|
||||
| KW_SHOW KW_COLUMNS (KW_FROM | KW_IN) table=tableName ((KW_FROM | KW_IN) dbSchemaName)?
|
||||
| KW_SHOW KW_VIEWS ((KW_FROM | KW_IN) dbSchemaName)? (KW_LIKE? pattern=stringLit)?
|
||||
| KW_SHOW KW_PARTITIONS tableName partitionSpec?
|
||||
| KW_SHOW functionKind? KW_FUNCTIONS ((KW_FROM | KW_IN) ns=dbSchemaName)?
|
||||
(KW_LIKE? (legacy=multipartIdentifier | pattern=stringLit))?
|
||||
| KW_SHOW functionKind? KW_FUNCTIONS ((KW_FROM | KW_IN) ns=dbSchemaName)? (
|
||||
KW_LIKE? (legacy=multipartIdentifier | pattern=stringLit)
|
||||
)?
|
||||
| KW_SHOW KW_CREATE KW_TABLE tableName (KW_AS KW_SERDE)?
|
||||
| KW_SHOW KW_CURRENT dbSchema
|
||||
| KW_SHOW KW_CATALOGS (KW_LIKE? pattern=stringLit)?
|
||||
| (KW_DESC | KW_DESCRIBE) KW_FUNCTION KW_EXTENDED? describeFuncName
|
||||
| (KW_DESC | KW_DESCRIBE) KW_DATABASE KW_EXTENDED? dbSchemaName
|
||||
| (KW_DESC | KW_DESCRIBE) KW_TABLE? option=(KW_EXTENDED | KW_FORMATTED)?
|
||||
tableName partitionSpec? describeColName?
|
||||
| (KW_DESC | KW_DESCRIBE) KW_TABLE? option=(KW_EXTENDED | KW_FORMATTED)? tableName partitionSpec? describeColName?
|
||||
| (KW_DESC | KW_DESCRIBE) KW_QUERY? query
|
||||
| KW_COMMENT KW_ON dbSchema dbSchemaName KW_IS
|
||||
comment
|
||||
| KW_COMMENT KW_ON dbSchema dbSchemaName KW_IS comment
|
||||
| KW_COMMENT KW_ON KW_TABLE tableName KW_IS comment
|
||||
| KW_REFRESH KW_TABLE tableName
|
||||
| KW_REFRESH KW_FUNCTION functionName
|
||||
| KW_REFRESH (stringLit | .*?)
|
||||
| KW_CACHE KW_LAZY? KW_TABLE tableName
|
||||
(KW_OPTIONS options=propertyList)? (KW_AS? query)?
|
||||
| KW_CACHE KW_LAZY? KW_TABLE tableName (KW_OPTIONS options=propertyList)? (KW_AS? query)?
|
||||
| KW_UNCACHE KW_TABLE (ifExists)? tableName
|
||||
| KW_CLEAR KW_CACHE
|
||||
| KW_LOAD KW_DATA KW_LOCAL? KW_INPATH path=stringLit KW_OVERWRITE? KW_INTO KW_TABLE
|
||||
tableName partitionSpec?
|
||||
| KW_LOAD KW_DATA KW_LOCAL? KW_INPATH path=stringLit KW_OVERWRITE? KW_INTO KW_TABLE tableName partitionSpec?
|
||||
| KW_TRUNCATE KW_TABLE tableName partitionSpec?
|
||||
| (KW_MSCK)? KW_REPAIR KW_TABLE tableName
|
||||
(option=(KW_ADD|KW_DROP|KW_SYNC) KW_PARTITIONS)?
|
||||
| (KW_MSCK)? KW_REPAIR KW_TABLE tableName (option=(KW_ADD | KW_DROP | KW_SYNC) KW_PARTITIONS)?
|
||||
| op=(KW_ADD | KW_LIST) identifier .*?
|
||||
| KW_SET KW_ROLE .*?
|
||||
| KW_SET KW_TIME KW_ZONE interval
|
||||
| KW_SET KW_TIME KW_ZONE timezone
|
||||
| KW_SET KW_TIME KW_ZONE .*?
|
||||
| KW_SET (KW_VARIABLE | KW_VAR) assignmentList
|
||||
| KW_SET (KW_VARIABLE | KW_VAR) LEFT_PAREN multipartIdentifierList RIGHT_PAREN EQ
|
||||
LEFT_PAREN query RIGHT_PAREN
|
||||
| KW_SET (KW_VARIABLE | KW_VAR) LEFT_PAREN multipartIdentifierList RIGHT_PAREN EQ LEFT_PAREN query RIGHT_PAREN
|
||||
| KW_SET configKey EQ configValue
|
||||
| KW_SET configKey (EQ .*?)?
|
||||
| KW_SET .*? EQ configValue
|
||||
| KW_SET .*?
|
||||
| KW_RESET configKey
|
||||
| KW_RESET .*?
|
||||
| KW_CREATE KW_INDEX (ifNotExists)? identifier KW_ON KW_TABLE?
|
||||
tableName (KW_USING indexType=identifier)?
|
||||
LEFT_PAREN multipartIdentifierPropertyList RIGHT_PAREN
|
||||
(KW_OPTIONS options=propertyList)?
|
||||
| KW_CREATE KW_INDEX (ifNotExists)? identifier KW_ON KW_TABLE? tableName (
|
||||
KW_USING indexType=identifier
|
||||
)? LEFT_PAREN multipartIdentifierPropertyList RIGHT_PAREN (KW_OPTIONS options=propertyList)?
|
||||
| KW_DROP KW_INDEX (ifExists)? identifier KW_ON KW_TABLE? tableName
|
||||
| unsupportedHiveNativeCommands .*?
|
||||
;
|
||||
@ -253,15 +226,13 @@ replaceTableHeader
|
||||
;
|
||||
|
||||
bucketSpec
|
||||
: KW_CLUSTERED KW_BY identifierList
|
||||
(KW_SORTED KW_BY orderedIdentifierList)?
|
||||
KW_INTO INTEGER_VALUE KW_BUCKETS
|
||||
: KW_CLUSTERED KW_BY identifierList (KW_SORTED KW_BY orderedIdentifierList)? KW_INTO INTEGER_VALUE KW_BUCKETS
|
||||
;
|
||||
|
||||
skewSpec
|
||||
: KW_SKEWED KW_BY identifierList
|
||||
KW_ON (constantList | nestedConstantList)
|
||||
(KW_STORED KW_AS KW_DIRECTORIES)?
|
||||
: KW_SKEWED KW_BY identifierList KW_ON (constantList | nestedConstantList) (
|
||||
KW_STORED KW_AS KW_DIRECTORIES
|
||||
)?
|
||||
;
|
||||
|
||||
locationSpec
|
||||
@ -277,11 +248,19 @@ query
|
||||
;
|
||||
|
||||
insertInto
|
||||
: KW_INSERT KW_OVERWRITE KW_TABLE? tableName (partitionSpec (ifNotExists)?)? ((KW_BY KW_NAME) | (LEFT_PAREN columnNameSeq RIGHT_PAREN ))?
|
||||
| KW_INSERT KW_INTO KW_TABLE? tableName partitionSpec? (ifNotExists)? ((KW_BY KW_NAME) | (LEFT_PAREN columnNameSeq RIGHT_PAREN ))?
|
||||
: KW_INSERT KW_OVERWRITE KW_TABLE? tableName (partitionSpec (ifNotExists)?)? (
|
||||
(KW_BY KW_NAME)
|
||||
| (LEFT_PAREN columnNameSeq RIGHT_PAREN)
|
||||
)?
|
||||
| KW_INSERT KW_INTO KW_TABLE? tableName partitionSpec? (ifNotExists)? (
|
||||
(KW_BY KW_NAME)
|
||||
| (LEFT_PAREN columnNameSeq RIGHT_PAREN)
|
||||
)?
|
||||
| KW_INSERT KW_INTO KW_TABLE? tableName KW_REPLACE whereClause
|
||||
| KW_INSERT KW_OVERWRITE KW_LOCAL? KW_DIRECTORY path=stringLit rowFormat? createFileFormat?
|
||||
| KW_INSERT KW_OVERWRITE KW_LOCAL? KW_DIRECTORY (path=stringLit)? tableProvider (KW_OPTIONS options=propertyList)?
|
||||
| KW_INSERT KW_OVERWRITE KW_LOCAL? KW_DIRECTORY (path=stringLit)? tableProvider (
|
||||
KW_OPTIONS options=propertyList
|
||||
)?
|
||||
;
|
||||
|
||||
partitionSpecLocation
|
||||
@ -334,15 +313,17 @@ tableProvider
|
||||
;
|
||||
|
||||
createTableClauses
|
||||
:((KW_OPTIONS options=expressionPropertyList) |
|
||||
(KW_PARTITIONED KW_BY partitioning=partitionFieldList) |
|
||||
skewSpec |
|
||||
bucketSpec |
|
||||
rowFormat |
|
||||
createFileFormat |
|
||||
locationSpec |
|
||||
commentSpec |
|
||||
(KW_TBLPROPERTIES tableProps=propertyList))*
|
||||
: (
|
||||
(KW_OPTIONS options=expressionPropertyList)
|
||||
| (KW_PARTITIONED KW_BY partitioning=partitionFieldList)
|
||||
| skewSpec
|
||||
| bucketSpec
|
||||
| rowFormat
|
||||
| createFileFormat
|
||||
| locationSpec
|
||||
| commentSpec
|
||||
| (KW_TBLPROPERTIES tableProps=propertyList)
|
||||
)*
|
||||
;
|
||||
|
||||
propertyList
|
||||
@ -404,32 +385,47 @@ dmlStatementNoWith
|
||||
| fromClause multiInsertQueryBody+
|
||||
| KW_DELETE KW_FROM tableName tableAlias whereClause?
|
||||
| KW_UPDATE tableName tableAlias setClause whereClause?
|
||||
| KW_MERGE KW_INTO target=tableName targetAlias=tableAlias
|
||||
KW_USING (source=identifierReference |
|
||||
LEFT_PAREN sourceQuery=query RIGHT_PAREN) sourceAlias=tableAlias
|
||||
KW_ON mergeCondition=booleanExpression
|
||||
matchedClause*
|
||||
notMatchedClause*
|
||||
notMatchedBySourceClause*
|
||||
| KW_MERGE KW_INTO target=tableName targetAlias=tableAlias KW_USING (
|
||||
source=identifierReference
|
||||
| LEFT_PAREN sourceQuery=query RIGHT_PAREN
|
||||
) sourceAlias=tableAlias KW_ON mergeCondition=booleanExpression matchedClause* notMatchedClause* notMatchedBySourceClause*
|
||||
;
|
||||
|
||||
dbSchemaName: identifierReference;
|
||||
dbSchemaName
|
||||
: identifierReference
|
||||
;
|
||||
|
||||
dbSchemaNameCreate: identifierReference;
|
||||
dbSchemaNameCreate
|
||||
: identifierReference
|
||||
;
|
||||
|
||||
tableNameCreate: tableIdentifier;
|
||||
tableNameCreate
|
||||
: tableIdentifier
|
||||
;
|
||||
|
||||
tableName: tableIdentifier;
|
||||
tableName
|
||||
: tableIdentifier
|
||||
;
|
||||
|
||||
viewNameCreate: viewIdentifier;
|
||||
viewNameCreate
|
||||
: viewIdentifier
|
||||
;
|
||||
|
||||
viewName: viewIdentifier;
|
||||
viewName
|
||||
: viewIdentifier
|
||||
;
|
||||
|
||||
columnName: multipartIdentifier;
|
||||
columnName
|
||||
: multipartIdentifier
|
||||
;
|
||||
|
||||
columnNameSeq: columnName (COMMA columnName)* ;
|
||||
columnNameSeq
|
||||
: columnName (COMMA columnName)*
|
||||
;
|
||||
|
||||
columnNameCreate: errorCapturingIdentifier;
|
||||
columnNameCreate
|
||||
: errorCapturingIdentifier
|
||||
;
|
||||
|
||||
identifierReference
|
||||
: KW_IDENTIFIER LEFT_PAREN expression RIGHT_PAREN
|
||||
@ -437,13 +433,11 @@ identifierReference
|
||||
;
|
||||
|
||||
queryOrganization
|
||||
: (KW_ORDER KW_BY order+=sortItem (COMMA order+=sortItem)*)?
|
||||
(KW_CLUSTER KW_BY clusterBy+=expression (COMMA clusterBy+=expression)*)?
|
||||
(KW_DISTRIBUTE KW_BY distributeBy+=expression (COMMA distributeBy+=expression)*)?
|
||||
(KW_SORT KW_BY sort+=sortItem (COMMA sort+=sortItem)*)?
|
||||
windowClause?
|
||||
(KW_LIMIT (KW_ALL | limit=expression))?
|
||||
(KW_OFFSET offset=expression)?
|
||||
: (KW_ORDER KW_BY order+=sortItem (COMMA order+=sortItem)*)? (
|
||||
KW_CLUSTER KW_BY clusterBy+=expression (COMMA clusterBy+=expression)*
|
||||
)? (KW_DISTRIBUTE KW_BY distributeBy+=expression (COMMA distributeBy+=expression)*)? (
|
||||
KW_SORT KW_BY sort+=sortItem (COMMA sort+=sortItem)*
|
||||
)? windowClause? (KW_LIMIT (KW_ALL | limit=expression))? (KW_OFFSET offset=expression)?
|
||||
;
|
||||
|
||||
multiInsertQueryBody
|
||||
@ -452,12 +446,9 @@ multiInsertQueryBody
|
||||
|
||||
queryTerm
|
||||
: queryPrimary
|
||||
| left=queryTerm
|
||||
operator=(KW_INTERSECT | KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm
|
||||
| left=queryTerm
|
||||
operator=KW_INTERSECT setQuantifier? right=queryTerm
|
||||
| left=queryTerm
|
||||
operator=(KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm
|
||||
| left=queryTerm operator=(KW_INTERSECT | KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm
|
||||
| left=queryTerm operator=KW_INTERSECT setQuantifier? right=queryTerm
|
||||
| left=queryTerm operator=(KW_UNION | KW_EXCEPT | KW_MINUS) setQuantifier? right=queryTerm
|
||||
;
|
||||
|
||||
queryPrimary
|
||||
@ -469,7 +460,9 @@ queryPrimary
|
||||
;
|
||||
|
||||
sortItem
|
||||
: (columnName | expression) ordering=(KW_ASC | KW_DESC)? (KW_NULLS nullOrder=(KW_LAST | KW_FIRST))?
|
||||
: (columnName | expression) ordering=(KW_ASC | KW_DESC)? (
|
||||
KW_NULLS nullOrder=(KW_LAST | KW_FIRST)
|
||||
)?
|
||||
;
|
||||
|
||||
fromStatement
|
||||
@ -477,45 +470,27 @@ fromStatement
|
||||
;
|
||||
|
||||
fromStatementBody
|
||||
: transformClause
|
||||
whereClause?
|
||||
queryOrganization
|
||||
| selectClause
|
||||
lateralView*
|
||||
whereClause?
|
||||
aggregationClause?
|
||||
havingClause?
|
||||
windowClause?
|
||||
queryOrganization
|
||||
: transformClause whereClause? queryOrganization
|
||||
| selectClause lateralView* whereClause? aggregationClause? havingClause? windowClause? queryOrganization
|
||||
;
|
||||
|
||||
querySpecification
|
||||
: transformClause
|
||||
fromClause?
|
||||
lateralView*
|
||||
whereClause?
|
||||
aggregationClause?
|
||||
havingClause?
|
||||
windowClause?
|
||||
| selectClause
|
||||
fromClause?
|
||||
lateralView*
|
||||
whereClause?
|
||||
aggregationClause?
|
||||
havingClause?
|
||||
windowClause?
|
||||
: transformClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause?
|
||||
| selectClause fromClause? lateralView* whereClause? aggregationClause? havingClause? windowClause?
|
||||
;
|
||||
|
||||
transformClause
|
||||
: (KW_SELECT kind=KW_TRANSFORM LEFT_PAREN setQuantifier? expressionSeq RIGHT_PAREN
|
||||
: (
|
||||
KW_SELECT kind=KW_TRANSFORM LEFT_PAREN setQuantifier? expressionSeq RIGHT_PAREN
|
||||
| kind=KW_MAP setQuantifier? expressionSeq
|
||||
| kind=KW_REDUCE setQuantifier? expressionSeq)
|
||||
inRowFormat=rowFormat?
|
||||
(KW_RECORDWRITER recordWriter=stringLit)?
|
||||
KW_USING script=stringLit
|
||||
(KW_AS (identifierSeq | colTypeList | (LEFT_PAREN (identifierSeq | colTypeList) RIGHT_PAREN)))?
|
||||
outRowFormat=rowFormat?
|
||||
(KW_RECORDREADER recordReader=stringLit)?
|
||||
| kind=KW_REDUCE setQuantifier? expressionSeq
|
||||
) inRowFormat=rowFormat? (KW_RECORDWRITER recordWriter=stringLit)? KW_USING script=stringLit (
|
||||
KW_AS (
|
||||
identifierSeq
|
||||
| colTypeList
|
||||
| (LEFT_PAREN (identifierSeq | colTypeList) RIGHT_PAREN)
|
||||
)
|
||||
)? outRowFormat=rowFormat? (KW_RECORDREADER recordReader=stringLit)?
|
||||
;
|
||||
|
||||
selectClause
|
||||
@ -529,6 +504,7 @@ setClause
|
||||
matchedClause
|
||||
: KW_WHEN KW_MATCHED (KW_AND matchedCond=booleanExpression)? KW_THEN matchedAction
|
||||
;
|
||||
|
||||
notMatchedClause
|
||||
: KW_WHEN KW_NOT KW_MATCHED (KW_BY KW_TARGET)? (KW_AND notMatchedCond=booleanExpression)? KW_THEN notMatchedAction
|
||||
;
|
||||
@ -545,8 +521,9 @@ matchedAction
|
||||
|
||||
notMatchedAction
|
||||
: KW_INSERT ASTERISK
|
||||
| KW_INSERT LEFT_PAREN multipartIdentifierList RIGHT_PAREN
|
||||
KW_VALUES LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN
|
||||
| KW_INSERT LEFT_PAREN multipartIdentifierList RIGHT_PAREN KW_VALUES LEFT_PAREN expression (
|
||||
COMMA expression
|
||||
)* RIGHT_PAREN
|
||||
;
|
||||
|
||||
notMatchedBySourceAction
|
||||
@ -576,7 +553,9 @@ hint
|
||||
|
||||
hintStatement
|
||||
: hintName=identifier
|
||||
| hintName=identifier LEFT_PAREN parameters+=primaryExpression (COMMA parameters+=primaryExpression)* RIGHT_PAREN
|
||||
| hintName=identifier LEFT_PAREN parameters+=primaryExpression (
|
||||
COMMA parameters+=primaryExpression
|
||||
)* RIGHT_PAREN
|
||||
;
|
||||
|
||||
fromClause
|
||||
@ -584,7 +563,9 @@ fromClause
|
||||
;
|
||||
|
||||
functionKind
|
||||
: KW_USER | KW_SYSTEM | KW_ALL
|
||||
: KW_USER
|
||||
| KW_SYSTEM
|
||||
| KW_ALL
|
||||
;
|
||||
|
||||
temporalClause
|
||||
@ -593,12 +574,14 @@ temporalClause
|
||||
;
|
||||
|
||||
aggregationClause
|
||||
: KW_GROUP KW_BY groupingExpressionsWithGroupingAnalytics+=groupByClause
|
||||
(COMMA groupingExpressionsWithGroupingAnalytics+=groupByClause)*
|
||||
: KW_GROUP KW_BY groupingExpressionsWithGroupingAnalytics+=groupByClause (
|
||||
COMMA groupingExpressionsWithGroupingAnalytics+=groupByClause
|
||||
)*
|
||||
| KW_GROUP KW_BY groupingExpressions+=expression (COMMA groupingExpressions+=expression)* (
|
||||
KW_WITH kind=KW_ROLLUP
|
||||
| KW_WITH kind=KW_CUBE
|
||||
| kind=KW_GROUPING KW_SETS LEFT_PAREN groupingSet (COMMA groupingSet)* RIGHT_PAREN)?
|
||||
| kind=KW_GROUPING KW_SETS LEFT_PAREN groupingSet (COMMA groupingSet)* RIGHT_PAREN
|
||||
)?
|
||||
;
|
||||
|
||||
groupByClause
|
||||
@ -624,7 +607,9 @@ groupingSet
|
||||
;
|
||||
|
||||
pivotClause
|
||||
: KW_PIVOT LEFT_PAREN aggregates=namedExpressionSeq KW_FOR pivotColumn KW_IN LEFT_PAREN pivotValues+=pivotValue (COMMA pivotValues+=pivotValue)* RIGHT_PAREN RIGHT_PAREN
|
||||
: KW_PIVOT LEFT_PAREN aggregates=namedExpressionSeq KW_FOR pivotColumn KW_IN LEFT_PAREN pivotValues+=pivotValue (
|
||||
COMMA pivotValues+=pivotValue
|
||||
)* RIGHT_PAREN RIGHT_PAREN
|
||||
;
|
||||
|
||||
pivotColumn
|
||||
@ -637,9 +622,9 @@ pivotValue
|
||||
;
|
||||
|
||||
unpivotClause
|
||||
: KW_UNPIVOT nullOperator=unpivotNullClause? LEFT_PAREN
|
||||
operator=unpivotOperator
|
||||
RIGHT_PAREN (KW_AS? identifier)?
|
||||
: KW_UNPIVOT nullOperator=unpivotNullClause? LEFT_PAREN operator=unpivotOperator RIGHT_PAREN (
|
||||
KW_AS? identifier
|
||||
)?
|
||||
;
|
||||
|
||||
unpivotNullClause
|
||||
@ -651,13 +636,17 @@ unpivotOperator
|
||||
;
|
||||
|
||||
unpivotSingleValueColumnClause
|
||||
: unpivotValueColumn KW_FOR unpivotNameColumn KW_IN LEFT_PAREN unpivotColumns+=unpivotColumnAndAlias (COMMA unpivotColumns+=unpivotColumnAndAlias)* RIGHT_PAREN
|
||||
: unpivotValueColumn KW_FOR unpivotNameColumn KW_IN LEFT_PAREN unpivotColumns+=unpivotColumnAndAlias (
|
||||
COMMA unpivotColumns+=unpivotColumnAndAlias
|
||||
)* RIGHT_PAREN
|
||||
;
|
||||
|
||||
unpivotMultiValueColumnClause
|
||||
: LEFT_PAREN unpivotValueColumns+=unpivotValueColumn (COMMA unpivotValueColumns+=unpivotValueColumn)* RIGHT_PAREN
|
||||
KW_FOR unpivotNameColumn
|
||||
KW_IN LEFT_PAREN unpivotColumnSets+=unpivotColumnSet (COMMA unpivotColumnSets+=unpivotColumnSet)* RIGHT_PAREN
|
||||
: LEFT_PAREN unpivotValueColumns+=unpivotValueColumn (
|
||||
COMMA unpivotValueColumns+=unpivotValueColumn
|
||||
)* RIGHT_PAREN KW_FOR unpivotNameColumn KW_IN LEFT_PAREN unpivotColumnSets+=unpivotColumnSet (
|
||||
COMMA unpivotColumnSets+=unpivotColumnSet
|
||||
)* RIGHT_PAREN
|
||||
;
|
||||
|
||||
unpivotColumnSet
|
||||
@ -685,13 +674,17 @@ unpivotAlias
|
||||
;
|
||||
|
||||
ifNotExists
|
||||
: KW_IF KW_NOT KW_EXISTS;
|
||||
: KW_IF KW_NOT KW_EXISTS
|
||||
;
|
||||
|
||||
ifExists
|
||||
: KW_IF KW_EXISTS;
|
||||
: KW_IF KW_EXISTS
|
||||
;
|
||||
|
||||
lateralView
|
||||
: KW_LATERAL KW_VIEW (KW_OUTER)? viewName LEFT_PAREN (expression (COMMA expression)*)? RIGHT_PAREN tableAlias (KW_AS? colName+=identifier (COMMA colName+=identifier)*)?
|
||||
: KW_LATERAL KW_VIEW (KW_OUTER)? viewName LEFT_PAREN (expression (COMMA expression)*)? RIGHT_PAREN tableAlias (
|
||||
KW_AS? colName+=identifier (COMMA colName+=identifier)*
|
||||
)?
|
||||
;
|
||||
|
||||
setQuantifier
|
||||
@ -731,14 +724,17 @@ joinCriteria
|
||||
;
|
||||
|
||||
sample
|
||||
: KW_TABLESAMPLE LEFT_PAREN sampleMethod? RIGHT_PAREN (KW_REPEATABLE LEFT_PAREN seed=INTEGER_VALUE RIGHT_PAREN)?
|
||||
: KW_TABLESAMPLE LEFT_PAREN sampleMethod? RIGHT_PAREN (
|
||||
KW_REPEATABLE LEFT_PAREN seed=INTEGER_VALUE RIGHT_PAREN
|
||||
)?
|
||||
;
|
||||
|
||||
sampleMethod
|
||||
: negativeSign=MINUS? percentage=(INTEGER_VALUE | DECIMAL_VALUE) KW_PERCENTLIT
|
||||
| expression KW_ROWS
|
||||
| sampleType=KW_BUCKET numerator=INTEGER_VALUE KW_OUT KW_OF denominator=INTEGER_VALUE
|
||||
(KW_ON (identifier | qualifiedName LEFT_PAREN RIGHT_PAREN))?
|
||||
| sampleType=KW_BUCKET numerator=INTEGER_VALUE KW_OUT KW_OF denominator=INTEGER_VALUE (
|
||||
KW_ON (identifier | qualifiedName LEFT_PAREN RIGHT_PAREN)
|
||||
)?
|
||||
| bytes=expression
|
||||
;
|
||||
|
||||
@ -767,8 +763,7 @@ identifierComment
|
||||
;
|
||||
|
||||
relationPrimary
|
||||
: identifierReference temporalClause?
|
||||
sample? tableAlias
|
||||
: identifierReference temporalClause? sample? tableAlias
|
||||
| LEFT_PAREN query RIGHT_PAREN sample? tableAlias
|
||||
| LEFT_PAREN relation RIGHT_PAREN sample? tableAlias
|
||||
| inlineTable
|
||||
@ -786,13 +781,19 @@ functionTableSubqueryArgument
|
||||
;
|
||||
|
||||
tableArgumentPartitioning
|
||||
: ((KW_WITH KW_SINGLE KW_PARTITION)
|
||||
| ((KW_PARTITION | KW_DISTRIBUTE) KW_BY
|
||||
(((LEFT_PAREN partition+=expression (COMMA partition+=expression)* RIGHT_PAREN))
|
||||
| partition+=expression)))
|
||||
((KW_ORDER | KW_SORT) KW_BY
|
||||
(((LEFT_PAREN sortItem (COMMA sortItem)* RIGHT_PAREN)
|
||||
| sortItem)))?
|
||||
: (
|
||||
(KW_WITH KW_SINGLE KW_PARTITION)
|
||||
| (
|
||||
(KW_PARTITION | KW_DISTRIBUTE) KW_BY (
|
||||
((LEFT_PAREN partition+=expression (COMMA partition+=expression)* RIGHT_PAREN))
|
||||
| partition+=expression
|
||||
)
|
||||
)
|
||||
) (
|
||||
(KW_ORDER | KW_SORT) KW_BY (
|
||||
((LEFT_PAREN sortItem (COMMA sortItem)* RIGHT_PAREN) | sortItem)
|
||||
)
|
||||
)?
|
||||
;
|
||||
|
||||
functionTableNamedArgumentExpression
|
||||
@ -810,9 +811,7 @@ functionTableArgument
|
||||
;
|
||||
|
||||
functionTable
|
||||
: functionName LEFT_PAREN
|
||||
(functionTableArgument (COMMA functionTableArgument)*)?
|
||||
RIGHT_PAREN tableAlias
|
||||
: functionName LEFT_PAREN (functionTableArgument (COMMA functionTableArgument)*)? RIGHT_PAREN tableAlias
|
||||
;
|
||||
|
||||
tableAlias
|
||||
@ -821,12 +820,15 @@ tableAlias
|
||||
|
||||
rowFormat
|
||||
: KW_ROW KW_FORMAT KW_SERDE name=stringLit (KW_WITH KW_SERDEPROPERTIES props=propertyList)?
|
||||
| KW_ROW KW_FORMAT KW_DELIMITED
|
||||
(KW_FIELDS KW_TERMINATED KW_BY fieldsTerminatedBy=stringLit (KW_ESCAPED KW_BY escapedBy=stringLit)?)?
|
||||
(KW_COLLECTION KW_ITEMS KW_TERMINATED KW_BY collectionItemsTerminatedBy=stringLit)?
|
||||
(KW_MAP KW_KEYS KW_TERMINATED KW_BY keysTerminatedBy=stringLit)?
|
||||
(KW_LINES KW_TERMINATED KW_BY linesSeparatedBy=stringLit)?
|
||||
(KW_NULL KW_DEFINED KW_AS nullDefinedAs=stringLit)?
|
||||
| KW_ROW KW_FORMAT KW_DELIMITED (
|
||||
KW_FIELDS KW_TERMINATED KW_BY fieldsTerminatedBy=stringLit (
|
||||
KW_ESCAPED KW_BY escapedBy=stringLit
|
||||
)?
|
||||
)? (KW_COLLECTION KW_ITEMS KW_TERMINATED KW_BY collectionItemsTerminatedBy=stringLit)? (
|
||||
KW_MAP KW_KEYS KW_TERMINATED KW_BY keysTerminatedBy=stringLit
|
||||
)? (KW_LINES KW_TERMINATED KW_BY linesSeparatedBy=stringLit)? (
|
||||
KW_NULL KW_DEFINED KW_AS nullDefinedAs=stringLit
|
||||
)?
|
||||
;
|
||||
|
||||
multipartIdentifierList
|
||||
@ -872,8 +874,7 @@ partitionField
|
||||
|
||||
transform
|
||||
: qualifiedName
|
||||
| transformName=identifier
|
||||
LEFT_PAREN transformArgument (COMMA transformArgument)* RIGHT_PAREN
|
||||
| transformName=identifier LEFT_PAREN transformArgument (COMMA transformArgument)* RIGHT_PAREN
|
||||
;
|
||||
|
||||
transformArgument
|
||||
@ -911,7 +912,10 @@ predicate
|
||||
| KW_NOT? kind=KW_IN LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN
|
||||
| KW_NOT? kind=KW_IN LEFT_PAREN query RIGHT_PAREN
|
||||
| KW_NOT? kind=(KW_RLIKE | KW_REGEXP) pattern=valueExpression
|
||||
| KW_NOT? kind=(KW_LIKE | KW_ILIKE) quantifier=(KW_ANY | KW_SOME | KW_ALL) (LEFT_PAREN RIGHT_PAREN | LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN)
|
||||
| KW_NOT? kind=(KW_LIKE | KW_ILIKE) quantifier=(KW_ANY | KW_SOME | KW_ALL) (
|
||||
LEFT_PAREN RIGHT_PAREN
|
||||
| LEFT_PAREN expression (COMMA expression)* RIGHT_PAREN
|
||||
)
|
||||
| KW_NOT? kind=(KW_LIKE | KW_ILIKE) pattern=valueExpression (KW_ESCAPE escapeChar=stringLit)?
|
||||
| KW_IS KW_NOT? kind=KW_NULL
|
||||
| KW_IS KW_NOT? kind=(KW_TRUE | KW_FALSE | KW_UNKNOWN)
|
||||
@ -930,15 +934,29 @@ valueExpression
|
||||
;
|
||||
|
||||
datetimeUnit
|
||||
: KW_YEAR | KW_QUARTER | KW_MONTH
|
||||
| KW_WEEK | KW_DAY | KW_DAYOFYEAR
|
||||
| KW_HOUR | KW_MINUTE | KW_SECOND | KW_MILLISECOND | KW_MICROSECOND
|
||||
: KW_YEAR
|
||||
| KW_QUARTER
|
||||
| KW_MONTH
|
||||
| KW_WEEK
|
||||
| KW_DAY
|
||||
| KW_DAYOFYEAR
|
||||
| KW_HOUR
|
||||
| KW_MINUTE
|
||||
| KW_SECOND
|
||||
| KW_MILLISECOND
|
||||
| KW_MICROSECOND
|
||||
;
|
||||
|
||||
primaryExpression
|
||||
: name=(KW_CURRENT_DATE | KW_CURRENT_TIMESTAMP | KW_CURRENT_USER | KW_USER | KW_SESSION_USER)
|
||||
| name=(KW_TIMESTAMPADD | KW_DATEADD | KW_DATE_ADD) LEFT_PAREN (unit=datetimeUnit | invalidUnit=stringLit) COMMA unitsAmount=valueExpression COMMA timestamp=valueExpression RIGHT_PAREN
|
||||
| name=(KW_TIMESTAMPDIFF | KW_DATEDIFF | KW_DATE_DIFF | KW_TIMEDIFF) LEFT_PAREN (unit=datetimeUnit | invalidUnit=stringLit) COMMA startTimestamp=valueExpression COMMA endTimestamp=valueExpression RIGHT_PAREN
|
||||
| name=(KW_TIMESTAMPADD | KW_DATEADD | KW_DATE_ADD) LEFT_PAREN (
|
||||
unit=datetimeUnit
|
||||
| invalidUnit=stringLit
|
||||
) COMMA unitsAmount=valueExpression COMMA timestamp=valueExpression RIGHT_PAREN
|
||||
| name=(KW_TIMESTAMPDIFF | KW_DATEDIFF | KW_DATE_DIFF | KW_TIMEDIFF) LEFT_PAREN (
|
||||
unit=datetimeUnit
|
||||
| invalidUnit=stringLit
|
||||
) COMMA startTimestamp=valueExpression COMMA endTimestamp=valueExpression RIGHT_PAREN
|
||||
| KW_CASE whenClause+ (KW_ELSE elseExpression=expression)? KW_END
|
||||
| KW_CASE expression whenClause+ (KW_ELSE elseExpression=expression)? KW_END
|
||||
| name=(KW_CAST | KW_TRY_CAST) LEFT_PAREN expression KW_AS dataType RIGHT_PAREN
|
||||
@ -953,10 +971,9 @@ primaryExpression
|
||||
| LEFT_PAREN namedExpression (COMMA namedExpression)+ RIGHT_PAREN
|
||||
| LEFT_PAREN query RIGHT_PAREN
|
||||
| KW_IDENTIFIER LEFT_PAREN expression RIGHT_PAREN
|
||||
| functionName LEFT_PAREN (setQuantifier? functionArgument
|
||||
(COMMA functionArgument)*)? RIGHT_PAREN
|
||||
(KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN)?
|
||||
(nullsOption=(KW_IGNORE | KW_RESPECT) KW_NULLS)? ( KW_OVER windowSpec)?
|
||||
| functionName LEFT_PAREN (setQuantifier? functionArgument (COMMA functionArgument)*)? RIGHT_PAREN (
|
||||
KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN
|
||||
)? (nullsOption=(KW_IGNORE | KW_RESPECT) KW_NULLS)? (KW_OVER windowSpec)?
|
||||
| identifier ARROW expression
|
||||
| LEFT_PAREN identifier (COMMA identifier)+ RIGHT_PAREN ARROW expression
|
||||
| value=primaryExpression LEFT_BRACKET index=valueExpression RIGHT_BRACKET
|
||||
@ -964,20 +981,26 @@ primaryExpression
|
||||
| base=primaryExpression DOT fieldName=identifier
|
||||
| LEFT_PAREN expression RIGHT_PAREN
|
||||
| KW_EXTRACT LEFT_PAREN field=identifier KW_FROM source=valueExpression RIGHT_PAREN
|
||||
| (KW_SUBSTR | KW_SUBSTRING) LEFT_PAREN str=valueExpression (KW_FROM | COMMA) pos=valueExpression
|
||||
((KW_FOR | COMMA) len=valueExpression)? RIGHT_PAREN
|
||||
| KW_TRIM LEFT_PAREN trimOption=(KW_BOTH | KW_LEADING | KW_TRAILING)? (trimStr=valueExpression)?
|
||||
KW_FROM srcStr=valueExpression RIGHT_PAREN
|
||||
| KW_OVERLAY LEFT_PAREN input=valueExpression KW_PLACING replace=valueExpression
|
||||
KW_FROM position=valueExpression (KW_FOR length=valueExpression)? RIGHT_PAREN
|
||||
| name=(KW_PERCENTILE_CONT | KW_PERCENTILE_DISC) LEFT_PAREN percentage=valueExpression RIGHT_PAREN
|
||||
KW_WITHIN KW_GROUP LEFT_PAREN KW_ORDER KW_BY sortItem RIGHT_PAREN
|
||||
(KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN)? ( KW_OVER windowSpec)?
|
||||
| (KW_SUBSTR | KW_SUBSTRING) LEFT_PAREN str=valueExpression (KW_FROM | COMMA) pos=valueExpression (
|
||||
(KW_FOR | COMMA) len=valueExpression
|
||||
)? RIGHT_PAREN
|
||||
| KW_TRIM LEFT_PAREN trimOption=(KW_BOTH | KW_LEADING | KW_TRAILING)? (
|
||||
trimStr=valueExpression
|
||||
)? KW_FROM srcStr=valueExpression RIGHT_PAREN
|
||||
| KW_OVERLAY LEFT_PAREN input=valueExpression KW_PLACING replace=valueExpression KW_FROM position=valueExpression (
|
||||
KW_FOR length=valueExpression
|
||||
)? RIGHT_PAREN
|
||||
| name=(KW_PERCENTILE_CONT | KW_PERCENTILE_DISC) LEFT_PAREN percentage=valueExpression RIGHT_PAREN KW_WITHIN KW_GROUP LEFT_PAREN KW_ORDER KW_BY
|
||||
sortItem RIGHT_PAREN (KW_FILTER LEFT_PAREN KW_WHERE where=booleanExpression RIGHT_PAREN)? (
|
||||
KW_OVER windowSpec
|
||||
)?
|
||||
;
|
||||
|
||||
literalType
|
||||
: KW_DATE
|
||||
| KW_TIMESTAMP | KW_TIMESTAMP_LTZ | KW_TIMESTAMP_NTZ
|
||||
| KW_TIMESTAMP
|
||||
| KW_TIMESTAMP_LTZ
|
||||
| KW_TIMESTAMP_NTZ
|
||||
| KW_INTERVAL
|
||||
| KW_BINARY_HEX
|
||||
| unsupportedType=identifier
|
||||
@ -995,19 +1018,40 @@ constant
|
||||
;
|
||||
|
||||
comparisonOperator
|
||||
: EQ | NEQ | NEQJ | LT | LTE | GT | GTE | NSEQ
|
||||
: EQ
|
||||
| NEQ
|
||||
| NEQJ
|
||||
| LT
|
||||
| LTE
|
||||
| GT
|
||||
| GTE
|
||||
| NSEQ
|
||||
;
|
||||
|
||||
arithmeticOperator
|
||||
: PLUS | MINUS | ASTERISK | SLASH | PERCENT | KW_DIV | TILDE | AMPERSAND | PIPE | CONCAT_PIPE | HAT
|
||||
: PLUS
|
||||
| MINUS
|
||||
| ASTERISK
|
||||
| SLASH
|
||||
| PERCENT
|
||||
| KW_DIV
|
||||
| TILDE
|
||||
| AMPERSAND
|
||||
| PIPE
|
||||
| CONCAT_PIPE
|
||||
| HAT
|
||||
;
|
||||
|
||||
predicateOperator
|
||||
: KW_OR | KW_AND | KW_IN | KW_NOT
|
||||
: KW_OR
|
||||
| KW_AND
|
||||
| KW_IN
|
||||
| KW_NOT
|
||||
;
|
||||
|
||||
booleanValue
|
||||
: KW_TRUE | KW_FALSE
|
||||
: KW_TRUE
|
||||
| KW_FALSE
|
||||
;
|
||||
|
||||
interval
|
||||
@ -1031,42 +1075,76 @@ unitToUnitInterval
|
||||
;
|
||||
|
||||
intervalValue
|
||||
: (PLUS | MINUS)?
|
||||
(INTEGER_VALUE | DECIMAL_VALUE | stringLit)
|
||||
: (PLUS | MINUS)? (INTEGER_VALUE | DECIMAL_VALUE | stringLit)
|
||||
;
|
||||
|
||||
unitInMultiUnits
|
||||
: KW_NANOSECOND | KW_NANOSECONDS | KW_MICROSECOND | KW_MICROSECONDS | KW_MILLISECOND | KW_MILLISECONDS
|
||||
| KW_SECOND | KW_SECONDS | KW_MINUTE | KW_MINUTES | KW_HOUR | KW_HOURS | KW_DAY | KW_DAYS | KW_WEEK | KW_WEEKS
|
||||
| KW_MONTH | KW_MONTHS | KW_YEAR | KW_YEARS
|
||||
: KW_NANOSECOND
|
||||
| KW_NANOSECONDS
|
||||
| KW_MICROSECOND
|
||||
| KW_MICROSECONDS
|
||||
| KW_MILLISECOND
|
||||
| KW_MILLISECONDS
|
||||
| KW_SECOND
|
||||
| KW_SECONDS
|
||||
| KW_MINUTE
|
||||
| KW_MINUTES
|
||||
| KW_HOUR
|
||||
| KW_HOURS
|
||||
| KW_DAY
|
||||
| KW_DAYS
|
||||
| KW_WEEK
|
||||
| KW_WEEKS
|
||||
| KW_MONTH
|
||||
| KW_MONTHS
|
||||
| KW_YEAR
|
||||
| KW_YEARS
|
||||
;
|
||||
|
||||
unitInUnitToUnit
|
||||
: KW_SECOND | KW_MINUTE | KW_HOUR | KW_DAY | KW_MONTH | KW_YEAR
|
||||
: KW_SECOND
|
||||
| KW_MINUTE
|
||||
| KW_HOUR
|
||||
| KW_DAY
|
||||
| KW_MONTH
|
||||
| KW_YEAR
|
||||
;
|
||||
|
||||
colPosition
|
||||
: position=KW_FIRST | position=KW_AFTER afterCol=errorCapturingIdentifier
|
||||
: position=KW_FIRST
|
||||
| position=KW_AFTER afterCol=errorCapturingIdentifier
|
||||
;
|
||||
|
||||
type
|
||||
: KW_BOOLEAN
|
||||
| KW_TINYINT | KW_BYTE
|
||||
| KW_SMALLINT | KW_SHORT
|
||||
| KW_INT | KW_INTEGER
|
||||
| KW_BIGINT | KW_LONG
|
||||
| KW_FLOAT | KW_REAL
|
||||
| KW_TINYINT
|
||||
| KW_BYTE
|
||||
| KW_SMALLINT
|
||||
| KW_SHORT
|
||||
| KW_INT
|
||||
| KW_INTEGER
|
||||
| KW_BIGINT
|
||||
| KW_LONG
|
||||
| KW_FLOAT
|
||||
| KW_REAL
|
||||
| KW_DOUBLE
|
||||
| KW_DATE
|
||||
| KW_TIMESTAMP | KW_TIMESTAMP_NTZ | KW_TIMESTAMP_LTZ
|
||||
| KW_TIMESTAMP
|
||||
| KW_TIMESTAMP_NTZ
|
||||
| KW_TIMESTAMP_LTZ
|
||||
| KW_STRING
|
||||
| KW_CHARACTER | KW_CHAR
|
||||
| KW_CHARACTER
|
||||
| KW_CHAR
|
||||
| KW_VARCHAR
|
||||
| KW_BINARY
|
||||
| KW_DECIMAL | KW_DEC | KW_NUMERIC
|
||||
| KW_DECIMAL
|
||||
| KW_DEC
|
||||
| KW_NUMERIC
|
||||
| KW_VOID
|
||||
| KW_INTERVAL
|
||||
| KW_ARRAY | KW_STRUCT | KW_MAP
|
||||
| KW_ARRAY
|
||||
| KW_STRUCT
|
||||
| KW_MAP
|
||||
| unsupportedType=identifier
|
||||
;
|
||||
|
||||
@ -1075,10 +1153,10 @@ dataType
|
||||
| complex=KW_MAP LT dataType COMMA dataType GT
|
||||
| complex=KW_STRUCT (LT complexColTypeList? GT | NEQ)
|
||||
| KW_INTERVAL (KW_YEAR | KW_MONTH) (KW_TO KW_MONTH)?
|
||||
| KW_INTERVAL (KW_DAY | KW_HOUR | KW_MINUTE | KW_SECOND)
|
||||
(KW_TO (KW_HOUR | KW_MINUTE | KW_SECOND))?
|
||||
| type (LEFT_PAREN INTEGER_VALUE
|
||||
(COMMA INTEGER_VALUE)* RIGHT_PAREN)?
|
||||
| KW_INTERVAL (KW_DAY | KW_HOUR | KW_MINUTE | KW_SECOND) (
|
||||
KW_TO (KW_HOUR | KW_MINUTE | KW_SECOND)
|
||||
)?
|
||||
| type (LEFT_PAREN INTEGER_VALUE (COMMA INTEGER_VALUE)* RIGHT_PAREN)?
|
||||
;
|
||||
|
||||
qualifiedColTypeWithPositionSeqForAdd
|
||||
@ -1097,7 +1175,6 @@ qualifiedColTypeWithPositionForReplace
|
||||
: name=columnName dataType colDefinitionDescriptorWithPosition*
|
||||
;
|
||||
|
||||
|
||||
colDefinitionDescriptorWithPosition
|
||||
: KW_NOT KW_NULL
|
||||
| defaultExpression
|
||||
@ -1163,12 +1240,14 @@ namedWindow
|
||||
windowSpec
|
||||
: name=errorCapturingIdentifier
|
||||
| LEFT_PAREN name=errorCapturingIdentifier RIGHT_PAREN
|
||||
| LEFT_PAREN
|
||||
( KW_CLUSTER KW_BY partition+=expression (COMMA partition+=expression)*
|
||||
| ((KW_PARTITION | KW_DISTRIBUTE) KW_BY partition+=expression (COMMA partition+=expression)*)?
|
||||
((KW_ORDER | KW_SORT) KW_BY sortItem (COMMA sortItem)*)?)
|
||||
windowFrame?
|
||||
RIGHT_PAREN
|
||||
| LEFT_PAREN (
|
||||
KW_CLUSTER KW_BY partition+=expression (COMMA partition+=expression)*
|
||||
| (
|
||||
(KW_PARTITION | KW_DISTRIBUTE) KW_BY partition+=expression (
|
||||
COMMA partition+=expression
|
||||
)*
|
||||
)? ((KW_ORDER | KW_SORT) KW_BY sortItem (COMMA sortItem)*)?
|
||||
) windowFrame? RIGHT_PAREN
|
||||
;
|
||||
|
||||
/**
|
||||
|
File diff suppressed because it is too large
Load Diff
270
yarn.lock
270
yarn.lock
@ -17,6 +17,14 @@
|
||||
dependencies:
|
||||
"@babel/highlight" "^7.18.6"
|
||||
|
||||
"@babel/code-frame@^7.16.0":
|
||||
version "7.23.5"
|
||||
resolved "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244"
|
||||
integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==
|
||||
dependencies:
|
||||
"@babel/highlight" "^7.23.4"
|
||||
chalk "^2.4.2"
|
||||
|
||||
"@babel/compat-data@^7.22.0":
|
||||
version "7.22.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.3.tgz#cd502a6a0b6e37d7ad72ce7e71a7160a3ae36f7e"
|
||||
@ -134,6 +142,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"
|
||||
integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==
|
||||
|
||||
"@babel/helper-validator-identifier@^7.22.20":
|
||||
version "7.22.20"
|
||||
resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0"
|
||||
integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==
|
||||
|
||||
"@babel/helper-validator-option@^7.21.0":
|
||||
version "7.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180"
|
||||
@ -157,6 +170,15 @@
|
||||
chalk "^2.0.0"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@babel/highlight@^7.23.4":
|
||||
version "7.23.4"
|
||||
resolved "https://registry.npmmirror.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b"
|
||||
integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==
|
||||
dependencies:
|
||||
"@babel/helper-validator-identifier" "^7.22.20"
|
||||
chalk "^2.4.2"
|
||||
js-tokens "^4.0.0"
|
||||
|
||||
"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.9", "@babel/parser@^7.22.0", "@babel/parser@^7.22.4":
|
||||
version "7.22.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.4.tgz#a770e98fd785c231af9d93f6459d36770993fb32"
|
||||
@ -260,6 +282,13 @@
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.20.2"
|
||||
|
||||
"@babel/runtime@^7.21.0":
|
||||
version "7.23.6"
|
||||
resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.23.6.tgz#c05e610dc228855dc92ef1b53d07389ed8ab521d"
|
||||
integrity sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==
|
||||
dependencies:
|
||||
regenerator-runtime "^0.14.0"
|
||||
|
||||
"@babel/template@^7.20.7", "@babel/template@^7.21.9", "@babel/template@^7.3.3":
|
||||
version "7.21.9"
|
||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.21.9.tgz#bf8dad2859130ae46088a99c1f265394877446fb"
|
||||
@ -479,11 +508,28 @@
|
||||
dependencies:
|
||||
"@jridgewell/trace-mapping" "0.3.9"
|
||||
|
||||
"@humanwhocodes/momoa@^2.0.3":
|
||||
version "2.0.4"
|
||||
resolved "https://registry.npmmirror.com/@humanwhocodes/momoa/-/momoa-2.0.4.tgz#8b9e7a629651d15009c3587d07a222deeb829385"
|
||||
integrity sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==
|
||||
|
||||
"@hutson/parse-repository-url@^3.0.0":
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340"
|
||||
integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==
|
||||
|
||||
"@isaacs/cliui@^8.0.2":
|
||||
version "8.0.2"
|
||||
resolved "https://registry.npmmirror.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550"
|
||||
integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==
|
||||
dependencies:
|
||||
string-width "^5.1.2"
|
||||
string-width-cjs "npm:string-width@^4.2.0"
|
||||
strip-ansi "^7.0.1"
|
||||
strip-ansi-cjs "npm:strip-ansi@^6.0.1"
|
||||
wrap-ansi "^8.1.0"
|
||||
wrap-ansi-cjs "npm:wrap-ansi@^7.0.0"
|
||||
|
||||
"@istanbuljs/load-nyc-config@^1.0.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
|
||||
@ -760,6 +806,24 @@
|
||||
"@jridgewell/resolve-uri" "3.1.0"
|
||||
"@jridgewell/sourcemap-codec" "1.4.14"
|
||||
|
||||
"@pkgjs/parseargs@^0.11.0":
|
||||
version "0.11.0"
|
||||
resolved "https://registry.npmmirror.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
|
||||
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
|
||||
|
||||
"@readme/better-ajv-errors@1.6.0":
|
||||
version "1.6.0"
|
||||
resolved "https://registry.npmmirror.com/@readme/better-ajv-errors/-/better-ajv-errors-1.6.0.tgz#cf96740bd71d256ed628f3a7466ecae0846edd62"
|
||||
integrity sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ==
|
||||
dependencies:
|
||||
"@babel/code-frame" "^7.16.0"
|
||||
"@babel/runtime" "^7.21.0"
|
||||
"@humanwhocodes/momoa" "^2.0.3"
|
||||
chalk "^4.1.2"
|
||||
json-to-ast "^2.0.3"
|
||||
jsonpointer "^5.0.0"
|
||||
leven "^3.1.0"
|
||||
|
||||
"@sinclair/typebox@^0.25.16":
|
||||
version "0.25.24"
|
||||
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718"
|
||||
@ -940,6 +1004,11 @@
|
||||
expect "^29.0.0"
|
||||
pretty-format "^29.0.0"
|
||||
|
||||
"@types/json-schema@^7.0.12":
|
||||
version "7.0.15"
|
||||
resolved "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
|
||||
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
||||
|
||||
"@types/minimist@^1.2.0":
|
||||
version "1.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c"
|
||||
@ -1025,7 +1094,7 @@ aggregate-error@^3.0.0:
|
||||
clean-stack "^2.0.0"
|
||||
indent-string "^4.0.0"
|
||||
|
||||
ajv@^8.11.0:
|
||||
ajv@8.12.0, ajv@^8.11.0:
|
||||
version "8.12.0"
|
||||
resolved "https://registry.npmmirror.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1"
|
||||
integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==
|
||||
@ -1071,11 +1140,23 @@ ansi-styles@^5.0.0:
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
|
||||
integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==
|
||||
|
||||
ansi-styles@^6.0.0:
|
||||
ansi-styles@^6.0.0, ansi-styles@^6.1.0:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
|
||||
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==
|
||||
|
||||
antlr-format-cli@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.npmmirror.com/antlr-format-cli/-/antlr-format-cli-1.2.1.tgz#285ad653551ad8821e7685f2b44199f838113bbb"
|
||||
integrity sha512-vqpoL9x3bXiNnC/vzZG3XOyk2vUAHPmBbI/ufyAqbxQHD27OPuUM4n/6m6NBEZZ7V4U2aEiefnZg2SCaSU89oA==
|
||||
dependencies:
|
||||
"@readme/better-ajv-errors" "1.6.0"
|
||||
ajv "8.12.0"
|
||||
antlr4ng "2.0.2"
|
||||
commander "11.1.0"
|
||||
glob "10.3.10"
|
||||
ts-json-schema-generator "1.4.0"
|
||||
|
||||
antlr4-c3@3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.npmmirror.com/antlr4-c3/-/antlr4-c3-3.1.1.tgz#f3d579e17c925d9e3cc984ed0ecb5095fce1611f"
|
||||
@ -1083,6 +1164,11 @@ antlr4-c3@3.1.1:
|
||||
dependencies:
|
||||
antlr4ts "0.5.0-alpha.4"
|
||||
|
||||
antlr4ng@2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.npmmirror.com/antlr4ng/-/antlr4ng-2.0.2.tgz#31d224cc45e578b78ef77fccf9316d133d7cc81c"
|
||||
integrity sha512-Fhs3AvhoGigRt3RpHw0wGA7n03j9BpskH9yCUViNB7NtKuCA+imy2orEZ8qcgPG98f7IryEPYlG9sx99f3ZOyw==
|
||||
|
||||
antlr4ts-cli@^0.5.0-alpha.4:
|
||||
version "0.5.0-alpha.4"
|
||||
resolved "https://registry.yarnpkg.com/antlr4ts-cli/-/antlr4ts-cli-0.5.0-alpha.4.tgz#f3bfc37f10131e78d7b981c397a2aaa0450b67f6"
|
||||
@ -1225,6 +1311,13 @@ brace-expansion@^1.1.7:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
brace-expansion@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
|
||||
integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
|
||||
braces@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
|
||||
@ -1296,7 +1389,7 @@ caniuse-lite@^1.0.30001489:
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001491.tgz#eab0e0f392de6f7411751d148de9b5bd6b203e46"
|
||||
integrity sha512-17EYIi4TLnPiTzVKMveIxU5ETlxbSO3B6iPvMbprqnKh4qJsQGk5Nh1Lp4jIMAE0XfrujsJuWZAM3oJdMHaKBA==
|
||||
|
||||
chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1:
|
||||
chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
||||
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
|
||||
@ -1399,6 +1492,11 @@ co@^4.6.0:
|
||||
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
|
||||
integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==
|
||||
|
||||
code-error-fragment@0.0.230:
|
||||
version "0.0.230"
|
||||
resolved "https://registry.npmmirror.com/code-error-fragment/-/code-error-fragment-0.0.230.tgz#d736d75c832445342eca1d1fedbf17d9618b14d7"
|
||||
integrity sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==
|
||||
|
||||
collect-v8-coverage@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59"
|
||||
@ -1433,6 +1531,11 @@ colorette@^2.0.16:
|
||||
resolved "https://registry.npmmirror.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a"
|
||||
integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==
|
||||
|
||||
commander@11.1.0, commander@^11.0.0:
|
||||
version "11.1.0"
|
||||
resolved "https://registry.npmmirror.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906"
|
||||
integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==
|
||||
|
||||
commander@^9.3.0:
|
||||
version "9.5.0"
|
||||
resolved "https://registry.npmmirror.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30"
|
||||
@ -1708,7 +1811,7 @@ create-require@^1.1.0:
|
||||
resolved "https://registry.npmmirror.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
|
||||
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
|
||||
|
||||
cross-spawn@^7.0.3:
|
||||
cross-spawn@^7.0.0, cross-spawn@^7.0.3:
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
|
||||
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
|
||||
@ -2001,6 +2104,14 @@ findup-sync@^4.0.0:
|
||||
micromatch "^4.0.2"
|
||||
resolve-dir "^1.0.1"
|
||||
|
||||
foreground-child@^3.1.0:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.npmmirror.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d"
|
||||
integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==
|
||||
dependencies:
|
||||
cross-spawn "^7.0.0"
|
||||
signal-exit "^4.0.1"
|
||||
|
||||
fs-extra@9.1.0:
|
||||
version "9.1.0"
|
||||
resolved "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
|
||||
@ -2099,6 +2210,17 @@ gitconfiglocal@^1.0.0:
|
||||
dependencies:
|
||||
ini "^1.3.2"
|
||||
|
||||
glob@10.3.10, glob@^10.3.10:
|
||||
version "10.3.10"
|
||||
resolved "https://registry.npmmirror.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b"
|
||||
integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==
|
||||
dependencies:
|
||||
foreground-child "^3.1.0"
|
||||
jackspeak "^2.3.5"
|
||||
minimatch "^9.0.1"
|
||||
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||
path-scurry "^1.10.1"
|
||||
|
||||
glob@7.2.3, glob@^7.1.3, glob@^7.1.4:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
@ -2111,6 +2233,17 @@ glob@7.2.3, glob@^7.1.3, glob@^7.1.4:
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^8.0.3:
|
||||
version "8.1.0"
|
||||
resolved "https://registry.npmmirror.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e"
|
||||
integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^5.0.1"
|
||||
once "^1.3.0"
|
||||
|
||||
global-dirs@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.npmmirror.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445"
|
||||
@ -2148,6 +2281,11 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9:
|
||||
resolved "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
|
||||
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
|
||||
|
||||
grapheme-splitter@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.npmmirror.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
|
||||
integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==
|
||||
|
||||
handlebars@^4.7.7:
|
||||
version "4.7.7"
|
||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
|
||||
@ -2452,6 +2590,15 @@ istanbul-reports@^3.1.3:
|
||||
html-escaper "^2.0.0"
|
||||
istanbul-lib-report "^3.0.0"
|
||||
|
||||
jackspeak@^2.3.5:
|
||||
version "2.3.6"
|
||||
resolved "https://registry.npmmirror.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8"
|
||||
integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==
|
||||
dependencies:
|
||||
"@isaacs/cliui" "^8.0.2"
|
||||
optionalDependencies:
|
||||
"@pkgjs/parseargs" "^0.11.0"
|
||||
|
||||
jest-changed-files@^29.5.0:
|
||||
version "29.5.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e"
|
||||
@ -2858,9 +3005,17 @@ json-stringify-safe@^5.0.1:
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==
|
||||
|
||||
json5@^2.2.2:
|
||||
json-to-ast@^2.0.3:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.npmmirror.com/json-to-ast/-/json-to-ast-2.1.0.tgz#041a9fcd03c0845036acb670d29f425cea4faaf9"
|
||||
integrity sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==
|
||||
dependencies:
|
||||
code-error-fragment "0.0.230"
|
||||
grapheme-splitter "^1.0.4"
|
||||
|
||||
json5@^2.2.2, json5@^2.2.3:
|
||||
version "2.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
|
||||
resolved "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
|
||||
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
|
||||
|
||||
jsonc-parser@^3.2.0:
|
||||
@ -2882,6 +3037,11 @@ jsonparse@^1.2.0:
|
||||
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
|
||||
integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==
|
||||
|
||||
jsonpointer@^5.0.0:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.npmmirror.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559"
|
||||
integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==
|
||||
|
||||
kind-of@^6.0.3:
|
||||
version "6.0.3"
|
||||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
|
||||
@ -3083,6 +3243,11 @@ lru-cache@^6.0.0:
|
||||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
"lru-cache@^9.1.1 || ^10.0.0":
|
||||
version "10.1.0"
|
||||
resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484"
|
||||
integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==
|
||||
|
||||
make-dir@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
|
||||
@ -3164,6 +3329,20 @@ minimatch@^3.0.4, minimatch@^3.1.1:
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimatch@^5.0.1:
|
||||
version "5.1.6"
|
||||
resolved "https://registry.npmmirror.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96"
|
||||
integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==
|
||||
dependencies:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimatch@^9.0.1:
|
||||
version "9.0.3"
|
||||
resolved "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
|
||||
integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==
|
||||
dependencies:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimist-options@4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619"
|
||||
@ -3183,6 +3362,11 @@ minimist@^1.2.5, minimist@^1.2.6:
|
||||
resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
|
||||
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
|
||||
|
||||
"minipass@^5.0.0 || ^6.0.2 || ^7.0.0":
|
||||
version "7.0.4"
|
||||
resolved "https://registry.npmmirror.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c"
|
||||
integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==
|
||||
|
||||
modify-values@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"
|
||||
@ -3410,6 +3594,14 @@ path-parse@^1.0.7:
|
||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
|
||||
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
|
||||
|
||||
path-scurry@^1.10.1:
|
||||
version "1.10.1"
|
||||
resolved "https://registry.npmmirror.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698"
|
||||
integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==
|
||||
dependencies:
|
||||
lru-cache "^9.1.1 || ^10.0.0"
|
||||
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||
|
||||
path-type@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
|
||||
@ -3577,6 +3769,11 @@ redent@^3.0.0:
|
||||
indent-string "^4.0.0"
|
||||
strip-indent "^3.0.0"
|
||||
|
||||
regenerator-runtime@^0.14.0:
|
||||
version "0.14.0"
|
||||
resolved "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45"
|
||||
integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==
|
||||
|
||||
require-directory@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
@ -3668,6 +3865,11 @@ safe-buffer@~5.2.0:
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
|
||||
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
|
||||
|
||||
safe-stable-stringify@^2.4.3:
|
||||
version "2.4.3"
|
||||
resolved "https://registry.npmmirror.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886"
|
||||
integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==
|
||||
|
||||
"safer-buffer@>= 2.1.2 < 3":
|
||||
version "2.1.2"
|
||||
resolved "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
@ -3714,6 +3916,11 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7:
|
||||
resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
|
||||
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
|
||||
|
||||
signal-exit@^4.0.1:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04"
|
||||
integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==
|
||||
|
||||
sisteransi@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
|
||||
@ -3848,6 +4055,15 @@ string-length@^4.0.1:
|
||||
char-regex "^1.0.2"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
"string-width-cjs@npm:string-width@^4.2.0":
|
||||
version "4.2.3"
|
||||
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
@ -3857,7 +4073,7 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
string-width@^5.0.0:
|
||||
string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
|
||||
integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==
|
||||
@ -3885,6 +4101,13 @@ stringify-package@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85"
|
||||
integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==
|
||||
|
||||
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
|
||||
version "6.0.1"
|
||||
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
@ -4020,6 +4243,19 @@ trim-newlines@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
|
||||
integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==
|
||||
|
||||
ts-json-schema-generator@1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.npmmirror.com/ts-json-schema-generator/-/ts-json-schema-generator-1.4.0.tgz#f341b36792c372d3d09245414a4f3a6efa2697f8"
|
||||
integrity sha512-wm8vyihmGgYpxrqRshmYkWGNwEk+sf3xV2rUgxv8Ryeh7bSpMO7pZQOht+2rS002eDkFTxR7EwRPXVzrS0WJTg==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.12"
|
||||
commander "^11.0.0"
|
||||
glob "^8.0.3"
|
||||
json5 "^2.2.3"
|
||||
normalize-path "^3.0.0"
|
||||
safe-stable-stringify "^2.4.3"
|
||||
typescript "~5.2.2"
|
||||
|
||||
ts-node@^10.8.1:
|
||||
version "10.9.1"
|
||||
resolved "https://registry.npmmirror.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b"
|
||||
@ -4074,7 +4310,7 @@ typedarray@^0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==
|
||||
|
||||
"typescript@^4.6.4 || ^5.0.0":
|
||||
"typescript@^4.6.4 || ^5.0.0", typescript@~5.2.2:
|
||||
version "5.2.2"
|
||||
resolved "https://registry.npmmirror.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
|
||||
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
|
||||
@ -4174,6 +4410,15 @@ wordwrap@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
|
||||
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==
|
||||
|
||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
|
||||
version "6.2.0"
|
||||
resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53"
|
||||
@ -4192,6 +4437,15 @@ wrap-ansi@^7.0.0:
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrap-ansi@^8.1.0:
|
||||
version "8.1.0"
|
||||
resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
|
||||
integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==
|
||||
dependencies:
|
||||
ansi-styles "^6.1.0"
|
||||
string-width "^5.0.1"
|
||||
strip-ansi "^7.0.1"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
|
Loading…
Reference in New Issue
Block a user