You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
18
18
19
19
For more information on the Hive JDBC Interface, see [HiveJDBCInterface](https://cwiki.apache.org/confluence/display/Hive/HiveJDBCInterface).
20
20
@@ -26,7 +26,7 @@ For more information on the Hive JDBC Interface, see [HiveJDBCInterface](https:/
26
26
27
27
## JDBC connection string
28
28
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:
@@ -38,17 +38,17 @@ Or you can get the connection through **Ambari UI > Hive > Configs > Advanced**.
38
38
39
39
### Host name in connection string
40
40
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.
42
42
43
43
### Port in connection string
44
44
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.
46
46
47
47
## Authentication
48
48
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.
50
50
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:
|Extra Class Path|Use the **Add** button to add the all of jar files downloaded earlier.|
86
86
|Class Name|org.apache.hive.jdbc.HiveDriver|
87
87
@@ -91,15 +91,15 @@ SQuirreL SQL is a JDBC client that can be used to remotely run Hive queries with
91
91
92
92
6. On the left of the SQuirreL SQL window, select **Aliases**. Then select the **+** icon to create a connection alias.
93
93
94
-

94
+

95
95
96
96
7. Use the following values for the **Add Alias** dialog:
97
97
98
98
|Property |Value |
99
99
|---|---|
100
100
|Name|Hive on HDInsight|
101
101
|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.|
103
103
|User Name|The cluster login account name for your HDInsight cluster. The default is **admin**.|
104
104
|Password|The password for the cluster login account.|
105
105
@@ -148,25 +148,20 @@ at java.util.concurrent.FutureTask.get(FutureTask.java:206)
148
148
149
149
### Connection disconnected by HDInsight
150
150
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.
152
152
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.
154
154
155
155
**Resolution**: Avoid using JDBC/ODBC driver to download huge amounts of data. Copy data directly from blob storage instead.
156
156
157
-
158
157
## Next steps
159
158
160
159
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.
161
160
162
161
*[Visualize Apache Hive data with Microsoft Power BI in Azure HDInsight](apache-hadoop-connect-hive-power-bi.md).
163
162
*[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).
165
163
*[Connect Excel to HDInsight with the Microsoft Hive ODBC Driver](apache-hadoop-connect-excel-hive-odbc-driver.md).
166
164
*[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)
170
165
*[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)
172
167
*[Use MapReduce jobs with HDInsight](hdinsight-use-mapreduce.md)
0 commit comments