Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15423#discussion_r83777778
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala ---
    @@ -651,14 +651,28 @@ case class ShowTablePropertiesCommand(table: 
TableIdentifier, propertyKey: Optio
      *   SHOW COLUMNS (FROM | IN) table_identifier [(FROM | IN) database];
      * }}}
      */
    -case class ShowColumnsCommand(tableName: TableIdentifier) extends 
RunnableCommand {
    +case class ShowColumnsCommand(
    +    databaseName: Option[String],
    +    tableName: TableIdentifier) extends RunnableCommand {
       override val output: Seq[Attribute] = {
         AttributeReference("col_name", StringType, nullable = false)() :: Nil
       }
     
    +  private def nameEqual(name1: String, name2: String, caseSensitive: 
Boolean): Boolean = {
    +    if (caseSensitive) name1 == name2 else name1.equalsIgnoreCase(name2)
    +  }
    +
       override def run(sparkSession: SparkSession): Seq[Row] = {
         val catalog = sparkSession.sessionState.catalog
    -    val table = catalog.getTempViewOrPermanentTableMetadata(tableName)
    +    val caseSensitive = 
sparkSession.sessionState.conf.caseSensitiveAnalysis
    --- End diff --
    
    nit: we can simplify it to
    ```
    val resolver = sparkSession.sessionState.conf.resolver
    ...
    case Some(db) if tableName.database.exists(!resolver(_, db))
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to