forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
56 lines
4.5 KiB
HTML
56 lines
4.5 KiB
HTML
<a name="dli_08_0091"></a><a name="dli_08_0091"></a>
|
|
|
|
<h1 class="topictitle1">Viewing Table Creation Statements</h1>
|
|
<div id="body8662426"><div class="section" id="dli_08_0091__en-us_topic_0114776185_en-us_topic_0093946877_sc21af2386cb840969d89026088018113"><h4 class="sectiontitle">Function</h4><p id="dli_08_0091__en-us_topic_0114776185_en-us_topic_0093946877_aa8354abbdbd04caeaa332d7c1530eb0c">This statement is used to show the statements for creating a table. </p>
|
|
</div>
|
|
<div class="section" id="dli_08_0091__en-us_topic_0114776185_en-us_topic_0093946877_s7f2e22a0082e42a8b0b51858bd1af2e5"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="dli_08_0091__en-us_topic_0114776185_screen99761311193113"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SHOW</span><span class="w"> </span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="k">table_name</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_08_0091__en-us_topic_0114776185_en-us_topic_0093946877_s9c558001e33b4d8b8944912062e55a18"><h4 class="sectiontitle">Keywords</h4><p id="dli_08_0091__en-us_topic_0114776185_en-us_topic_0093946877_a2f6cb1494b1044e8996ab64999b6c99b">CREATE TABLE: statement for creating a table</p>
|
|
</div>
|
|
<div class="section" id="dli_08_0091__en-us_topic_0114776170_section1130610201331"><h4 class="sectiontitle">Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0091__en-us_topic_0114776170_table137579239220" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter</caption><thead align="left"><tr id="dli_08_0091__en-us_topic_0114776170_row17564232219"><th align="left" class="cellrowborder" valign="top" width="16.66%" id="mcps1.3.4.2.2.3.1.1"><p id="dli_08_0091__en-us_topic_0114776170_p3756152318220">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="83.34%" id="mcps1.3.4.2.2.3.1.2"><p id="dli_08_0091__en-us_topic_0114776170_p167561023629">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_08_0091__en-us_topic_0114776170_row1375611231219"><td class="cellrowborder" valign="top" width="16.66%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0091__en-us_topic_0114776170_p107564232216">table_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83.34%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0091__en-us_topic_0114776170_p1575614231121">Table name</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_08_0091__en-us_topic_0114776185_en-us_topic_0093946877_s979257e3ae34418ea153a3955b17df8d"><h4 class="sectiontitle">Precautions</h4><p id="dli_08_0091__en-us_topic_0114776185_en-us_topic_0093946877_a8a26c09bdfe949908dc85505e57fe208">The table specified in this statement must exist. Otherwise, an error will occur.</p>
|
|
</div>
|
|
<div class="section" id="dli_08_0091__en-us_topic_0114776185_en-us_topic_0093946877_s608f2998f23244758fc01a0da343ef6c"><h4 class="sectiontitle">Example</h4><div class="p" id="dli_08_0091__p484813314916"><strong id="dli_08_0091__b155488251915">Example of Spark 2.4.5:</strong><ul id="dli_08_0091__ul1374516301097"><li id="dli_08_0091__li6745330295">Run the following command to return the statement for creating the <strong id="dli_08_0091__b28626412406">testDB01.testTable5</strong> table:<p id="dli_08_0091__p1627013512916"><strong id="dli_08_0091__b0111715810">SHOW CREATE TABLE testDB01.testTable5</strong></p>
|
|
</li><li id="dli_08_0091__li27455305917">Return the statement for creating the <strong id="dli_08_0091__b4486572416">test</strong> table.<pre class="screen" id="dli_08_0091__screen539717161075">createtab_stmt
|
|
CREATE TABLE `testDB01`.`testTable5`(`id` INT, `age` INT, `money` DOUBLE)
|
|
COMMENT 'test'
|
|
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
|
|
WITH SERDEPROPERTIES (
|
|
'serialization.format' = '1'
|
|
)
|
|
STORED AS
|
|
INPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
|
|
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
|
|
TBLPROPERTIES (
|
|
'hive.serialization.extend.nesting.levels' = 'true',
|
|
'ddlUpdateTime' = '1707202585460'
|
|
)</pre>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0089.html">Viewing Tables</a></div>
|
|
</div>
|
|
</div>
|
|
|