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
Copy file name to clipboardExpand all lines: articles/hdinsight/hadoop/apache-hadoop-use-hive-curl.md
+13-16Lines changed: 13 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,12 @@
2
2
title: Use Apache Hadoop Hive with Curl in HDInsight - Azure
3
3
description: Learn how to remotely submit Apache Pig jobs to Azure HDInsight using Curl.
4
4
author: hrasheed-msft
5
+
ms.author: hrasheed
5
6
ms.reviewer: jasonh
6
-
7
7
ms.service: hdinsight
8
-
ms.custom: hdinsightactive
9
8
ms.topic: conceptual
10
-
ms.date: 06/28/2019
11
-
ms.author: hrasheed
9
+
ms.custom: hdinsightactive
10
+
ms.date: 01/06/2020
12
11
---
13
12
14
13
# Run Apache Hive queries with Apache Hadoop in HDInsight using REST
@@ -23,7 +22,7 @@ Learn how to use the WebHCat REST API to run Apache Hive queries with Apache Had
23
22
24
23
* A REST client. This document uses [Invoke-WebRequest](https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest) on Windows PowerShell and [Curl](https://curl.haxx.se/) on [Bash](https://docs.microsoft.com/windows/wsl/install-win10).
25
24
26
-
* If you use Bash, you will also need jq, a command-line JSON processor. See [https://stedolan.github.io/jq/](https://stedolan.github.io/jq/).
25
+
* If you use Bash, you'll also need jq, a command-line JSON processor. See [https://stedolan.github.io/jq/](https://stedolan.github.io/jq/).
27
26
28
27
## Base URI for Rest API
29
28
@@ -34,6 +33,7 @@ The base Uniform Resource Identifier (URI) for the REST API on HDInsight is `htt
34
33
When using cURL or any other REST communication with WebHCat, you must authenticate the requests by providing the user name and password for the HDInsight cluster administrator. The REST API is secured via [basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). To help ensure that your credentials are securely sent to the server, always make requests by using Secure HTTP (HTTPS).
35
34
36
35
### Setup (Preserve credentials)
36
+
37
37
Preserve your credentials to avoid reentering them for each example. The cluster name will be preserved in a separate step.
The actual casing of the cluster name may be different than you expect, depending on how the cluster was created. The steps here will show the actual casing, and then store it in a variable for all subsequent examples.
55
54
56
-
Edit the scripts below to replace `CLUSTERNAME` with your cluster name. Then enter the command. (The cluster name for the FQDN is not case-sensitive.)
55
+
The actual casing of the cluster name may be different than you expect, depending on how the cluster was created. The steps here will show the actual casing, and then store it in a variable for all later examples.
56
+
57
+
Edit the scripts below to replace `CLUSTERNAME` with your cluster name. Then enter the command. (The cluster name for the FQDN isn't case-sensitive.)
1. To verify that you can connect to your HDInsight cluster, use one of the following commands:
76
77
@@ -141,7 +142,7 @@ $clusterName
141
142
142
143
These statements perform the following actions:
143
144
144
-
*`DROP TABLE` - If the table already exists, it is deleted.
145
+
*`DROP TABLE` - If the table already exists, it's deleted.
145
146
* `CREATE EXTERNAL TABLE` - Creates a new 'external' table in Hive. External tables store only the table definition in Hive. The data is left in the original location.
146
147
147
148
> [!NOTE]
@@ -150,7 +151,7 @@ $clusterName
150
151
> Dropping an external table does **not** delete the data, only the table definition.
151
152
152
153
* `ROW FORMAT` - How the data is formatted. The fields in each log are separated by a space.
153
-
*`STORED AS TEXTFILE LOCATION` - Where the data is stored (the example/data directory) and that it is stored as text.
154
+
* `STORED AS TEXTFILE LOCATION` - Where the data is stored (the example/data directory) and that it's stored as text.
154
155
*`SELECT` - Selects a count of all rows where column **t4** contains the value **[ERROR]**. This statement returns a value of **3** as there are three rows that contain this value.
155
156
156
157
> [!NOTE]
@@ -182,15 +183,11 @@ $clusterName
182
183
183
184
You can list and download these files by using the [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli). For more information on using the Azure CLI with Azure Storage, see the [Use Azure CLI with Azure Storage](https://docs.microsoft.com/azure/storage/storage-azure-cli#create-and-manage-blobs) document.
184
185
185
-
## <a id="nextsteps"></a>Next steps
186
-
187
-
For general information on Hive with HDInsight:
188
-
189
-
* [Use Apache Hive with Apache Hadoop on HDInsight](hdinsight-use-hive.md)
186
+
## Next steps
190
187
191
188
For information on other ways you can work with Hadoop on HDInsight:
192
189
193
-
* [Use Apache Pig with Apache Hadoop on HDInsight](hdinsight-use-pig.md)
190
+
* [Use Apache Hive with Apache Hadoop on HDInsight](hdinsight-use-hive.md)
194
191
* [Use MapReduce with Apache Hadoop on HDInsight](hdinsight-use-mapreduce.md)
195
192
196
193
For more information on the REST API used in this document, see the [WebHCat reference](https://cwiki.apache.org/confluence/display/Hive/WebHCat+Reference) document.
0 commit comments