diff --git a/common/build.gradle b/common/build.gradle index 66845e0966..bf1935e64f 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -41,7 +41,7 @@ dependencies { implementation 'com.github.babbel:okhttp-aws-signer:1.0.2' api group: 'com.amazonaws', name: 'aws-java-sdk-core', version: "${aws_java_sdk_version}" api group: 'com.amazonaws', name: 'aws-java-sdk-sts', version: "${aws_java_sdk_version}" - implementation "com.github.seancfoley:ipaddress:5.4.0" + implementation "com.github.seancfoley:ipaddress:5.4.2" testImplementation group: 'junit', name: 'junit', version: '4.13.2' testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1' diff --git a/spark/src/main/antlr/FlintSparkSqlExtensions.g4 b/spark/src/main/antlr/FlintSparkSqlExtensions.g4 index 4de5bfaa66..219bbe782b 100644 --- a/spark/src/main/antlr/FlintSparkSqlExtensions.g4 +++ b/spark/src/main/antlr/FlintSparkSqlExtensions.g4 @@ -18,6 +18,7 @@ statement : skippingIndexStatement | coveringIndexStatement | materializedViewStatement + | indexManagementStatement | indexJobManagementStatement ; @@ -125,6 +126,14 @@ vacuumMaterializedViewStatement : VACUUM MATERIALIZED VIEW mvName=multipartIdentifier ; +indexManagementStatement + : showFlintIndexStatement + ; + +showFlintIndexStatement + : SHOW FLINT (INDEX | INDEXES) IN catalogDb=multipartIdentifier + ; + indexJobManagementStatement : recoverIndexJobStatement ; diff --git a/spark/src/main/antlr/SparkSqlBase.g4 b/spark/src/main/antlr/SparkSqlBase.g4 index 82c890a618..01f45016d6 100644 --- a/spark/src/main/antlr/SparkSqlBase.g4 +++ b/spark/src/main/antlr/SparkSqlBase.g4 @@ -161,6 +161,7 @@ DESCRIBE: 'DESCRIBE'; DROP: 'DROP'; EXISTS: 'EXISTS'; FALSE: 'FALSE'; +FLINT: 'FLINT'; IF: 'IF'; IN: 'IN'; INDEX: 'INDEX'; diff --git a/spark/src/main/antlr/SqlBaseParser.g4 b/spark/src/main/antlr/SqlBaseParser.g4 index 737d5196e7..07fa56786b 100644 --- a/spark/src/main/antlr/SqlBaseParser.g4 +++ b/spark/src/main/antlr/SqlBaseParser.g4 @@ -989,6 +989,7 @@ primaryExpression | CASE whenClause+ (ELSE elseExpression=expression)? END #searchedCase | CASE value=expression whenClause+ (ELSE elseExpression=expression)? END #simpleCase | name=(CAST | TRY_CAST) LEFT_PAREN expression AS dataType RIGHT_PAREN #cast + | primaryExpression collateClause #collate | primaryExpression DOUBLE_COLON dataType #castByColon | STRUCT LEFT_PAREN (argument+=namedExpression (COMMA argument+=namedExpression)*)? RIGHT_PAREN #struct | FIRST LEFT_PAREN expression (IGNORE NULLS)? RIGHT_PAREN #first @@ -1094,6 +1095,10 @@ colPosition : position=FIRST | position=AFTER afterCol=errorCapturingIdentifier ; +collateClause + : COLLATE collationName=stringLit + ; + type : BOOLEAN | TINYINT | BYTE @@ -1104,7 +1109,7 @@ type | DOUBLE | DATE | TIMESTAMP | TIMESTAMP_NTZ | TIMESTAMP_LTZ - | STRING + | STRING collateClause? | CHARACTER | CHAR | VARCHAR | BINARY