doc-exports/docs/dws/dev/dws_04_0156.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

291 lines
32 KiB
HTML

<a name="EN-US_TOPIC_0000001233681807"></a><a name="EN-US_TOPIC_0000001233681807"></a>
<h1 class="topictitle1">Supported Data Types</h1>
<div id="body0000001117163300"><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p62721611119">In the big data field, the mainstream file format is ORC, which is supported by <span id="EN-US_TOPIC_0000001233681807__text179659161386">GaussDB(DWS)</span>. You can use Hive to export data to an ORC file and use a read-only foreign table to query and analyze the data in the ORC file. Therefore, you need to map the data types supported by the ORC file format with the data types supported by <span id="EN-US_TOPIC_0000001233681807__text20423243281">GaussDB(DWS)</span>. For details, see <a href="#EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_table15273186151115">Table 1 Mapping between ORC read-only foreign tables and Hive data types</a>. Similarly, <span id="EN-US_TOPIC_0000001233681807__text1475515474811">GaussDB(DWS)</span> exports data through a write-only foreign table, and stores the data in the ORC format. Using Hive to read the ORC file content also requires matched data types. <a href="#EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_table79747116811">Table 2</a> shows the matching relationship.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_table15273186151115"></a><a name="en-us_topic_0092665276_en-us_topic_0067563150_table15273186151115"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_table15273186151115" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Mapping between ORC read-only foreign tables and Hive data types</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row142741761115"><th align="left" class="cellrowborder" valign="top" width="25.650000000000002%" id="mcps1.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1227496101117"><strong id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_b12741267114">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.85%" id="mcps1.3.2.2.4.1.2"><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1827446171112"><strong id="EN-US_TOPIC_0000001233681807__b31021125195915">Type Supported by <span id="EN-US_TOPIC_0000001233681807__text12144135419812">GaussDB(DWS)</span> Foreign Tables</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="37.5%" id="mcps1.3.2.2.4.1.3"><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p182754641117"><strong id="EN-US_TOPIC_0000001233681807__b759815541590">Hive Table Type</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row2409211165610"><td class="cellrowborder" rowspan="2" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1195818461520">1-byte integer</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p526810461564">TINYINT (not recommended)</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p831311491569">TINYINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row9958124615519"><td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p129583461959">SMALLINT (recommended)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p79583461557">TINYINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row52752671111"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p42751465114">2-byte integer</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1727514614113">SMALLINT</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p122761569119">SMALLINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row1127618617118"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p16276566113">4-byte integer</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1327686121115">INTEGER</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p142761651113">INT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row1927626161115"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p10276136161112">8-byte integer</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p327736121119">BIGINT</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p11277156181114">BIGINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row1227712621110"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p2027715631112">Single-precision floating point number</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p5277764119">FLOAT4 (REAL)</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p15278868111">FLOAT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row52780611119"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p2027819641115">Double-precision floating point number</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p122785618115">FLOAT8(DOUBLE PRECISION)</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p122785612116">DOUBLE</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row027886131113"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p6278136121113">Scientific data type</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p827917651116">DECIMAL[p (,s)] (The maximum precision can reach up to 38.)</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1927912617115">DECIMAL (The maximum precision can reach up to 38.) (HIVE 0.11)</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row192791862111"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1027912641111">Date type</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p22802681113">DATE</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p11280865113">DATE</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row1328020681118"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p112801661113">Time type</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p32806611115">TIMESTAMP</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1028010611112">TIMESTAMP</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row32807616112"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p42801611110">Boolean type</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p202801569112">BOOLEAN</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1828015621111">BOOLEAN</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row5280156141110"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p528016618118">CHAR type</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p12281169116">CHAR(n)</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1228113681114">CHAR (n)</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row7281186201110"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p6281567117">VARCHAR type</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p128218621118">VARCHAR(n)</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p928266111115">VARCHAR (n)</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_row928211617110"><td class="cellrowborder" valign="top" width="25.650000000000002%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p32829691111">String (large text object)</p>
</td>
<td class="cellrowborder" valign="top" width="36.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p1628216191120">TEXT(CLOB)</p>
</td>
<td class="cellrowborder" valign="top" width="37.5%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_p162821615117">STRING</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_table79747116811"></a><a name="en-us_topic_0092665276_table79747116811"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_table79747116811" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Mapping between ORC write-only foreign tables and Hive data types</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row99744111683"><th align="left" class="cellrowborder" valign="top" width="15.290000000000001%" id="mcps1.3.3.2.5.1.1"><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p89742119810"><strong id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_b4974211587">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.56%" id="mcps1.3.3.2.5.1.2"><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1556456171712"><strong id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_b6564564176">Type Supported by <span id="EN-US_TOPIC_0000001233681807__text4222150295">GaussDB(DWS)</span> Internal Tables (Data Source Table)</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.47%" id="mcps1.3.3.2.5.1.3"><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p19974211281">Type Supported by <span id="EN-US_TOPIC_0000001233681807__text18827164894">GaussDB(DWS)</span> Write-only Foreign Tables</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="34.68%" id="mcps1.3.3.2.5.1.4"><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p49752111385">Hive Table Type</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row1433042125718"><td class="cellrowborder" rowspan="2" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p149754110814">1-byte integer</p>
</td>
<td class="cellrowborder" rowspan="2" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p103348539185">TINYINT</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1333113213570">TINYINT (not recommended)</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p052652105716">SMALLINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row2975121112811"><td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1960895841814">SMALLINT (recommended)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p464896131711">SMALLINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row09752011687"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1197513111686">2-byte integer</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p12383202812192">SMALLINT</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1197512111486">SMALLINT</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1975411681">SMALLINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row139752011481"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p297511111288">4-byte integer</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p207592036101910">INTEGER, BINARY_INTEGER</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1975101116817">INTEGER</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p20975181114812">INT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row99751711384"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p297518116816">8-byte integer</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p53301342181720">BIGINT</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p20975161119811">BIGINT</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p897518111583">BIGINT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row597513117813"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p397517111185">Single-precision floating point number</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1733074211716">FLOAT4, REAL</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p19751511286">FLOAT4, REAL</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p097514116817">FLOAT</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row6976121118813"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p197614119817">Double-precision floating point number</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p17330942131719">DOUBLE PRECISION, FLOAT8, BINARY_DOUBLE</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p7977328202218">DOUBLE PRECISION, FLOAT8, BINARY_DOUBLE</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p397611111812">DOUBLE</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row29767113810"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p29761511684">Scientific data type</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p34401548172211">DECIMAL, NUMERIC</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1697620111486">DECIMAL[p (,s)] (The maximum precision can reach up to 38.)</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p297612112082"><em id="EN-US_TOPIC_0000001233681807__i378713874610">precision</em><strong id="EN-US_TOPIC_0000001233681807__b179234713482">38</strong>: DECIMAL; <em id="EN-US_TOPIC_0000001233681807__i479384624612">precision</em> &gt; <strong id="EN-US_TOPIC_0000001233681807__b23841955174813">38</strong>: STRING</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row189762111887"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p119765111283">Date type</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p133094218171">DATE</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p87981231124516">TIMESTAMP[(p)] [WITHOUT TIME ZONE]</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p589523819248">TIMESTAMP</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row830620465401"><td class="cellrowborder" rowspan="3" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p330654617404"></p>
<p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p172971022194010"></p>
<p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1997618114813">Time type</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1306746174011">TIME [(p)] [WITHOUT TIME ZONE], TIME [(p)] [WITH TIME ZONE]</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1030619467409">TEXT</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p183061146154015">STRING</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row9297322164017"><td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1297122211402">TIMESTAMP[(p)] [WITHOUT TIME ZONE], TIMESTAMP[(p)][WITH TIME ZONE], SMALLDATETIME</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p32970228406">TIMESTAMP[(p)] [WITHOUT TIME ZONE]</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p0298122216404">TIMESTAMP</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row119761111389"><td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p113301242151719">INTERVAL DAY (l) TO SECOND (p), INTERVAL [FIELDS] [(p)]</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p7558112004413">VARCHAR(n)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p12432514419">VARCHAR(n)</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row1976811888"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p119762116820">Boolean type</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p13511114258">BOOLEAN</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p199763114810">BOOLEAN</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p7976101120820">BOOLEAN</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row159766117816"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p129769111588">CHAR type</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1846012494257">CHAR(n), CHARACTER(n), NCHAR(n)</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p294579112916">CHAR(n), CHARACTER(n), NCHAR(n)</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1097620114819"><em id="EN-US_TOPIC_0000001233681807__i1264658284115158">n</em><strong id="EN-US_TOPIC_0000001233681807__b1276814878115158">255</strong>: CHAR(n); <em id="EN-US_TOPIC_0000001233681807__i20632677115158">n</em> &gt; <strong id="EN-US_TOPIC_0000001233681807__b1825387945115158">255</strong>: STRING</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row19762111389"><td class="cellrowborder" rowspan="2" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p109769111382">VARCHAR type</p>
<p id="EN-US_TOPIC_0000001233681807__p13784543813"></p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p3280432153715">VARCHAR(n), CHARACTER VARYING(n), VARCHAR2(n)</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p89761111581">VARCHAR(n)</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p097612115810"><em id="EN-US_TOPIC_0000001233681807__i1257393010491">n</em><strong id="EN-US_TOPIC_0000001233681807__b765633844914">65535</strong>: VARCHAR(n); <em id="EN-US_TOPIC_0000001233681807__i15206514501">n</em> &gt; <strong id="EN-US_TOPIC_0000001233681807__b113808935020">65535</strong>: STRING</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__row5378954486"><td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__p1437965417810">NVARCHAR2(n)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__p1537914541485">TEXT</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__p133797549818">STRING</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row99768114812"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p4976211681">String (large text object)</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p837044019311">TEXT, CLOB</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p1097781110813">TEXT, CLOB</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p39771311685">STRING</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_row2387234616"><td class="cellrowborder" valign="top" width="15.290000000000001%" headers="mcps1.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p43818224613">Monetary type</p>
</td>
<td class="cellrowborder" valign="top" width="22.56%" headers="mcps1.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p53913204617">MONEY</p>
</td>
<td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p639192194614">NUMERIC</p>
</td>
<td class="cellrowborder" valign="top" width="34.68%" headers="mcps1.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_p63918218460">BIGINT</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="notice" id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_note22835621116"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ol id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_ol152836691115"><li id="EN-US_TOPIC_0000001233681807__li15224854175211">The GaussDB(DWS) foreign table supports the NULL definition, and the Hive data table supports and uses the corresponding NULL definition.</li><li id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_li21460594818">The value range of TINYINT in the Hive data table is [-128, 127], and the value range of TINYINT in <span id="EN-US_TOPIC_0000001233681807__text982719131197">GaussDB(DWS)</span> is [0, 255]. You are advised to use the SMALLINT type when creating a <span id="EN-US_TOPIC_0000001233681807__text1038517243916">GaussDB(DWS)</span> read-only foreign table for TINYINT in the Hive table. If TINYINT is used, the read value may be different from the actual value. Similarly, when exporting data of the TINYINT type from <span id="EN-US_TOPIC_0000001233681807__text1410712194911">GaussDB(DWS)</span>, you are advised to use the SMALLINT type for write-only foreign tables and Hive tables.</li><li id="EN-US_TOPIC_0000001233681807__li18801138135412">The time zone definition is not supported by the date and time types of the <span id="EN-US_TOPIC_0000001233681807__text5194955397">GaussDB(DWS)</span> foreign table, or by the Hive table.</li><li id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_li10283126141114">The DATE type in Hive contains only date. The DATE type in <span id="EN-US_TOPIC_0000001233681807__text1389916296910">GaussDB(DWS)</span> contains date and time.</li><li id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_li16283568116">In <span id="EN-US_TOPIC_0000001233681807__text23872912841029">GaussDB(DWS)</span>, ORC files can be compressed in ZLIB, SNAPPY, LZ4, or NONE mode. The FLOAT4 format itself is not accurate, and the sum operation results in different effect in various environments. You are advised to use the DECIMAL type in the high-precision scenarios.</li><li id="EN-US_TOPIC_0000001233681807__en-us_topic_0092665276_en-us_topic_0067563150_li19283206151116">In Teradata-compatible mode, foreign tables do not support the DATE type.</li></ol>
</div></div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0155.html">Importing ORC or CarbonData Data from OBS</a></div>
</div>
</div>