Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/15423#discussion_r82744230
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala ---
@@ -168,17 +168,7 @@ class SparkSqlAstBuilder(conf: SQLConf) extends
AstBuilder {
* }}}
*/
override def visitShowColumns(ctx: ShowColumnsContext): LogicalPlan =
withOrigin(ctx) {
- val table = visitTableIdentifier(ctx.tableIdentifier)
-
- val lookupTable = Option(ctx.db) match {
- case None => table
- case Some(db) if table.database.exists(_ != db) =>
- operationNotAllowed(
- s"SHOW COLUMNS with conflicting databases: '$db' !=
'${table.database.get}'",
- ctx)
- case Some(db) => TableIdentifier(table.identifier, Some(db.getText))
- }
- ShowColumnsCommand(lookupTable)
+ ShowColumnsCommand(Option(ctx.db).map(_.getText),
visitTableIdentifier(ctx.tableIdentifier))
--- End diff --
FYI, MySQL will treat `SHOW COLUMNS FROM db1.tbl1 FROM db2` as `SHOW
COLUMNS FROM tbl1 FROM db2`, i.e. if `FROM database` is specified, it will just
ignore the database specified in table name, instead of reporting error.
---
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]