You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2016/05/12 04:41:19 UTC

[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

GitHub user gatorsmile opened a pull request:

    https://github.com/apache/spark/pull/13070

    [SPARK-15286] [SQL] Make the output readable for EXPLAIN CREATE TABLE and DESC EXTENDED

    #### What changes were proposed in this pull request?
    Before this PR, the output of EXPLAIN of following SQL is like
    
    ```SQL
    CREATE EXTERNAL TABLE extTable_with_partitions (key INT, value STRING)
    PARTITIONED BY (ds STRING, hr STRING)
    LOCATION '/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/spark-b39a6185-8981-403b-a4aa-36fb2f4ca8a9'
    ```
    `ExecutedCommand CreateTable CatalogTable(``extTable_with_partitions``,CatalogTableType(EXTERNAL),CatalogStorageFormat(Some(/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/spark-dd234718-e85d-4c5a-8353-8f1834ac0323),Some(org.apache.hadoop.mapred.TextInputFormat),Some(org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat),None,false,Map()),List(CatalogColumn(key,int,true,None), CatalogColumn(value,string,true,None), CatalogColumn(ds,string,true,None), CatalogColumn(hr,string,true,None)),List(ds, hr),List(),List(),-1,,1463026413544,-1,Map(),None,None,None), false`
    
    After this PR, the output is like
    
    `ExecutedCommand CreateTable CatalogTable(Table:extTable_with_partitions, Database:null, Owner:, Create Time:Wed May 11 21:05:06 PDT 2016, Last Access Time:Wed Dec 31 15:59:59 PST 1969, Location:/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/spark-d5d9cbc4-5c20-4c52-b2a7-84c03ca6bc7d, Table Type:EXTERNAL, Schema:[Column(name:key, dataType:int, nullable:Yes, comment:null), Column(name:value, dataType:string, nullable:Yes, comment:null), Column(name:ds, dataType:string, nullable:Yes, comment:null), Column(name:hr, dataType:string, nullable:Yes, comment:null)], Partition Columns:[ds, hr], Num Buckets:-1, Bucket Columns:[], Sort Columns:[], View Original Text:null, View Text:null, Comment:null, Table Parameters:[], Storage Information(Location:/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/spark-d5d9cbc4-5c20-4c52-b2a7-84c03ca6bc7d, InputFormat:org.apache.hadoop.mapred.TextInputFormat, OutputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, Compre
 ssed:No, Storage Desc Library:null, Storage Desc Parameter:[])), false`
    
    This is also applicable to DESC EXTENDED. However, this does not have special handling for Data Source Tables. If needed, we need to move the logics of `DDLUtil`. Let me know if we should do it in this PR. Thanks! @rxin @liancheng 
    
    #### How was this patch tested?
    Manual testing

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gatorsmile/spark betterExplainCatalogTable

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13070.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13070
    
----
commit 5f83dbd440de9c7a0a8a0c014f1feadd1ebceed7
Author: gatorsmile <ga...@gmail.com>
Date:   2016-05-12T04:09:27Z

    improve the explain and desc extended.

----


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

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


[GitHub] spark pull request #13070: [SPARK-15286] [SQL] Make the output readable for ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13070#discussion_r65611638
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala ---
    @@ -65,8 +85,18 @@ case class CatalogColumn(
         // as a string due to issues in converting Hive varchars to and from SparkSQL strings.
         @Nullable dataType: String,
         nullable: Boolean = true,
    -    comment: Option[String] = None)
    +    comment: Option[String] = None) {
    +
    +  override def toString: String = {
    +    val output =
    +      Seq(s"`$name`",
    +        dataType,
    +        if (nullable) "NULL" else "NOT NULL",
    --- End diff --
    
    Are there some examples we can follow? I'm not sure what's best here, but `NULL` looks like confusing, at least we should use `NULLABLE`


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    **[Test build #59916 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59916/consoleFull)** for PR 13070 at commit [`73c0da2`](https://github.com/apache/spark/commit/73c0da2f1c087f97ff5b71a62f4c2cdc5894b78e).


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218662174
  
    Sure, will do. 


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

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


[GitHub] spark pull request #13070: [SPARK-15286] [SQL] Make the output readable for ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13070#discussion_r65611801
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala ---
    @@ -140,6 +170,32 @@ case class CatalogTable(
           locationUri, inputFormat, outputFormat, serde, compressed, serdeProperties))
       }
     
    +  override def toString: String = {
    +    val tableProperties = properties.map(p => p._1 + "=" + p._2).mkString("[", ", ", "]")
    +    val partitionColumns = partitionColumnNames.map("`" + _ + "`").mkString("[", ", ", "]")
    +    val sortColumns = sortColumnNames.map("`" + _ + "`").mkString("[", ", ", "]")
    +    val bucketColumns = bucketColumnNames.map("`" + _ + "`").mkString("[", ", ", "]")
    +
    +    val output =
    +      Seq(s"Table:${identifier.quotedString}",
    +        if (owner.nonEmpty) s"Owner:$owner" else "",
    +        s"Created:${new Date(createTime).toString}",
    +        s"Last Access:${new Date(lastAccessTime).toString}",
    +        s"Type:${tableType.name}",
    +        if (schema.nonEmpty) s"Schema:${schema.mkString("[", ", ", "]")}" else "",
    +        if (partitionColumnNames.nonEmpty) s"Partition Columns:$partitionColumns" else "",
    +        if (numBuckets != -1) s"Num Buckets:$numBuckets" else "",
    +        if (bucketColumnNames.nonEmpty) s"Bucket Columns:$bucketColumns" else "",
    +        if (sortColumnNames.nonEmpty) s"Sort Columns:$sortColumns" else "",
    +        viewOriginalText.map("Original View:" + _).getOrElse(""),
    +        viewText.map("View:" + _).getOrElse(""),
    +        comment.map("Comment:" + _).getOrElse(""),
    +        if (properties.nonEmpty) s"Properties:$tableProperties" else "",
    +        s"$storage")
    +
    +    output.filter(_.nonEmpty).mkString("CatalogTable(", ", ", ")")
    --- End diff --
    
    Since there are so many informations to display, I'm wondering using `\n` as separator maybe better


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218666803
  
    **[Test build #58442 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58442/consoleFull)** for PR 13070 at commit [`5f83dbd`](https://github.com/apache/spark/commit/5f83dbd440de9c7a0a8a0c014f1feadd1ebceed7).
     * This patch **fails PySpark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222340717
  
    **[Test build #59575 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59575/consoleFull)** for PR 13070 at commit [`9cb0390`](https://github.com/apache/spark/commit/9cb039092d48edc8359ba48ba625e7e977de0c22).


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    thanks, merging to master and 2.0!


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59950/
    Test PASSed.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218683342
  
    **[Test build #58458 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58458/consoleFull)** for PR 13070 at commit [`6b9819a`](https://github.com/apache/spark/commit/6b9819a3d753f035cf9e7efa83a32ae0ee35c9a8).


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218661395
  
    True. We can exclude all the variables with undefined values. It could be much shorter. : )


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218702494
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58458/
    Test PASSed.


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222343174
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    @cloud-fan Thank you for your review! Just quickly added the space. 


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    LGTM, I'm wondering if it's slightly better if we always put a space after `:`(not a big deal)


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59916/
    Test PASSed.


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    CC @clockfly @cloud-fan 


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

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


[GitHub] spark pull request #13070: [SPARK-15286] [SQL] Make the output readable for ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/13070


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

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


[GitHub] spark pull request #13070: [SPARK-15286] [SQL] Make the output readable for ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13070#discussion_r65655636
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala ---
    @@ -140,6 +170,32 @@ case class CatalogTable(
           locationUri, inputFormat, outputFormat, serde, compressed, serdeProperties))
       }
     
    +  override def toString: String = {
    +    val tableProperties = properties.map(p => p._1 + "=" + p._2).mkString("[", ", ", "]")
    +    val partitionColumns = partitionColumnNames.map("`" + _ + "`").mkString("[", ", ", "]")
    +    val sortColumns = sortColumnNames.map("`" + _ + "`").mkString("[", ", ", "]")
    +    val bucketColumns = bucketColumnNames.map("`" + _ + "`").mkString("[", ", ", "]")
    +
    +    val output =
    +      Seq(s"Table:${identifier.quotedString}",
    +        if (owner.nonEmpty) s"Owner:$owner" else "",
    +        s"Created:${new Date(createTime).toString}",
    +        s"Last Access:${new Date(lastAccessTime).toString}",
    +        s"Type:${tableType.name}",
    +        if (schema.nonEmpty) s"Schema:${schema.mkString("[", ", ", "]")}" else "",
    +        if (partitionColumnNames.nonEmpty) s"Partition Columns:$partitionColumns" else "",
    +        if (numBuckets != -1) s"Num Buckets:$numBuckets" else "",
    +        if (bucketColumnNames.nonEmpty) s"Bucket Columns:$bucketColumns" else "",
    +        if (sortColumnNames.nonEmpty) s"Sort Columns:$sortColumns" else "",
    +        viewOriginalText.map("Original View:" + _).getOrElse(""),
    +        viewText.map("View:" + _).getOrElse(""),
    +        comment.map("Comment:" + _).getOrElse(""),
    +        if (properties.nonEmpty) s"Properties:$tableProperties" else "",
    +        s"$storage")
    +
    +    output.filter(_.nonEmpty).mkString("CatalogTable(", ", ", ")")
    --- End diff --
    
    Since we are using `, ` as a separator, the output of EXPLAIN is like:
    ```
    CreateTableCommand CatalogTable(Table:`extTable_with_partitions`, Created:Thu Jun 02 21:25:26 PDT 2016, Last Access:Wed Dec 31 15:59:59 PST 1969, Type:EXTERNAL, Schema:[`key` int, `value` string, `ds` string, `hr` string], Partition Columns:[`ds`, `hr`], Storage(Location:/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/spark-472564ea-a321-447b-8224-7790edf454ab, InputFormat:org.apache.hadoop.mapred.TextInputFormat, OutputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat)), false
    ```
    
    If we change it to `\n`, it will be like
    ```
    CreateTableCommand CatalogTable(Table:`extTable_with_partitions`
    Created:Thu Jun 02 21:28:32 PDT 2016
    Last Access:Wed Dec 31 15:59:59 PST 1969
    Type:EXTERNAL
    Schema:[`key` int, `value` string, `ds` string, `hr` string]
    Partition Columns:[`ds`, `hr`]
    Storage(Location:/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/spark-a8e78990-3d9c-4f83-9ec4-6121473c1d09, InputFormat:org.apache.hadoop.mapred.TextInputFormat, OutputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat)), false
    ```
    
    Another option is to use `\n\t` in `mkString` (i.e., `mkString("CatalogTable(\n\t", "\n\t", ")")`). Then, it will become 
    ```
    CreateTableCommand CatalogTable(
    	Table:`extTable_with_partitions`
    	Created:Thu Jun 02 21:30:54 PDT 2016
    	Last Access:Wed Dec 31 15:59:59 PST 1969
    	Type:EXTERNAL
    	Schema:[`key` int, `value` string, `ds` string, `hr` string]
    	Partition Columns:[`ds`, `hr`]
    	Storage(Location:/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/spark-a06083b8-8e88-4d07-9ff0-d6bd8d943ad3, InputFormat:org.apache.hadoop.mapred.TextInputFormat, OutputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat)), false
    ```


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    **[Test build #59916 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59916/consoleFull)** for PR 13070 at commit [`73c0da2`](https://github.com/apache/spark/commit/73c0da2f1c087f97ff5b71a62f4c2cdc5894b78e).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222342638
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222341220
  
    **[Test build #59577 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59577/consoleFull)** for PR 13070 at commit [`505321f`](https://github.com/apache/spark/commit/505321f247eefe32d3a791a312191e9e626968e0).


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222342620
  
    **[Test build #59575 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59575/consoleFull)** for PR 13070 at commit [`9cb0390`](https://github.com/apache/spark/commit/9cb039092d48edc8359ba48ba625e7e977de0c22).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222343142
  
    **[Test build #59577 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59577/consoleFull)** for PR 13070 at commit [`505321f`](https://github.com/apache/spark/commit/505321f247eefe32d3a791a312191e9e626968e0).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218658905
  
    **[Test build #58442 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58442/consoleFull)** for PR 13070 at commit [`5f83dbd`](https://github.com/apache/spark/commit/5f83dbd440de9c7a0a8a0c014f1feadd1ebceed7).


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218661961
  
    Other examples include:
    
    1. Just say "created", and not "created time". same thing with "last access" vs "last access time".
    2. schema string can probably be a lot more compact



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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222342640
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59575/
    Test PASSed.


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

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


[GitHub] spark pull request #13070: [SPARK-15286] [SQL] Make the output readable for ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13070#discussion_r65610890
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala ---
    @@ -48,7 +49,26 @@ case class CatalogStorageFormat(
         outputFormat: Option[String],
         serde: Option[String],
         compressed: Boolean,
    -    serdeProperties: Map[String, String])
    +    serdeProperties: Map[String, String]) {
    +
    +  override def toString: String = {
    +    val serdePropsToString =
    +      if (serdeProperties.nonEmpty) {
    +        s"Properties:" + serdeProperties.map(p => p._1 + "=" + p._2).mkString("[", ", ", "]")
    +      } else {
    +        ""
    +      }
    +    val output =
    +      Seq(locationUri.map("Location:" + _).getOrElse(""),
    +        inputFormat.map("InputFormat:" + _).getOrElse(""),
    +        outputFormat.map("OutputFormat:" + _).getOrElse(""),
    +        if (compressed) "Compressed:Yes" else "Compressed:No",
    --- End diff --
    
    nit: print `Compressed` if compressed, and print nothing if not compressed.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218666897
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58442/
    Test FAILed.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222343175
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59577/
    Test PASSed.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218666896
  
    Merged build finished. Test FAILed.


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

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


[GitHub] spark pull request #13070: [SPARK-15286] [SQL] Make the output readable for ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13070#discussion_r65654836
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala ---
    @@ -48,7 +49,26 @@ case class CatalogStorageFormat(
         outputFormat: Option[String],
         serde: Option[String],
         compressed: Boolean,
    -    serdeProperties: Map[String, String])
    +    serdeProperties: Map[String, String]) {
    +
    +  override def toString: String = {
    +    val serdePropsToString =
    +      if (serdeProperties.nonEmpty) {
    +        s"Properties:" + serdeProperties.map(p => p._1 + "=" + p._2).mkString("[", ", ", "]")
    +      } else {
    +        ""
    +      }
    +    val output =
    +      Seq(locationUri.map("Location:" + _).getOrElse(""),
    +        inputFormat.map("InputFormat:" + _).getOrElse(""),
    +        outputFormat.map("OutputFormat:" + _).getOrElse(""),
    +        if (compressed) "Compressed:Yes" else "Compressed:No",
    --- End diff --
    
    Yeah, will do it.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218702267
  
    **[Test build #58458 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58458/consoleFull)** for PR 13070 at commit [`6b9819a`](https://github.com/apache/spark/commit/6b9819a3d753f035cf9e7efa83a32ae0ee35c9a8).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    **[Test build #59950 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59950/consoleFull)** for PR 13070 at commit [`0cc3268`](https://github.com/apache/spark/commit/0cc32686f7a71f62dccac2d52135536ca8d3ce8c).


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-222345018
  
    @rxin Code is ready for review. Thanks!


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

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


[GitHub] spark pull request #13070: [SPARK-15286] [SQL] Make the output readable for ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13070#discussion_r65654827
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala ---
    @@ -65,8 +85,18 @@ case class CatalogColumn(
         // as a string due to issues in converting Hive varchars to and from SparkSQL strings.
         @Nullable dataType: String,
         nullable: Boolean = true,
    -    comment: Option[String] = None)
    +    comment: Option[String] = None) {
    +
    +  override def toString: String = {
    +    val output =
    +      Seq(s"`$name`",
    +        dataType,
    +        if (nullable) "NULL" else "NOT NULL",
    --- End diff --
    
    Do not show anything if it is NULLABLE. If it is not nullable, we can show `NOT NULL`. This is the tradition way when we create a table. How about this? 


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218702492
  
    Merged build finished. Test PASSed.


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

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


[GitHub] spark issue #13070: [SPARK-15286] [SQL] Make the output readable for EXPLAIN...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13070
  
    **[Test build #59950 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59950/consoleFull)** for PR 13070 at commit [`0cc3268`](https://github.com/apache/spark/commit/0cc32686f7a71f62dccac2d52135536ca8d3ce8c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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

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


[GitHub] spark pull request: [SPARK-15286] [SQL] Make the output readable f...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:

    https://github.com/apache/spark/pull/13070#issuecomment-218660960
  
    This seems way too verbose for end users. Can't we make something more readable in the plan?



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

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