Skip to content

Commit 2a0fafa

Browse files
authored
Merge pull request #107928 from lanicolas/patch-18
Aligning with Bash style guide
2 parents ad9afaf + b7204f2 commit 2a0fafa

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/hdinsight/hadoop/apache-hadoop-use-sqoop-mac-linux.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ Learn how to use Apache Sqoop to import and export between an Apache Hadoop clus
3232
1. For ease of use, set variables. Replace `PASSWORD`, `MYSQLSERVER`, and `MYDATABASE` with the relevant values, and then enter the commands below:
3333
3434
```bash
35-
export password='PASSWORD'
36-
export sqlserver="MYSQLSERVER"
37-
export database="MYDATABASE"
35+
export PASSWORD='PASSWORD'
36+
export SQL_SERVER="MYSQLSERVER"
37+
export DATABASE="MYDATABASE"
3838
3939
40-
export serverConnect="jdbc:sqlserver://$sqlserver.database.windows.net:1433;user=sqluser;password=$password"
41-
export serverDbConnect="jdbc:sqlserver://$sqlserver.database.windows.net:1433;user=sqluser;password=$password;database=$database"
40+
export SERVER_CONNECT="jdbc:sqlserver://$SQL_SERVER.database.windows.net:1433;user=sqluser;password=$PASSWORD"
41+
export SERVER_DB_CONNECT="jdbc:sqlserver://$SQL_SERVER.database.windows.net:1433;user=sqluser;password=$PASSWORD;database=$DABATASE"
4242
```
4343
4444
## Sqoop export
@@ -48,31 +48,31 @@ From Hive to SQL.
4848
1. To verify that Sqoop can see your database, enter the command below in your open SSH connection. This command returns a list of databases.
4949
5050
```bash
51-
sqoop list-databases --connect $serverConnect
51+
sqoop list-databases --connect $SERVER_CONNECT
5252
```
5353
5454
1. Enter the following command to see a list of tables for the specified database:
5555
5656
```bash
57-
sqoop list-tables --connect $serverDbConnect
57+
sqoop list-tables --connect $SERVER_DB_CONNECT
5858
```
5959
6060
1. To export data from the Hive `hivesampletable` table to the `mobiledata` table in your database, enter the command below in your open SSH connection:
6161
6262
```bash
63-
sqoop export --connect $serverDbConnect \
63+
sqoop export --connect $SERVER_DB_CONNECT \
6464
-table mobiledata \
6565
--hcatalog-table hivesampletable
6666
```
6767
6868
1. To verify that data was exported, use the following queries from your SSH connection to view the exported data:
6969
7070
```bash
71-
sqoop eval --connect $serverDbConnect \
71+
sqoop eval --connect $SERVER_DB_CONNECT \
7272
--query "SELECT COUNT(*) from dbo.mobiledata WITH (NOLOCK)"
7373
7474
75-
sqoop eval --connect $serverDbConnect \
75+
sqoop eval --connect $SERVER_DB_CONNECT \
7676
--query "SELECT TOP(10) * from dbo.mobiledata WITH (NOLOCK)"
7777
```
7878
@@ -83,7 +83,7 @@ From SQL to Azure storage.
8383
1. Enter the command below in your open SSH connection to import data from the `mobiledata` table in SQL, to the `wasbs:///tutorials/usesqoop/importeddata` directory on HDInsight. The fields in the data are separated by a tab character, and the lines are terminated by a new-line character.
8484
8585
```bash
86-
sqoop import --connect $serverDbConnect \
86+
sqoop import --connect $SERVER_DB_CONNECT \
8787
--table mobiledata \
8888
--target-dir 'wasb:///tutorials/usesqoop/importeddata' \
8989
--fields-terminated-by '\t' \
@@ -93,7 +93,7 @@ From SQL to Azure storage.
9393
1. Alternatively, you can also specify a Hive table:
9494
9595
```bash
96-
sqoop import --connect $serverDbConnect \
96+
sqoop import --connect $SERVER_DB_CONNECT \
9797
--table mobiledata \
9898
--target-dir 'wasb:///tutorials/usesqoop/importeddata2' \
9999
--fields-terminated-by '\t' \

0 commit comments

Comments
 (0)