forked from docs/doc-exports
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>
19 lines
3.1 KiB
HTML
19 lines
3.1 KiB
HTML
<a name="mrs_01_2040"></a><a name="mrs_01_2040"></a>
|
|
|
|
<h1 class="topictitle1">Why Does the "--hivevar" Option I Specified in the Command for Starting spark-beeline Fail to Take Effect?</h1>
|
|
<div id="body1595920222653"><div class="section" id="mrs_01_2040__se1d7b6d8521741fa856cfd07577495c7"><h4 class="sectiontitle">Question</h4><p id="mrs_01_2040__a5785405f7cb04b40a67dcf2473958fa3">Why does the <i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2040__cdbeac002e4ed4cb081d906c36a4b0717">--hivevar</span></b></i><strong id="mrs_01_2040__abfdc171327064f2bb0591ea3ac453d43"> </strong>option I specified in the command for starting spark-beeline fail to take effect?</p>
|
|
<p id="mrs_01_2040__a1224c4553a5246209341c98c724f18b6">In the V100R002C60 version, if I use the <i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2040__c5cf2f05ca0274218ba30cc71f2160847">--hivevar <VAR_NAME>=<var_value></span></b></i> option to define a variable in the command for starting spark-beeline, no error is reported in spark-beeline. However, if the variable <i><span class="varname" id="mrs_01_2040__vee97b7a6bd5940e8a110b03a17560983"><VAR_NAME></span></i> is used in SQL, the variable cannot be parsed and the <VAR_NAME> exception is reported.</p>
|
|
<p id="mrs_01_2040__a630f781bd4d44d7b80a415ba77c10e50">For example:</p>
|
|
<ol id="mrs_01_2040__o1bda2ed8b7ba4d0a8f2c729dd0f56d6e"><li id="mrs_01_2040__l351c148935fd469ab3cd918034f407a3">Run the following command to start the spark-beeline:<p id="mrs_01_2040__a338602e73416488ab2df2e950a47dabb"><a name="mrs_01_2040__l351c148935fd469ab3cd918034f407a3"></a><a name="l351c148935fd469ab3cd918034f407a3"></a><i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2040__cf65d974a9c84416c90201b1c487895d5">spark-beeline --hivevar <VAR_NAME>=<var_value></span></b></i></p>
|
|
</li></ol><ol start="2" id="mrs_01_2040__od118835a9b484223a4e023b5ee6b2770"><li id="mrs_01_2040__lbace10f1dc3f471b81fdd06da61952af">After spark-beeline is started successfully, I run the SQL statements <i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2040__ced76c13b23df4fb288f4f4b5a2bd263d">DROP TABLE ${VAR_NAME}</span></b></i> in spark-beeline. The VAR_NAME exception occurs.</li></ol>
|
|
</div>
|
|
<div class="section" id="mrs_01_2040__sd10e0894f4f046569735fd25447e8c74"><h4 class="sectiontitle">Answer</h4><p id="mrs_01_2040__a625a63a511d243cf8836e848a564a1e4">In the V100R002C60 version, the <i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2040__cacc8fd18f7834d638c0fce8e12c1e216">--hivevar <VAR_NAME>=<var_value></span></b></i> feature of Hive is not supported in Spark because multi-session management function is added. Therefore, the <i><b><span class="cmdname" style="font-family:Arial" id="mrs_01_2040__c7568e889448e423bbfa2dda396de7cb7">--hivevar</span></b></i> option in the command for starting spark-beeline is invalid.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_2022.html">Spark SQL and DataFrame</a></div>
|
|
</div>
|
|
</div>
|
|
|