- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Question about beeline connection using spark-hive client
- Labels:
-
Apache Spark
Created ‎06-28-2017 06:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a cluster with ranger enabled and trying to connect to hive using hive-spark beeline
Command:
/usr/hdp/current/spark2-client/bin/beeline -n testuser1 -p testuser1 -u "jdbc:hive2://<host:<port>/;principal=hive/_HOST@EXAMPLE.COM"
Output:
Connecting to jdbc:hive2://<host>:<port>/;principal=hive/_HOST@EXAMPLE.COM INFO Utils: Supplied authorities: <host>:<port> INFO Utils: Resolved authority: <host>:<port> WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable INFO HiveConnection: Will try to open client transport with JDBC Uri: jdbc:hive2://<host>:<port>/;principal=hive/_HOST@EXAMPLE.COM Error: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [testuser1] does not have [USE] privilege on [Unknown resource!!] (state=42000,code=40000) Beeline version 1.2.1.spark2.hdp.1 by Apache Hive 0: jdbc:hive2://<host>- (closed)>
The same works fine for HSI client
/usr/hdp/current/hive-client/bin/beeline -n testuser1 -p testuser1 -u "jdbc:hive2://<host>:<port>;principal=hive/_HOST@EXAMPLE.COM" Connecting to jdbc:hive2://<host>:<port>;principal=hive/_HOST@EXAMPLE.COM Connected to: Apache Hive (version 2.1.0.2.6.1.0-111) Driver: Hive JDBC (version 1.2.1000.2.6.1.0-111) Transaction isolation: TRANSACTION_REPEATABLE_READ Beeline version 1.2.1000.2.6.1.0-111 by Apache Hive 0: jdbc:hive2://<host>->
Could someone help with identifying the reason for failure for hive-spark beeline.
It says the user doesnot have use privilege on unknown resource.
Thanks
Created ‎06-28-2017 06:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In case of spark-hive client, if no database is specified in the connection url, it uses default db and tries to use that, since there is no policy configured for default db it fails. So, create a Ranger policy for default db granting access, whereas in case of HSI client the connection doesn't use any database.
Created ‎06-28-2017 06:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In case of spark-hive client, if no database is specified in the connection url, it uses default db and tries to use that, since there is no policy configured for default db it fails. So, create a Ranger policy for default db granting access, whereas in case of HSI client the connection doesn't use any database.
Created ‎06-28-2017 06:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Surya. It worked.
