From the Cloudera Runtime 7.1.7 SP1 release onwards, you can use the secure access
mode to read an external table in the staging location.
In this task, you enter the following configuration options when you launch the
Spark shell.
spark.datasource.hive.warehouse.load.staging.dir=hdfs://my-cluster:8020/tmp/staging/hwc
represents the temporary subdirectories per user, per session that are created
under this directory. This is the temporary location where the output is staged
for the duration of the session. Make sure to provide the absolute path, or
fully qualified name, not the relative path of the staging dir.
spark.datasource.hive.warehouse.read.mode=secure_access starts
using the staging output mode with fine-grained access control (FGAC). No code
refactoring is required. You can use hive.sql() in your
queries.
Your administrator set up ranger permissions for using secure access mode on
Hive tables.
Your administrator granted you permission to the staging location on your file
system.
Launch the Spark shell, configuring secure access mode.
For example, use the Spark session user name
zeppelin.
Setting default log level to "WARN".
Spark context Web UI available at http://hwc-secure-1.hwc-secure.root.hwx.site:4040
Spark context available as 'sc' (master = yarn, app id = application_1637657444149_0024).
Spark session available as 'spark'.
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\
/_/
Using Scala version 2.11.12 (OpenJDK 64-Bit Server VM, Java 1.8.0_232)
Type in expressions to have them evaluated.
Type :help for more information.