Database Reference
In-Depth Information
For example, assuming that you have a database called sqoopdemo deployed in SQL Azure that has a table called
stock_analysis , you can execute the import command in Listing 6-8 to import that table's data into blob storage.
Listing 6-8. The Sqoop import command
sqoop import --connect "jdbc:sqlserver://<Server>.database.windows.net;username=debarchans@<Server>;
password=<Password>;database=sqoopdemo" --table stock_analysis --target-dir
example/data/StockAnalysis --as-textfile -m 1
On successful execution of the import job, you will see output on the Sqoop console similar to Listing 6-9.
Listing 6-9. The Sqoop import output
Warning: HBASE_HOME and HBASE_VERSION not set.
Warning: HBASE_HOME does not exist HBase imports will fail.
Please set HBASE_HOME to the root of your HBase installation.
13/12/10 01:04:42 INFO manager.SqlManager: Using default fetchSize of 1000
13/12/10 01:04:42 INFO tool.CodeGenTool: Beginning code generation
13/12/10 01:04:46 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM
[stock_analysis] AS t WHERE 1=0
13/12/10 01:04:47 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is
c:\apps\dist\hadoop-1.2.0.1.3.1.0-06
13/12/10 01:04:47 INFO orm.CompilationManager: Found hadoop core jar at: c:\apps\dist
\hadoop-1.2.0.1.3.1.0-06\hadoop-core.jar
Note: \tmp\sqoop-hadoopuser\compile\72c67877dd976aed8e4a36b3baa4519b\stock_analysis.java
uses or overrides a deprecated API.
Note: Recompile with -Xlint: deprecation for details.
13/12/10 01:04:49 INFO orm.CompilationManager: Writing jar file: \tmp\sqoop-hadoopuser\compile\72c67
877dd976aed8e4a36b3baa4519b\stock_analysis.jar
13/12/10 01:04:50 INFO mapreduce.ImportJobBase: Beginning import of stock_analysis
13/12/10 01:04:56 INFO mapred.JobClient: Running job: job_201311240635_0197
13/12/10 01:04:57 INFO mapred.JobClient: map 0% reduce 0%
13/12/10 01:05:42 INFO mapred.JobClient: map 100% reduce 0%
13/12/10 01:05:45 INFO mapred.JobClient: Job complete: job_201311240635_0197
13/12/10 01:05:45 INFO mapred.JobClient: Counters: 19
13/12/10 01:05:45 INFO mapred.JobClient: Job Counters
13/12/10 01:05:45 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=37452
13/12/10 01:05:45 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving
slots (ms)=0
13/12/10 01:05:45 INFO mapred.JobClient: Total time spent by all maps waiting after
reserving slots (ms)=0
13/12/10 01:05:45 INFO mapred.JobClient: Launched map tasks=1
13/12/10 01:05:45 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0
13/12/10 01:05:45 INFO mapred.JobClient: File Output Format Counters
13/12/10 01:05:45 INFO mapred.JobClient: Bytes Written=2148196
13/12/10 01:05:45 INFO mapred.JobClient: FileSystemCounters
13/12/10 01:05:45 INFO mapred.JobClient: FILE_BYTES_READ=770
13/12/10 01:05:45 INFO mapred.JobClient: HDFS_BYTES_READ=87
13/12/10 01:05:45 INFO mapred.JobClient: FILE_BYTES_WRITTEN=76307
13/12/10 01:05:45 INFO mapred.JobClient: WASB_BYTES_WRITTEN=2148196
Search WWH ::




Custom Search