Skip to content

Commit 8889dba

Browse files
authored
Merge pull request #112018 from dagiro/freshness_c12
freshness_c12
2 parents a978578 + 2b88a29 commit 8889dba

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

articles/hdinsight/hadoop/apache-hadoop-connect-hive-jdbc-driver.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ author: hrasheed-msft
55
ms.author: hrasheed
66
ms.reviewer: jasonh
77
ms.service: hdinsight
8-
ms.custom: hdinsightactive,hdiseo17may2017
98
ms.topic: conceptual
10-
ms.date: 02/17/2020
9+
ms.custom: hdinsightactive,hdiseo17may2017
10+
ms.date: 04/20/2020
1111
---
1212

1313
# Query Apache Hive through the JDBC driver in HDInsight
1414

1515
[!INCLUDE [ODBC-JDBC-selector](../../../includes/hdinsight-selector-odbc-jdbc.md)]
1616

17-
Learn how to use the JDBC driver from a Java application to submit Apache Hive queries to Apache Hadoop in Azure HDInsight. The information in this document demonstrates how to connect programmatically, and from the SQuirreL SQL client.
17+
Learn how to use the JDBC driver from a Java application. To submit Apache Hive queries to Apache Hadoop in Azure HDInsight. The information in this document demonstrates how to connect programmatically, and from the SQuirreL SQL client.
1818

