Member since
04-24-2017
82
Posts
11
Kudos Received
1
Solution
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 1880 | 01-20-2020 03:17 AM |
01-20-2020
03:17 AM
@ChineduLB What is your exact Query? You can write count Queries SQL for Hive table. In general you can refer below articles: https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.0/performance-tuning/content/hive_prepare_to_tune_performance.html https://www.qubole.com/blog/5-tips-for-efficient-hive-queries/ Thanks, Tamil Selvan K
... View more
02-07-2018
06:45 PM
@SMACH H You can follow the below: 1. lock down the location in HDFS: set permission 700 to /apps/hive/warehouse 2. add policy to Ranger/Hive for database: *, allowing users to create databases. (note that the ambari-qa user also needs access to database: * to complete the service check) 3. Allow access to individual databases via Ranger/Hive policies. This blog post may be of interest: http://hortonworks.com/blog/best-practices-for-hive-authorization-using-apache-ranger-in-hdp-2-2/ Also you may explore the options with "hive.server2.enable.doAs"
... View more
01-15-2018
07:04 PM
5 Kudos
We can configure Hive View 2.0 to view Ranger Policies associated with any Table. It will not be configured by default (as of HDP 2.6.3) and we need to follow the below steps: 1. Go to Ambari Dasboard -> admin -> Manage Ambari 2. In the Manage Ambari page under Views section, expand Hive and then click on Hive View 2.0 3. Under the setting section, please provide the details as below: - Ranger Service Name: Go to Ranger Admin UI and check the Ranger Service Name which is configured for Hive (shown as below). Here it is tsk_hive - Provide the Ranger Admin username and password as you have configured - WebHDFS Authentication for kerberos enabled cluster: auth=KERBEROS;proxyuser=<proxyuser> Provide the ambari user principal name in place of <proxyuser> 4. After adding the above details, click on "Save". Leave the other settings as default. Additional Steps (only when you are not using local cluster): - If you are using the Local Cluster, then it is not required to change any parameters in "cluster configuration" section. - If you are using custom settings, then please provide the details as below: Once you provide the details, follow the below steps: 5. Go to Hive View 2.0 -> Tables -> click on the Table for which you want to view the Ranger Policies 6. Then click on "Authorization" Tab to view the Ranger Policies as below:
... View more
Labels:
12-23-2017
07:36 PM
4 Kudos
Beeline is a JDBC client tool which is used to connect to HiveServer2 or HiveServer2Interactive(LLAP). Beeline, which connects to HiveServer2 and requires access to only one .jar file: hive-jdbc-<version>-standalone.jar
Hortonworks recommends using HiveServer2 and a JDBC client (such as Beeline) as the primary way to access Hive. This approach uses SQL standard-based authorization or Ranger-based authorization. However, some users may wish to access Hive data from other applications, such as Pig. For these use cases, use the Hive CLI and storage-based authorization.
Connecting to Hive with Beeline
The following examples demonstrate how to use Beeline to connect to Hive for all possible variations of these modes.
Embedded Client
Use the following syntax to connect to Hive from Beeline in embedded mode:
!connect jdbc:hive2://
Remote Client with HiveServer2 TCP Transport Mode and SASL Authentication
Use the following syntax to connect to HiveServer2 in TCP mode from a remote Beeline client:
!connect jdbc:hive2://<hiveserver2host>:<port>/<db>
The default port for HiveServer2 in TCP mode is 10000 , and db is the name of the database to which you want to connect.
Connecting to HiveServer2 using Zookeeper Discovery Mode
Note: You can also find the below HiveServer2 JDBC URL from Ambari from Hive -> Summary page. To copy the JDBC URL, you can use the copy to clipboard icon next to the URL Observe the / after the <ZOOKEEPER QUORUM> in each string below - HiveServer2 using Binary Transport Mode: jdbc:hive2://<ZOOKEEPER QUORUM>/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2HiveServer2 - HiveServer2 using HTTP Transport Mode: jdbc:hive2://<ZOOKEEPER QUORUM>/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;transportMode=http;httpPath=cliservice
Connection String for connection to HiveServer2Interactive
Look for zooKeeperNamespace=hiveserver2-hive2 in the below URL
jdbc:hive2://<ZOOKEEPER QUORUM>/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2-hive2
For running Hive Scripts using Beeline, you can make use of -f option in Beeline.
beeline -u "jdbc:hive2://master01:2181,master02:2181,master03:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" -f file.hql
Reference article: https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients
Please refer above article for Beeline command options and examples for getting started with Beeline.
... View more
Labels: