You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/05/30 08:24:00 UTC

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

    [ https://issues.apache.org/jira/browse/SPARK-39337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543812#comment-17543812 ] 

Apache Spark commented on SPARK-39337:
--------------------------------------

User 'AngersZhuuuu' has created a pull request for this issue:
https://github.com/apache/spark/pull/36723

> 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