Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion docs/sql-ref-syntax-aux-show-create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ license: |
### Syntax

```sql
SHOW CREATE TABLE table_identifier
SHOW CREATE TABLE table_identifier [ AS SERDE ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a new example with AS SERDE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will do it.

```

### 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