Skip to content

Commit

Permalink
[SPARK-37818][DOCS] Add option in the description document for show c…
Browse files Browse the repository at this point in the history
…reate table

### What changes were proposed in this pull request?

Add options in the description document for `SHOW CREATE TABLE ` command.
<img width="767" alt="1" src="https://user-images.githubusercontent.com/41178002/148747443-ecd6586f-e4c4-4ae4-8ea5-969896b7d416.png">
<img width="758" alt="2" src="https://user-images.githubusercontent.com/41178002/148747457-873bc0c3-08fa-4d31-89e7-b44440372462.png">

### Why are the changes needed?
[#discussion](apache#34719 (comment))

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
SKIP_API=1 SKIP_RDOC=1 SKIP_PYTHONDOC=1 SKIP_SCALADOC=1 bundle exec jekyll build

Closes apache#35107 from Peng-Lei/SPARK-37818.

Authored-by: PengLei <peng.8lei@gmail.com>
Signed-off-by: Gengliang Wang <gengliang@apache.org>
  • Loading branch information
Peng-Lei authored and dchvn committed Jan 19, 2022
1 parent 6d8426e commit a7ad9ac
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion docs/sql-ref-syntax-aux-show-create-table.md
Expand Up @@ -26,7 +26,7 @@ license: |
### Syntax

```sql
SHOW CREATE TABLE table_identifier
SHOW CREATE TABLE table_identifier [ AS SERDE ]
```

### Parameters
Expand All @@ -37,6 +37,10 @@ SHOW CREATE TABLE table_identifier

**Syntax:** `[ database_name. ] table_name`

* **AS SERDE**

Generates Hive DDL for a Hive SerDe table.

### Examples

```sql
Expand All @@ -55,6 +59,25 @@ SHOW CREATE TABLE test;
'prop1' = 'value1',
'prop2' = 'value2')
+----------------------------------------------------+

SHOW CREATE TABLE test AS SERDE;
+------------------------------------------------------------------------------+
| createtab_stmt|
+------------------------------------------------------------------------------+
|CREATE TABLE `default`.`test`(
`c` INT)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = ',',
'field.delim' = ',')
STORED AS
INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
TBLPROPERTIES (
'prop1' = 'value1',
'prop2' = 'value2',
'transient_lastDdlTime' = '1641800515')
+------------------------------------------------------------------------------+
```

### Related Statements
Expand Down

0 comments on commit a7ad9ac

Please sign in to comment.