1919
For more information on the Hive JDBC Interface, see [HiveJDBCInterface](https://cwiki.apache.org/confluence/display/Hive/HiveJDBCInterface).
2020

@@ -26,7 +26,7 @@ For more information on the Hive JDBC Interface, see [HiveJDBCInterface](https:/
2626

2727
## JDBC connection string
2828

29-
JDBC connections to an HDInsight cluster on Azure are made over port 443, and the traffic is secured using TLS/SSL. The public gateway that the clusters sit behind redirects the traffic to the port that HiveServer2 is actually listening on. The following connection string shows the format to use for HDInsight:
29+
JDBC connections to an HDInsight cluster on Azure are made over port 443. The traffic is secured using TLS/SSL. The public gateway that the clusters sit behind redirects the traffic to the port that HiveServer2 is actually listening on. The following connection string shows the format to use for HDInsight:
3030

3131
jdbc:hive2://CLUSTERNAME.azurehdinsight.net:443/default;transportMode=http;ssl=true;httpPath=/hive2
3232

@@ -38,17 +38,17 @@ Or you can get the connection through **Ambari UI > Hive > Configs > Advanced**.
3838

3939
### Host name in connection string
4040

41-
Host name 'CLUSTERNAME.azurehdinsight.net' in the connection string is the same as your cluster URL. You can get it through Azure portal.
41+
Host name 'CLUSTERNAME.azurehdinsight.net' in the connection string is the same as your cluster URL. You can get it through Azure portal.
4242

4343
### Port in connection string
4444

45-
You can only use **port 443** to connect to the cluster from some places outside of the Azure virtual network. HDInsight is a managed service, which means that all connections to the cluster are managed via a secure Gateway. You cannot connect to HiveServer 2 directly on ports 10001 or 10000 because these ports are not exposed to the outside.
45+
You can only use **port 443** to connect to the cluster from some places outside of the Azure virtual network. HDInsight is a managed service, which means all connections to the cluster are managed via a secure Gateway. You can't connect to HiveServer 2 directly on ports 10001 or 10000. These ports aren't exposed to the outside.
4646

4747
## Authentication
4848

49-
When establishing the connection, you must use the HDInsight cluster admin name and password to authenticate to the cluster gateway. When connecting from JDBC clients such as SQuirreL SQL, you must enter the admin name and password in client settings.
49+
When establishing the connection, use the HDInsight cluster admin name and password to authenticate. From JDBC clients such as SQuirreL SQL, enter admin name and password in client settings.
5050

51-
From a Java application, you must use the name and password when establishing a connection. For example, the following Java code opens a new connection using the connection string, admin name, and password:
51+
From a Java application, you must use the name and password when establishing a connection. For example, the following Java code opens a new connection:
5252

5353
```java
5454
DriverManager.getConnection(connectionString,clusterAdmin,clusterPassword);
@@ -81,7 +81,7 @@ SQuirreL SQL is a JDBC client that can be used to remotely run Hive queries with
8181
|Property | Value |
8282
|---|---|
8383
|Name|Hive|
84-
|Example URL|jdbc:hive2://localhost:443/default;transportMode=http;ssl=true;httpPath=/hive2|
84+
|Example URL|`jdbc:hive2://localhost:443/default;transportMode=http;ssl=true;httpPath=/hive2`|
8585
|Extra Class Path|Use the **Add** button to add the all of jar files downloaded earlier.|
8686
|Class Name|org.apache.hive.jdbc.HiveDriver|
8787
@@ -91,15 +91,15 @@ SQuirreL SQL is a JDBC client that can be used to remotely run Hive queries with
9191
9292
6. On the left of the SQuirreL SQL window, select **Aliases**. Then select the **+** icon to create a connection alias.
9393
94-
![SQuirreL SQL add new alias dialog](./media/apache-hadoop-connect-hive-jdbc-driver/hdinsight-new-aliases.png)
94+
![`SQuirreL SQL add new alias dialog`](./media/apache-hadoop-connect-hive-jdbc-driver/hdinsight-new-aliases.png)
9595
9696
7. Use the following values for the **Add Alias** dialog:
9797
9898
|Property |Value |
9999
|---|---|
100100
|Name|Hive on HDInsight|
101101
|Driver|Use the drop-down to select the **Hive** driver.|
102-
|URL|jdbc:hive2://CLUSTERNAME.azurehdinsight.net:443/default;transportMode=http;ssl=true;httpPath=/hive2. Replace **CLUSTERNAME** with the name of your HDInsight cluster.|
102+
|URL|`jdbc:hive2://CLUSTERNAME.azurehdinsight.net:443/default;transportMode=http;ssl=true;httpPath=/hive2`. Replace **CLUSTERNAME** with the name of your HDInsight cluster.|
103103
|User Name|The cluster login account name for your HDInsight cluster. The default is **admin**.|
104104
|Password|The password for the cluster login account.|
105105
@@ -148,25 +148,20 @@ at java.util.concurrent.FutureTask.get(FutureTask.java:206)
148148

149149
### Connection disconnected by HDInsight
150150

151-
**Symptoms**: When trying to download huge amount of data (say several GBs) through JDBC/ODBC, the connection is disconnected by HDInsight unexpectedly while downloading.
151+
**Symptoms**: When trying to download huge amount of data (say several GBs) through JDBC/ODBC, the connection is disconnected by HDInsight unexpectedly while downloading.
152152

153-
**Cause**: This error is caused by the limitation on Gateway nodes. When getting data from JDBC/ODBC, all data needs to pass through the Gateway node. However, a gateway is not designed to download a huge amount of data, so the connection might be closed by the Gateway if it cannot handle the traffic.
153+
**Cause**: This error is caused by the limitation on Gateway nodes. When getting data from JDBC/ODBC, all data needs to pass through the Gateway node. However, a gateway isn't designed to download a huge amount of data, so the Gateway might close the connection if it can't handle the traffic.
154154

155155
**Resolution**: Avoid using JDBC/ODBC driver to download huge amounts of data. Copy data directly from blob storage instead.
156156

157-
158157
## Next steps
159158

160159
Now that you've learned how to use JDBC to work with Hive, use the following links to explore other ways to work with Azure HDInsight.
161160

162161
* [Visualize Apache Hive data with Microsoft Power BI in Azure HDInsight](apache-hadoop-connect-hive-power-bi.md).
163162
* [Visualize Interactive Query Hive data with Power BI in Azure HDInsight](../interactive-query/apache-hadoop-connect-hive-power-bi-directquery.md).
164-
* [Use Apache Zeppelin to run Apache Hive queries in Azure HDInsight](../interactive-query/hdinsight-connect-hive-zeppelin.md).
165163
* [Connect Excel to HDInsight with the Microsoft Hive ODBC Driver](apache-hadoop-connect-excel-hive-odbc-driver.md).
166164
* [Connect Excel to Apache Hadoop by using Power Query](apache-hadoop-connect-excel-power-query.md).
167-
* [Connect to Azure HDInsight and run Apache Hive queries using Data Lake Tools for Visual Studio](apache-hadoop-visual-studio-tools-get-started.md).
168-
* [Use Azure HDInsight Tool for Visual Studio Code](../hdinsight-for-vscode.md).
169-
* [Upload data to HDInsight](../hdinsight-upload-data.md)
170165
* [Use Apache Hive with HDInsight](hdinsight-use-hive.md)
171-
* [Use Apache Pig with HDInsight](hdinsight-use-pig.md)
166+
* [Use Apache Pig with HDInsight](../use-pig.md)
172167
* [Use MapReduce jobs with HDInsight](hdinsight-use-mapreduce.md)

0 commit comments

Comments
 (0)