You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2022/06/06 11:41:00 UTC

[jira] [Resolved] (SPARK-39337) Refactor DescribeTableExec

     [ https://issues.apache.org/jira/browse/SPARK-39337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon resolved SPARK-39337.
----------------------------------
    Resolution: Later

> Refactor DescribeTableExec
> --------------------------
>
>                 Key: SPARK-39337
>                 URL: https://issues.apache.org/jira/browse/SPARK-39337
>             Project: Spark
>          Issue Type: Task
>          Components: SQL
>    Affects Versions: 3.3.0
>            Reporter: angerszhu
>            Priority: Major
>
> Repeated code, refactor the code.
> {code:java}
>   private def addTableDetails(rows: ArrayBuffer[InternalRow]): Unit = {
>     rows += emptyRow()
>     rows += toCatalystRow("# Detailed Table Information", "", "")
>     rows += toCatalystRow("Name", table.name(), "")
>     CatalogV2Util.TABLE_RESERVED_PROPERTIES.foreach(propKey => {
>       if (table.properties.containsKey(propKey)) {
>         rows += toCatalystRow(propKey.capitalize, table.properties.get(propKey), "")
>       }
>     })
>     val properties =
>       table.properties.asScala.toList
>         .filter(kv => !CatalogV2Util.TABLE_RESERVED_PROPERTIES.contains(kv._1))
>         .sortBy(_._1).map {
>         case (key, value) => key + "=" + value
>       }.mkString("[", ",", "]")
>     rows += toCatalystRow("Table Properties", properties, "")
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org