-
- Downloads
[SPARK-13454][SQL] Allow users to drop a table with a name starting with an underscore.
## What changes were proposed in this pull request? This change adds a workaround to allow users to drop a table with a name starting with an underscore. Without this patch, we can create such a table, but we cannot drop it. The reason is that Hive's parser unquote an quoted identifier (see https://github.com/apache/hive/blob/release-1.2.1/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g#L453). So, when we issue a drop table command to Hive, a table name starting with an underscore is actually not quoted. Then, Hive will complain about it because it does not support a table name starting with an underscore without using backticks (underscores are allowed as long as it is not the first char though). ## How was this patch tested? Add a test to make sure we can drop a table with a name starting with an underscore. https://issues.apache.org/jira/browse/SPARK-13454 Author: Yin Huai <yhuai@databricks.com> Closes #11349 from yhuai/fixDropTable.
Showing
- sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/commands.scala 18 additions, 2 deletions.../scala/org/apache/spark/sql/hive/execution/commands.scala
- sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala 21 additions, 0 deletions...org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala
Please register or sign in to comment