Github user dilipbiswal commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15423#discussion_r82818691
  
    --- 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 --
    
    Thanks @viirya for checking hive. Yeah, when we implemented the SHOW 
columns native command, wde went through the the above hive code. We decided to 
improve up on the above check and report an error only when the database names 
are different. 


---
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]

Reply via email to