You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean R. Owen (Jira)" <ji...@apache.org> on 2020/01/10 16:57:00 UTC

[jira] [Resolved] (SPARK-30468) Use multiple lines to display data columns for show create table command

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

Sean R. Owen resolved SPARK-30468.
----------------------------------
    Fix Version/s: 3.0.0
       Resolution: Fixed

Issue resolved by pull request 27147
[https://github.com/apache/spark/pull/27147]

> Use multiple lines to display data columns for show create table command
> ------------------------------------------------------------------------
>
>                 Key: SPARK-30468
>                 URL: https://issues.apache.org/jira/browse/SPARK-30468
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Zhenhua Wang
>            Assignee: Zhenhua Wang
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> Currently data columns are displayed in one line for show create table command, when the table has many columns (to make things even worse, columns may have long names or comments), the displayed result is really hard to read.
> To improve readability, we could print each column in a separate line. Note that other systems like Hive/MySQL also display in this way.
> Also, for data columns, table properties and options, we'd better put the right parenthesis to the end of the last column/property/option, instead of occupying a separate line.
> As a result, before the change:
> {noformat}
> spark-sql> show create table test_table;
> CREATE TABLE `test_table` (`col1` INT COMMENT 'This is comment for column 1', `col2` STRING COMMENT 'This is comment for column 2', `col3` DOUBLE COMMENT 'This is comment for column 3')
> USING parquet
> OPTIONS (
>   `bar` '2',
>   `foo` '1'
> )
> TBLPROPERTIES (
>   'a' = 'x',
>   'b' = 'y'
> )
> {noformat}
> after the change:
> {noformat}
> spark-sql> show create table test_table;
> CREATE TABLE `test_table` (
>   `col1` INT COMMENT 'This is comment for column 1',
>   `col2` STRING COMMENT 'This is comment for column 2',
>   `col3` DOUBLE COMMENT 'This is comment for column 3')
> USING parquet
> OPTIONS (
>   `bar` '2',
>   `foo` '1')
> TBLPROPERTIES (
>   'a' = 'x',
>   'b' = 'y')
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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