Github user cloud-fan commented on a diff in the pull request:
    --- 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' != 
    -          ctx)
    -      case Some(db) => TableIdentifier(table.identifier, Some(db.getText))
    -    }
    -    ShowColumnsCommand(lookupTable)
    +    ShowColumnsCommand(Option(ctx.db).map(_.getText), 
    --- 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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to