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>
17 lines
2.2 KiB
HTML
17 lines
2.2 KiB
HTML
<a name="mrs_01_2063"></a><a name="mrs_01_2063"></a>
|
|
|
|
<h1 class="topictitle1">Why Does the Foreign Table Query Fail When Multiple Foreign Tables Are Created in the Same Directory?</h1>
|
|
<div id="body1595920225827"><div class="section" id="mrs_01_2063__section1881570174512"><h4 class="sectiontitle">Question</h4><p id="mrs_01_2063__p03056162457">Assume there is a data file path named <strong id="mrs_01_2063__b17311602832921">/test_data_path</strong>. User A creates a foreign table named <strong id="mrs_01_2063__b13499315752921">tableA</strong> for the directory, and user B creates a foreign table named <strong id="mrs_01_2063__b13929054612921">tableB</strong> for the directory. When user B performs the insert operation on <strong id="mrs_01_2063__b14678783012921">tableB</strong>, user A fails to query data using <strong id="mrs_01_2063__b12674519292921">tableA</strong> and the error "Permission denied" is displayed.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_2063__section10326688454"><h4 class="sectiontitle">Answer</h4><p id="mrs_01_2063__p1085722484514">After user B performs the insert operation on <strong id="mrs_01_2063__b10269741622921">tableB</strong>, a new data file is generated in the foreign table path and the file belongs to user B. When user A queries data using <strong id="mrs_01_2063__b4330683272921">tableA</strong>, all files in the foreign table directory are read. In this case, the query fails because user A does not have the read permissions on the file generated by user B.</p>
|
|
<p id="mrs_01_2063__p17857182464516">This problem also occurs in other scenarios. For example, the <strong id="mrs_01_2063__b5980548032921">inset overwrite</strong> operation will also duplicate other table files in this directory.</p>
|
|
<p id="mrs_01_2063__p38571324174517">Due to the Spark SQL implementation mechanism, check restrictions in this scenario will lead to inconsistency and performance deterioration. Therefore, no restriction is added in this scenario, and this method is not recommended.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_2002.html">Common Issues About Spark2x</a></div>
|
|
</div>
|
|
</div>
|
|
|