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>
279 lines
24 KiB
HTML
279 lines
24 KiB
HTML
<a name="dli_08_0477"></a><a name="dli_08_0477"></a>
|
|
|
|
<h1 class="topictitle1">Spark Open Source Commands</h1>
|
|
<div id="body8662426"><p id="dli_08_0477__en-us_topic_0000001836857925_p3467662538">This section describes the open source Spark SQL syntax supported by DLI. For details about the syntax, parameters, and examples, see <a href="https://spark.apache.org/docs/latest/sql-ref-syntax.html" target="_blank" rel="noopener noreferrer">Spark SQL Syntax</a>.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0477__en-us_topic_0000001836857925_table81371115101411" frame="border" border="1" rules="all"><caption><b>Table 1 </b>DLI Spark open source commands</caption><thead align="left"><tr id="dli_08_0477__en-us_topic_0000001836857925_row113716150141"><th align="left" class="cellrowborder" valign="top" width="21.6%" id="mcps1.3.2.2.5.1.1"><p id="dli_08_0477__en-us_topic_0000001836857925_p13137215161412">Function</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="45.9%" id="mcps1.3.2.2.5.1.2"><p id="dli_08_0477__en-us_topic_0000001836857925_p7137191512145">Syntax Example</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.4%" id="mcps1.3.2.2.5.1.3"><p id="dli_08_0477__en-us_topic_0000001836857925_p349204413712">DLI Spark 2.4.5</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.1%" id="mcps1.3.2.2.5.1.4"><p id="dli_08_0477__en-us_topic_0000001836857925_p1567913010384">DLI Spark 3.3.1</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_08_0477__en-us_topic_0000001836857925_row122816412408"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p522874119405">Creating a database</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p5228174117400">CREATE DATABASE testDB;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p852820213418">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1652802119415">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row4228441194014"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p16228124104010">Creating a DLI table</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p14461781417">create table if not exists testDB.testTable1(</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p144615814119">id int,</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p944618194116">age int,</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p184461184410">money double</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p844638104115">);</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p098142213415">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p198172244114">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row1722810418408"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1228141144010">Creating an OBS table</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p13559121294112">create table if not exists testDB.testTable2(</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p1855911264115">id int,</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p1955941264116">age int,</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p955931294111">money double</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p5559121284111">)</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p75591121418">LOCATION 'obs://bucketName/filePath'</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p05591122410">partitioned by (dt string)</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p145599122412">row format delimited fields terminated by ','</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p20559191274119">STORED as TEXTFILE;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p7593192224113">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1259319228419">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row122281541114014"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p7228041174013">Inserting test data</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p730421894118">insert into table testDB.testTable2 values</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p18304201894112">(1, 18, 3.14, "20240101" ),</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p19304111834116">(2, 18, 3.15, "20240102" );</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p98391323104120">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1183910238418">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row181381415171411"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p20138151517145">Changing database attributes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p181388156148">ALTER DATABASE testDB SET DBPROPERTIES ('Edited-by' = 'John');</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p249219442376">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1947035012612">Not supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row613819151144"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p4138715191416">Changing the path for storing database files on OBS</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p2013819157140">ALTER DATABASE testDB SET LOCATION 'obs://bucketName/filePath';</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p124929441379">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p0470650192618">Not supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row14138181517147"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1138181551416">Changing a table name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1813831591416">ALTER TABLE testDB.testTable1 RENAME TO testDB.testTable101;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p74921844123714">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p16794013818">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row17138111518149"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p18129193121813">Changing the name of a partition in a table</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p8138121561418">ALTER TABLE testDB.testTable2 PARTITION ( dt='20240101') RENAME TO PARTITION ( dt='20240103');</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p525799173417">It only supports renaming partitions of tables stored in OBS, and the storage path of the table in OBS will not change.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p144921744123719">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p18679607387">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row4583732185"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p65832313189">Adding a column</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p05838319180">ALTER TABLE testDB.testTable1 ADD COLUMNS (name string);</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p849214410375">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1467917053818">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row175831039183"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1158320311814">Dropping a column</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p19583113121812">ALTER TABLE testDB.testTable1 DROP columns (money);</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1549224443715">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p667914019386">Not supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row12495429151914"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p204953296192">Changing the name of a column</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1049652931910">ALTER TABLE testDB.testTable1 RENAME COLUMN age TO years_of_age;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p174921444113714">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1867914043810">Not supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row11496152913194"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1249632910191">Modifying column comments</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1915711432117">ALTER TABLE testDB.testTable1 ALTER COLUMN age COMMENT "new comment";</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p144921446379">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p36791401385">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row139511157192219"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1951145792218">Replacing a specified column</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p20951185720228">ALTER TABLE testDB.testTable1 REPLACE COLUMNS (name string, ID int COMMENT 'new comment');</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p10492134415372">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1267918013818">Not supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row6951135716223"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p189515572222">Customizing table attributes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1095195742214">ALTER TABLE testDB.testTable1 SET TBLPROPERTIES ('aaa' = 'bbb');</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p84922044133713">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p767916015380">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row17951457172215"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1295285715229">Adding or modifying table comments</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p18952155712211">ALTER TABLE testDB.testTable1 SET TBLPROPERTIES ('comment' = 'test');</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p13492344163718">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p196792015387">Not supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row4952205712215"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1795219575222">Changing the storage format of a table</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p15952105792213">ALTER TABLE testDB.testTable1 SET fileformat csv;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p9492184483720">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p9679180103817">Not supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row1720273015287"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1520216301287">Deleting a table attribute</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p122021830102813">ALTER TABLE testDB.testTable1 UNSET TBLPROPERTIES ('test');</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p4492044183719">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p19679100173810">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row4202173012288"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p12022302284">Deleting table comments</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1520263082816">ALTER TABLE testDB.testTable1 UNSET TBLPROPERTIES ('comment');</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1249274473719">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1067911093813">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row146491053152914"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p186504532298">Displaying column information</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1865016531290">DESCRIBE database_name.table_name col_name;</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p2542641884">Example: <strong id="dli_08_0477__en-us_topic_0000001836857925_b154042195816">DESCRIBE testDB.testTable1 id;</strong></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p154926448376">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p9679180143816">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row1265045316291"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p15650205310290">Displaying column information</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p17650195313299">DESCRIBE table_name table_name.col_name;</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p195141510088">Example: <strong id="dli_08_0477__en-us_topic_0000001836857925_b157268718587">DESCRIBE testTable1 testTable1.id;</strong></p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p2769835103517">It only supports viewing the column information for tables in the current database.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p5492114414376">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p267911063818">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row465015352911"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p765095362916">Returning metadata information of a query statement</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p126501531295">DESCRIBE QUERY SELECT age, sum(age) FROM testDB.testTable1 GROUP BY age;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1449234433714">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p146791800383">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row36503538291"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1148302216241">Returning metadata information of inserted data</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p146501553112910">DESCRIBE QUERY VALUES(100, 10, 10000.20D) AS testTable1(id, age, money);</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p104921344163720">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p156798016385">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row106502537299"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p164831922122419">Returning metadata information of a table</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p2650145310294">DESCRIBE QUERY TABLE testTable1;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p19492144410379">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p20679106381">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row20881113133211"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p134832223240">Returning metadata information of a column in a table</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p888123163211">DESCRIBE FROM testTable1 SELECT age;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p164921544133710">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p567916012386">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row1572282216356"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p7722142214353">Returning the table creation statements for a table</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1372232213352">SHOW CREATE TABLE testDB.testTable1 AS SERDE;</p>
|
|
<p id="dli_08_0477__en-us_topic_0000001836857925_p11801022173314">When executing this statement in Spark 3.3.1, it only applies to query the table creation statements for Hive tables.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p349234411370">Not supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p567913063816">Supported</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0477__en-us_topic_0000001836857925_row10722192223516"><td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.2.2.5.1.1 "><p id="dli_08_0477__en-us_topic_0000001836857925_p972216226358">Returning the table creation statements for a table</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.9%" headers="mcps1.3.2.2.5.1.2 "><p id="dli_08_0477__en-us_topic_0000001836857925_p7722222103515">SHOW CREATE TABLE testDB.testTable1;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.4%" headers="mcps1.3.2.2.5.1.3 "><p id="dli_08_0477__en-us_topic_0000001836857925_p1449284453713">Supported</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.1%" headers="mcps1.3.2.2.5.1.4 "><p id="dli_08_0477__en-us_topic_0000001836857925_p16679409385">Supported</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0221.html">Spark SQL Syntax Reference</a></div>
|
|
</div>
|
|
</div>
|
|
|