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

70 lines
9.9 KiB
HTML

<a name="mrs_01_1964"></a><a name="mrs_01_1964"></a>
<h1 class="topictitle1">Configuring Vector-based ORC Data Reading</h1>
<div id="body1595920207454"><div class="section" id="mrs_01_1964__section10411113113617"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_1964__p8060118">ORC is a column-based storage format in the Hadoop ecosystem. It originates from Apache Hive and is used to reduce the Hadoop data storage space and accelerate the Hive query speed. Similar to Parquet, ORC is not a pure column-based storage format. In the ORC format, the entire table is split based on the row group, data in each row group is stored by column, and data is compressed as much as possible to reduce storage space consumption. Vector-based ORC data reading significantly improves the ORC data reading performance. In Spark2.3, SparkSQL supports vector-based ORC data reading (this function is supported in earlier Hive versions). Vector-based ORC data reading improves the data reading performance by multiple times.</p>
<div class="p" id="mrs_01_1964__p18750184218255">This feature can be enabled by using the following parameter.<ul id="mrs_01_1964__u19846c76b0df49c3aab80b7635a6aa31"><li id="mrs_01_1964__l70a0df91bee34a41aec12951a4813736"><strong id="mrs_01_1964__b14249732622935">spark.sql.orc.enableVectorizedReader</strong>: specifies whether vector-based ORC data reading is supported. The default value is <strong id="mrs_01_1964__b111315211822935">true</strong>.</li><li id="mrs_01_1964__l400c3dcf62534106aee79da297faa552"><strong id="mrs_01_1964__b14921864522935">spark.sql.codegen.wholeStage</strong>: specifies whether to compile all stages of multiple operations into a Java method. The default value is <strong id="mrs_01_1964__b93892637222935">true</strong>.</li><li id="mrs_01_1964__lc25e9647adc1458d93de2a8cd57a20fe"><strong id="mrs_01_1964__b141458227122935">spark.sql.codegen.maxFields</strong>: specifies the maximum number of fields (including nested fields) supported by all stages of codegen. The default value is <strong id="mrs_01_1964__b63179241622935">100</strong>.</li><li id="mrs_01_1964__lf6521e8bc89c4e478521cdf6d0e6815e"><strong id="mrs_01_1964__b178638080222935">spark.sql.orc.impl</strong>: specifies whether Hive or Spark SQL native is used as the SQL execution engine to read ORC data. The default value is <strong id="mrs_01_1964__b1393199822935">hive</strong>.</li></ul>
</div>
</div>
<div class="section" id="mrs_01_1964__section10192121173713"><h4 class="sectiontitle">Parameters</h4><p id="mrs_01_1964__p18420142117236">Log in to FusionInsight Manager, choose <span id="mrs_01_1964__text250205222935"><strong id="mrs_01_1964__b34042744222935">Cluster</strong> &gt; <em id="mrs_01_1964__i193470343322935">Name of the desired cluster</em></span> &gt; <strong id="mrs_01_1964__b104007188222935">Services</strong> &gt; <strong id="mrs_01_1964__b20161686022935">Spark2x</strong>, click the <strong id="mrs_01_1964__b127684658822935">Configurations</strong> tab and then <strong id="mrs_01_1964__b92135840522935">All Configurations</strong>, and search for the following parameters.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1964__t18af5fbd3aeb4bda8d13de81ed31f812" frame="border" border="1" rules="all"><thead align="left"><tr id="mrs_01_1964__r74395b638f4442e3aab246ff89b4f414"><th align="left" class="cellrowborder" valign="top" width="25.25%" id="mcps1.3.2.3.1.5.1.1"><p id="mrs_01_1964__a1f516e63d9e642069c06eb1b4f809563"><strong id="mrs_01_1964__a744ab93a07754850a5f6c727a33e62e1">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.04%" id="mcps1.3.2.3.1.5.1.2"><p id="mrs_01_1964__af9566f38e89e419f83b61605b532f7ad"><strong id="mrs_01_1964__a6645dddca1604ff3a7c65c302142e2da">Description</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.469999999999999%" id="mcps1.3.2.3.1.5.1.3"><p id="mrs_01_1964__ac817ca09e627493cb99f5b57d2943bd6"><strong id="mrs_01_1964__adff60dc7bdc24a8aaa6c1b5c6630331e">Default Value</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.240000000000002%" id="mcps1.3.2.3.1.5.1.4"><p id="mrs_01_1964__p194216554016">Value Range</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1964__rd52556c4569841b3a5e5a2ebdfcb3b56"><td class="cellrowborder" valign="top" width="25.25%" headers="mcps1.3.2.3.1.5.1.1 "><p id="mrs_01_1964__a8730576580684096ade68e478ed89676">spark.sql.orc.enableVectorizedReader</p>
</td>
<td class="cellrowborder" valign="top" width="39.04%" headers="mcps1.3.2.3.1.5.1.2 "><p id="mrs_01_1964__p1939015105391">Specifies whether vector-based ORC data reading is supported. The default value is <strong id="mrs_01_1964__b129184503322935">true</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="14.469999999999999%" headers="mcps1.3.2.3.1.5.1.3 "><p id="mrs_01_1964__a127d9457c2354fe4a7bec8540121af54">true</p>
</td>
<td class="cellrowborder" valign="top" width="21.240000000000002%" headers="mcps1.3.2.3.1.5.1.4 "><p id="mrs_01_1964__p183701959143911">[true,false]</p>
</td>
</tr>
<tr id="mrs_01_1964__rf534b3c540af486495ea96f84d00a611"><td class="cellrowborder" valign="top" width="25.25%" headers="mcps1.3.2.3.1.5.1.1 "><p id="mrs_01_1964__p57061235386">spark.sql.codegen.wholeStage</p>
</td>
<td class="cellrowborder" valign="top" width="39.04%" headers="mcps1.3.2.3.1.5.1.2 "><p id="mrs_01_1964__p1083982493913">Specifies whether to compile all stages of multiple operations into a Java method. The default value is <strong id="mrs_01_1964__b96444209822935">true</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="14.469999999999999%" headers="mcps1.3.2.3.1.5.1.3 "><p id="mrs_01_1964__a037c12ec9a8e4344b2f9402486b8d871">true</p>
</td>
<td class="cellrowborder" valign="top" width="21.240000000000002%" headers="mcps1.3.2.3.1.5.1.4 "><p id="mrs_01_1964__p18370165912393">[true,false]</p>
</td>
</tr>
<tr id="mrs_01_1964__rf06831f12ff947a7840fb31bb28dbcc3"><td class="cellrowborder" valign="top" width="25.25%" headers="mcps1.3.2.3.1.5.1.1 "><p id="mrs_01_1964__a5bf8f7530faa4490a7b3f4d759d37b1d">spark.sql.codegen.maxFields</p>
</td>
<td class="cellrowborder" valign="top" width="39.04%" headers="mcps1.3.2.3.1.5.1.2 "><p id="mrs_01_1964__p18541133103915">Specifies the maximum number of fields (including nested fields) supported by all stages of codegen. The default value is <strong id="mrs_01_1964__b3618445922935">100</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="14.469999999999999%" headers="mcps1.3.2.3.1.5.1.3 "><p id="mrs_01_1964__ab14565a2d9c94dc3b3af18784bb309a1">100</p>
</td>
<td class="cellrowborder" valign="top" width="21.240000000000002%" headers="mcps1.3.2.3.1.5.1.4 "><p id="mrs_01_1964__p537011599391">Greater than 0</p>
</td>
</tr>
<tr id="mrs_01_1964__re2e73b4fe63e4eb886315e35ba1d6217"><td class="cellrowborder" valign="top" width="25.25%" headers="mcps1.3.2.3.1.5.1.1 "><p id="mrs_01_1964__a760d852580b74a43a942d8e7016d7792">spark.sql.orc.impl</p>
</td>
<td class="cellrowborder" valign="top" width="39.04%" headers="mcps1.3.2.3.1.5.1.2 "><p id="mrs_01_1964__aba15ad741b3141ada19d665f8696c8d1">Specifies whether Hive or Spark SQL native is used as the SQL execution engine to read ORC data. The default value is <strong id="mrs_01_1964__b146482617322935">hive</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="14.469999999999999%" headers="mcps1.3.2.3.1.5.1.3 "><p id="mrs_01_1964__a3d3cd2933fca4963a41eacb672bf72f6">hive</p>
</td>
<td class="cellrowborder" valign="top" width="21.240000000000002%" headers="mcps1.3.2.3.1.5.1.4 "><p id="mrs_01_1964__p12370145913912">[hive,native]</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="mrs_01_1964__n0ba3da7a98444611a4487f5db4536ccb"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ol id="mrs_01_1964__ol1780314834410"><li id="mrs_01_1964__li128034486442">To use vector-based ORC data reading of SparkSQL, the following conditions must be met:<ul id="mrs_01_1964__ul9746437184914"><li id="mrs_01_1964__li197461637154918"><strong id="mrs_01_1964__b158388431522935">spark.sql.orc.enableVectorizedReader</strong> must be set to <strong id="mrs_01_1964__b20756312222935">true</strong> (default value). Generally, the value is not changed.</li><li id="mrs_01_1964__li2746133784915"><strong id="mrs_01_1964__b182009417822935">spark.sql.codegen.wholeStage</strong> must be set to <strong id="mrs_01_1964__b39845349322935">true</strong> (default value). Generally, the value is not changed.</li><li id="mrs_01_1964__li19746133734914">The value of <strong id="mrs_01_1964__b143615367922935">spark.sql.codegen.maxFields</strong> must be greater than or equal to the number of columns in scheme.</li><li id="mrs_01_1964__li177461837134912">All data is of the AtomicType. Specifically, data is not null or of the UDT, array, or map type. If there is data of the preceding types, expected performance cannot be obtained.</li><li id="mrs_01_1964__li1571252325017"><strong id="mrs_01_1964__b82212216022935">spark.sql.orc.impl</strong> must be set to <strong id="mrs_01_1964__b14212804922935">native</strong>. The default value is <strong id="mrs_01_1964__b48629449422935">hive</strong>.</li></ul>
</li><li id="mrs_01_1964__li880319484443">If a task is submitted using the client, modification of the following parameters takes effect only after you download the client again: <span class="parmname" id="mrs_01_1964__parmname171289781422935"><b>spark.sql.orc.enableVectorizedReader</b></span>, <span class="parmname" id="mrs_01_1964__parmname85236663022935"><b>spark.sql.codegen.wholeStage</b></span>, <span class="parmname" id="mrs_01_1964__parmname152304814322935"><b>spark.sql.codegen.maxFields</b></span>, and <span class="parmname" id="mrs_01_1964__parmname86290483922935"><b>spark.sql.orc.impl</b></span>.</li></ol>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1941.html">Scenario-Specific Configuration</a></div>
</div>
</div>