Skip to content

Commit 31ae9d5

Browse files
Addresses Herman review comments, and fixes test failures
1 parent 445cee2 commit 31ae9d5

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ hiveNativeCommands
149149
| ROLLBACK WORK?
150150
| SHOW PARTITIONS tableIdentifier partitionSpec?
151151
| DFS .*?
152-
| (CREATE | ALTER | DROP | SHOW | DESC | DESCRIBE | LOCK | UNLOCK | MSCK | LOAD) .*?
152+
| (CREATE | ALTER | DROP | SHOW | DESC | DESCRIBE | MSCK | LOAD) .*?
153153
;
154154

155155
unsupportedHiveNativeCommands
@@ -171,9 +171,11 @@ unsupportedHiveNativeCommands
171171
| kw1=SHOW kw2=LOCKS
172172
| kw1=CREATE kw2=INDEX
173173
| kw1=DROP kw2=INDEX
174+
| kw1=ALTER kw2=INDEX
174175
| kw1=LOCK kw2=TABLE
176+
| kw1=LOCK kw2=DATABASE
175177
| kw1=UNLOCK kw2=TABLE
176-
| kw1=ALTER kw2=INDEX
178+
| kw1=UNLOCK kw2=DATABASE
177179
;
178180

179181
createTableHeader
@@ -648,7 +650,7 @@ nonReserved
648650
| INPUTDRIVER | OUTPUTDRIVER | DBPROPERTIES | DFS | TRUNCATE | METADATA | REPLICATION | COMPUTE
649651
| STATISTICS | ANALYZE | PARTITIONED | EXTERNAL | DEFINED | RECORDWRITER
650652
| REVOKE | GRANT | LOCK | UNLOCK | MSCK | EXPORT | IMPORT | LOAD | VALUES | COMMENT | ROLE
651-
| ROLES | COMPACTIONS | PRINCIPALS | TRANSACTIONS | INDEXES | LOCKS | OPTION
653+
| ROLES | COMPACTIONS | PRINCIPALS | TRANSACTIONS | INDEX | INDEXES | LOCKS | OPTION
652654
;
653655

654656
SELECT: 'SELECT';

sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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",

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,9 +1280,11 @@ class HiveQuerySuite extends HiveComparisonTest with BeforeAndAfter {
12801280
assertUnsupportedFeature { sql("SHOW LOCKS my_table") }
12811281
}
12821282

1283-
test("lock/unlock table commands are not supported") {
1283+
test("lock/unlock table and database commands are not supported") {
12841284
assertUnsupportedFeature { sql("LOCK TABLE my_table SHARED") }
12851285
assertUnsupportedFeature { sql("UNLOCK TABLE my_table") }
1286+
assertUnsupportedFeature { sql("LOCK DATABASE my_db SHARED") }
1287+
assertUnsupportedFeature { sql("UNLOCK DATABASE my_db") }
12861288
}
12871289

12881290
test("create/drop/alter index commands are not supported") {

0 commit comments

Comments
 (0)