File tree Expand file tree Collapse file tree 3 files changed +31
-6
lines changed
catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser
compatibility/src/test/scala/org/apache/spark/sql/hive/execution
src/test/scala/org/apache/spark/sql/hive/execution Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ hiveNativeCommands
146146 | ROLLBACK WORK ?
147147 | SHOW PARTITIONS tableIdentifier partitionSpec?
148148 | DFS .*?
149- | (CREATE | ALTER | DROP | SHOW | DESC | DESCRIBE | LOCK | UNLOCK | MSCK | LOAD ) .*?
149+ | (CREATE | ALTER | DROP | SHOW | DESC | DESCRIBE | MSCK | LOAD ) .*?
150150 ;
151151
152152unsupportedHiveNativeCommands
@@ -166,6 +166,13 @@ unsupportedHiveNativeCommands
166166 | kw1=SHOW kw2=TRANSACTIONS
167167 | kw1=SHOW kw2=INDEXES
168168 | kw1=SHOW kw2=LOCKS
169+ | kw1=CREATE kw2=INDEX
170+ | kw1=DROP kw2=INDEX
171+ | kw1=ALTER kw2=INDEX
172+ | kw1=LOCK kw2=TABLE
173+ | kw1=LOCK kw2=DATABASE
174+ | kw1=UNLOCK kw2=TABLE
175+ | kw1=UNLOCK kw2=DATABASE
169176 ;
170177
171178createTableHeader
@@ -640,7 +647,7 @@ nonReserved
640647 | INPUTDRIVER | OUTPUTDRIVER | DBPROPERTIES | DFS | TRUNCATE | METADATA | REPLICATION | COMPUTE
641648 | STATISTICS | ANALYZE | PARTITIONED | EXTERNAL | DEFINED | RECORDWRITER
642649 | REVOKE | GRANT | LOCK | UNLOCK | MSCK | EXPORT | IMPORT | LOAD | VALUES | COMMENT | ROLE
643- | ROLES | COMPACTIONS | PRINCIPALS | TRANSACTIONS | INDEXES | LOCKS | OPTION
650+ | ROLES | COMPACTIONS | PRINCIPALS | TRANSACTIONS | INDEX | INDEXES | LOCKS | OPTION
644651 ;
645652
646653SELECT : ' SELECT' ;
@@ -861,6 +868,7 @@ ROLES: 'ROLES';
861868COMPACTIONS : ' COMPACTIONS' ;
862869PRINCIPALS : ' PRINCIPALS' ;
863870TRANSACTIONS : ' TRANSACTIONS' ;
871+ INDEX : ' INDEX' ;
864872INDEXES : ' INDEXES' ;
865873LOCKS : ' LOCKS' ;
866874OPTION : ' OPTION' ;
Original file line number Diff line number Diff line change @@ -352,7 +352,12 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
352352 " show_create_table_index" ,
353353 " show_create_table_partitioned" ,
354354 " show_create_table_serde" ,
355- " show_create_table_view"
355+ " show_create_table_view" ,
356+
357+ // Index commands are not supported
358+ " drop_index" ,
359+ " drop_index_removes_partition_dirs" ,
360+ " alter_index"
356361 )
357362
358363 /**
@@ -369,7 +374,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
369374 " alter3" ,
370375 " alter4" ,
371376 " alter5" ,
372- " alter_index" ,
373377 " alter_merge_2" ,
374378 " alter_partition_format_loc" ,
375379 " alter_partition_with_whitelist" ,
@@ -496,8 +500,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter {
496500 " distinct_stats" ,
497501 " drop_database_removes_partition_dirs" ,
498502 " drop_function" ,
499- " drop_index" ,
500- " drop_index_removes_partition_dirs" ,
501503 " drop_multi_partitions" ,
502504 " drop_partitions_filter" ,
503505 " drop_partitions_filter2" ,
Original file line number Diff line number Diff line change @@ -1280,6 +1280,21 @@ class HiveQuerySuite extends HiveComparisonTest with BeforeAndAfter {
12801280 assertUnsupportedFeature { sql(" SHOW LOCKS my_table" ) }
12811281 }
12821282
1283+ test(" lock/unlock table and database commands are not supported" ) {
1284+ assertUnsupportedFeature { sql(" LOCK TABLE my_table SHARED" ) }
1285+ assertUnsupportedFeature { sql(" UNLOCK TABLE my_table" ) }
1286+ assertUnsupportedFeature { sql(" LOCK DATABASE my_db SHARED" ) }
1287+ assertUnsupportedFeature { sql(" UNLOCK DATABASE my_db" ) }
1288+ }
1289+
1290+ test(" create/drop/alter index commands are not supported" ) {
1291+ assertUnsupportedFeature {
1292+ sql(" CREATE INDEX my_index ON TABLE my_table(a) as 'COMPACT' WITH DEFERRED REBUILD" )}
1293+ assertUnsupportedFeature { sql(" DROP INDEX my_index ON my_table" ) }
1294+ assertUnsupportedFeature { sql(" ALTER INDEX my_index ON my_table REBUILD" )}
1295+ assertUnsupportedFeature {
1296+ sql(" ALTER INDEX my_index ON my_table set IDXPROPERTIES (\" prop1\" =\" val1_new\" )" )}
1297+ }
12831298}
12841299
12851300// for SPARK-2180 test
You can’t perform that action at this time.
0 commit comments