Yang, Tong 6182f91ba8 MRS component operation guide_normal 2.0.38.SP20 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2022-12-09 14:55:21 +00:00

102 lines
9.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="mrs_01_1408"></a><a name="mrs_01_1408"></a>
<h1 class="topictitle1">About CarbonData Table</h1>
<div id="body1595920209088"><div class="section" id="mrs_01_1408__scb4cf98e0e6c4e978b9db941d52f79a6"><h4 class="sectiontitle">Overview</h4><p id="mrs_01_1408__a66f4eb29431d4ae89f861bd15c16ed79">In CarbonData, data is stored in entities called tables. CarbonData tables are similar to RDBMS tables. RDBMS data is stored in a table consisting of rows and columns. CarbonData tables store structured data, and have fixed columns and data types.</p>
</div>
<div class="section" id="mrs_01_1408__s600fbee10995464a8dc9e041924de837"><h4 class="sectiontitle">Supported Data Types</h4><p id="mrs_01_1408__a9e2502cb96af44f787cb6a19f02dfe0c">CarbonData tables support the following data types:</p>
<ul id="mrs_01_1408__ub7443a2004784af4b7357869b8d7fd22"><li id="mrs_01_1408__l7473deb690de4479b6dcc8249e489a8c">Int</li><li id="mrs_01_1408__l55b04babe206467c948ae255873733ac">String</li><li id="mrs_01_1408__lff3df56bb20c40fe80104526675012e2">BigInt</li><li id="mrs_01_1408__li02181435172310">Smallint</li><li id="mrs_01_1408__li59431840112316">Char</li><li id="mrs_01_1408__li1788174422314">Varchar</li><li id="mrs_01_1408__li17177144982316">Boolean</li><li id="mrs_01_1408__l8988e2e3958247788936f56bfb780f02">Decimal</li><li id="mrs_01_1408__l7970230fd6ba4a5eb1639db0035944f9">Double</li><li id="mrs_01_1408__lf19cc2e63d754c3d922270a15f1f8ddc">TimeStamp</li><li id="mrs_01_1408__l13bf8a0439dd42efb5dea19e3f2319d5">Date</li><li id="mrs_01_1408__li588420041818">Array</li><li id="mrs_01_1408__li39197381817">Struct</li><li id="mrs_01_1408__li674211681819">Map</li></ul>
<p id="mrs_01_1408__a97069f72dfc34aa0a7fc555129f315b4">The following table describes supported data types and their respective values range.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1408__tef6b876fad9a44e19a73337b97e3d710" frame="border" border="1" rules="all"><caption><b>Table 1 </b>CarbonData data types</caption><thead align="left"><tr id="mrs_01_1408__r998298b9e0ee4e8aa69e7d0594674818"><th align="left" class="cellrowborder" valign="top" width="30.64%" id="mcps1.3.2.5.2.3.1.1"><p id="mrs_01_1408__a0c84c4019cd840ecbff6c0d3206e6b62"><strong id="mrs_01_1408__b18531237175410">Data Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="69.36%" id="mcps1.3.2.5.2.3.1.2"><p id="mrs_01_1408__af49f9908e6974a74bb5621dc481e433f"><strong id="mrs_01_1408__b86721943195413">Value Range</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1408__rd2f5d852a2bc452aaad901631d0051f0"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__af2fdd14c20ae4d308bd30851d923b4b8">Int</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__a28d3263d7af04344a0565697980bd02b">4-byte signed integer ranging from -2,147,483,648 to 2,147,483,647.</p>
<div class="note" id="mrs_01_1408__nf8a6e70e9c634ae0b03ee45ebd6acecf"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="mrs_01_1408__a7bf1645da93945bc8f853cc1cbf0fee9">If a non-dictionary column is of the <strong id="mrs_01_1408__b11973547175410">int</strong> data type, it is internally stored as the <strong id="mrs_01_1408__b11978184712543">BigInt</strong> type.</p>
</div></div>
</td>
</tr>
<tr id="mrs_01_1408__rddf06a76469b4746beb3696d2a0afd7a"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__a74695dcc2a7f40099ea2df338489d6f8">String</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__a896b1518b0ec4fd69ca381a4b7c01727">100,000 characters</p>
<div class="note" id="mrs_01_1408__na68917bebadb484b95cf29ee4d004591"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="mrs_01_1408__a959ed196cd434bc285a0d234c98491cf">If the <strong id="mrs_01_1408__b12341529135520">CHAR</strong> or <strong id="mrs_01_1408__b836613114553">VARCHAR</strong> data type is used in <b><span class="cmdname" id="mrs_01_1408__cmdname185615331390">CREATE TABLE</span></b>, the two data types are automatically converted to the String data type.</p>
<p id="mrs_01_1408__p17277177810">If a column contains more than 32,000 characters, add the column to the <strong id="mrs_01_1408__b20984451145519">LONG_STRING_COLUMNS</strong> attribute of the <strong id="mrs_01_1408__b174301755105518">tblproperties</strong> table during table creation.</p>
</div></div>
</td>
</tr>
<tr id="mrs_01_1408__r2906aa4cdff84107a2da143b507ca09b"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__aeb8596c52b2b47858ed041325878f229">BigInt</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__afd100283ac744f8e8ac6abc0776f9ca6">64-bit value ranging from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807</p>
</td>
</tr>
<tr id="mrs_01_1408__row1947361932617"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__p74732193266">SmallInt</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__p047331922618">32,768 to 32,767</p>
</td>
</tr>
<tr id="mrs_01_1408__row181412302712"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__p58146310273">Char</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__p16814937274">A to Z and a to z</p>
</td>
</tr>
<tr id="mrs_01_1408__row13804193095118"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__p19804330175111">Varchar</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__p780453075120">A to Z, a to z, and 0 to 9</p>
</td>
</tr>
<tr id="mrs_01_1408__row21456355407"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__p1514733524015">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__p3147113516408"><strong id="mrs_01_1408__b15170103545612">true</strong> or <strong id="mrs_01_1408__b217514350561">false</strong></p>
</td>
</tr>
<tr id="mrs_01_1408__reb327b19072e41b5be810415614be3eb"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__ab5903455ae3644c0a8684cc52ea6d0e1">Decimal</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__a1b0dec0ac8bd4e449d357cbfb76d2a1b">The default value is (10,0) and maximum value is (38,38).</p>
<div class="note" id="mrs_01_1408__nebe2151cfff74fbcb191a2be967bee90"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="mrs_01_1408__aaf7a39d23c1343d3a3d76dc673981455">When query with filters, append <strong id="mrs_01_1408__b112204612561">BD</strong> to the number to achieve accurate results. For example, <strong id="mrs_01_1408__b17693204811563">select * from carbon_table where num = 1234567890123456.22BD</strong>.</p>
</div></div>
</td>
</tr>
<tr id="mrs_01_1408__r3f850cdbf20b49f2a5f81365a4147df2"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__a85eb2d0433fa46a9be17cd290e4d65a0">Double</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__a8ed69253314b4b40b2a887a3207f0579">64-bit value ranging from 4.9E-324 to 1.7976931348623157E308</p>
</td>
</tr>
<tr id="mrs_01_1408__r906e24fd1d194dfcb14223372b7a7962"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__ad5efd5c17a1945feaeac3af762f163ef">TimeStamp</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__a6b8ad27afec748c29d8d18e221d2bd91">The default format is <strong id="mrs_01_1408__b118603570563">yyyy-MM-dd HH:mm:ss</strong>.</p>
</td>
</tr>
<tr id="mrs_01_1408__r1277897f4fe44f79a6b4f67fe48d7c3c"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__a53b7de4f613a4f958183723906e61d2d">Date</p>
</td>
<td class="cellrowborder" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__ae0ea50e379ce4fd6be0c6209649551fb">The <strong id="mrs_01_1408__b4378188571">DATE</strong> data type is used to store calendar dates. The default format is <strong id="mrs_01_1408__b206119108575">yyyy-MM-DD</strong>.</p>
</td>
</tr>
<tr id="mrs_01_1408__row1294910421405"><td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__p494934210019">Array&lt;data_type&gt;</p>
</td>
<td class="cellrowborder" rowspan="3" valign="top" width="69.36%" headers="mcps1.3.2.5.2.3.1.2 "><p id="mrs_01_1408__p1395024220011">N/A</p>
<div class="note" id="mrs_01_1408__note562206151116"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="mrs_01_1408__p11622613114">Currently, only two layers of complex types can be nested.</p>
</div></div>
</td>
</tr>
<tr id="mrs_01_1408__row33811251356"><td class="cellrowborder" valign="top" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__p838212251154">Struct&lt;col_name: data_type COMMENT col_comment, ...&gt;</p>
</td>
</tr>
<tr id="mrs_01_1408__row12625720151018"><td class="cellrowborder" valign="top" headers="mcps1.3.2.5.2.3.1.1 "><p id="mrs_01_1408__p0625162091013">Map&lt;primitive_type, data_type&gt;</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1407.html">CarbonData Table Management</a></div>
</div>
</div>