spark git commit: [SPARK-14127][SQL] Native "DESC [EXTENDED | FORMATTED] " DDL command

2016-05-04 Thread lian
Repository: spark
Updated Branches:
  refs/heads/branch-2.0 b99f715e8 -> 1fba7595f


[SPARK-14127][SQL] Native "DESC [EXTENDED | FORMATTED] " DDL command

## What changes were proposed in this pull request?

This PR implements native `DESC [EXTENDED | FORMATTED] ` DDL command. 
Sample output:

```
scala> spark.sql("desc extended src").show(100, truncate = false)
++-+---+
|col_name|data_type|comment|
++-+---+
|key |int  |   |
|value   |string   |   |
|| |   |
|# Detailed Table Information|CatalogTable(`default`.`src`, ...|   |
++-+---+

scala> spark.sql("desc formatted src").show(100, truncate = false)
++--+---+
|col_name|data_type 
|comment|
++--+---+
|key |int   
|   |
|value   |string
|   |
||  
|   |
|# Detailed Table Information|  
|   |
|Database:   |default   
|   |
|Owner:  |lian  
|   |
|Create Time:|Mon Jan 04 17:06:00 CST 2016  
|   |
|Last Access Time:   |Thu Jan 01 08:00:00 CST 1970  
|   |
|Location:   
|hdfs://localhost:9000/user/hive/warehouse_hive121/src |   |
|Table Type: |MANAGED   
|   |
|Table Parameters:   |  
|   |
|  transient_lastDdlTime |1451898360
|   |
||  
|   |
|# Storage Information   |  
|   |
|SerDe Library:  
|org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe|   |
|InputFormat:|org.apache.hadoop.mapred.TextInputFormat  
|   |
|OutputFormat:   
|org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat|   |
|Num Buckets:|-1
|   |
|Bucket Columns: |[]
|   |
|Sort Columns:   |[]
|   |
|Storage Desc Parameters:|  
|   |
|  serialization.format  |1 
|   |
++--+---+
```

## How was this patch tested?

A test case is added to `HiveDDLSuite` to check command output.

Author: Cheng Lian 

Closes #12844 from liancheng/spark-14127-desc-table.

(cherry picked from commit f152fae306dc75565cb4648ee1211416d7c0bb23)
Signed-off-by: Cheng Lian 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1fba7595
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1fba7595
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1fba7595

Branch: refs/heads/branch-2.0
Commit: 1fba7595f2e9cac984692238c6698bd5cfb0a453
Parents: b99f715
Author: Cheng Lian 
Authored: Wed May 4 16:44:09 2016 +0800
Committer: Cheng Lian 
Committed: Wed May 4 16:44:39 2016 +0800

--
 .../spark/sql/catalyst/catalog/interface.scala  |   5 +-
 .../catalyst/catalog/ExternalCatalogSuite.scala |   1 +
 .../spark/sql/execution/SparkSqlParser.scala|  14 ++-
 .../command/createDataSourceTables.scala|   2 +
 .../spark/sql/execution/command/tables.scala| 104 +++
 .../spark/sql/execution/command/DDLSuite.scala  |   6 +-
 .../spark/sql/hive/client/HiveClientImpl.scala  |   4 +-
 .../hive/execution/CreateTableAsSelect.scala|   3 +-
 .../spark/sql/hive/HiveDDLCommandSuite.scala|   2 +-
 .../sql/hive/MetastoreDataSourcesSuite.scala   

spark git commit: [SPARK-14127][SQL] Native "DESC [EXTENDED | FORMATTED] " DDL command

2016-05-04 Thread lian
Repository: spark
Updated Branches:
  refs/heads/master 6c12e801e -> f152fae30


[SPARK-14127][SQL] Native "DESC [EXTENDED | FORMATTED] " DDL command

## What changes were proposed in this pull request?

This PR implements native `DESC [EXTENDED | FORMATTED] ` DDL command. 
Sample output:

```
scala> spark.sql("desc extended src").show(100, truncate = false)
++-+---+
|col_name|data_type|comment|
++-+---+
|key |int  |   |
|value   |string   |   |
|| |   |
|# Detailed Table Information|CatalogTable(`default`.`src`, ...|   |
++-+---+

scala> spark.sql("desc formatted src").show(100, truncate = false)
++--+---+
|col_name|data_type 
|comment|
++--+---+
|key |int   
|   |
|value   |string
|   |
||  
|   |
|# Detailed Table Information|  
|   |
|Database:   |default   
|   |
|Owner:  |lian  
|   |
|Create Time:|Mon Jan 04 17:06:00 CST 2016  
|   |
|Last Access Time:   |Thu Jan 01 08:00:00 CST 1970  
|   |
|Location:   
|hdfs://localhost:9000/user/hive/warehouse_hive121/src |   |
|Table Type: |MANAGED   
|   |
|Table Parameters:   |  
|   |
|  transient_lastDdlTime |1451898360
|   |
||  
|   |
|# Storage Information   |  
|   |
|SerDe Library:  
|org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe|   |
|InputFormat:|org.apache.hadoop.mapred.TextInputFormat  
|   |
|OutputFormat:   
|org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat|   |
|Num Buckets:|-1
|   |
|Bucket Columns: |[]
|   |
|Sort Columns:   |[]
|   |
|Storage Desc Parameters:|  
|   |
|  serialization.format  |1 
|   |
++--+---+
```

## How was this patch tested?

A test case is added to `HiveDDLSuite` to check command output.

Author: Cheng Lian 

Closes #12844 from liancheng/spark-14127-desc-table.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/f152fae3
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/f152fae3
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/f152fae3

Branch: refs/heads/master
Commit: f152fae306dc75565cb4648ee1211416d7c0bb23
Parents: 6c12e80
Author: Cheng Lian 
Authored: Wed May 4 16:44:09 2016 +0800
Committer: Cheng Lian 
Committed: Wed May 4 16:44:09 2016 +0800

--
 .../spark/sql/catalyst/catalog/interface.scala  |   5 +-
 .../catalyst/catalog/ExternalCatalogSuite.scala |   1 +
 .../spark/sql/execution/SparkSqlParser.scala|  14 ++-
 .../command/createDataSourceTables.scala|   2 +
 .../spark/sql/execution/command/tables.scala| 104 +++
 .../spark/sql/execution/command/DDLSuite.scala  |   6 +-
 .../spark/sql/hive/client/HiveClientImpl.scala  |   4 +-
 .../hive/execution/CreateTableAsSelect.scala|   3 +-
 .../spark/sql/hive/HiveDDLCommandSuite.scala|   2 +-
 .../sql/hive/MetastoreDataSourcesSuite.scala|   1 +
 .../spark/sql/hive/client/VersionsSuite.scala   |   1 +
 .../spark/sql/hive/execution/HiveDDLSu