Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/14116#discussion_r71823733
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
---
@@ -471,6 +480,34 @@ class SessionCatalog(
}
/**
+ * Normalize TableIdentifier by consistently ensuring the following two
rules.
+ * 1. System-side temporary tables should have None as database.
+ * 2. System-side temporary tables should have prefixed table names.
+ * Currently, only INFORMATION_SCHEMA tables are system-side temporary
tables, and this function
+ * returns TableIdentifier("information_schema.databases", None).
+ */
+ protected def normalizeTableIdentifier(name: TableIdentifier):
TableIdentifier = synchronized {
+ if (name.database.isDefined) {
+ if (name.database.contains(INFORMATION_SCHEMA_DATABASE)) {
+ TableIdentifier(s"$INFORMATION_SCHEMA_DATABASE.${name.table}",
None)
+ } else {
+ name
+ }
+ } else {
+ val tableName = formatTableName(name.table)
+ if (tableName.startsWith(INFORMATION_SCHEMA_DATABASE + ".")) {
--- End diff --
Backtick-quoted one will not reach here.
```
scala> sql("create table `aaa.bbb`(a int)")
org.apache.spark.sql.AnalysisException:
org.apache.hadoop.hive.ql.metadata.HiveException:
org.apache.hadoop.hive.ql.metadata.HiveException: [aaa.bbb]: is not a valid
table name;
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]