我已经将 sqoop 表导入到 HBase,如下所示:
sqoop import --connect jdbc:mysql://${mysql-server-address}/test -username root -password admin --table Student --hbase-create-table --hbase-table student --column-family i
下一步,我试图让自由形式的查询也能正常工作,不知何故,我尝试的下面的 sqoop 命令没有按预期工作,没有从源表导入到目标 HBase 表。
sqoop import --connect jdbc:mysql://${mysql-server-address}/test -username root -password admin --query 'SELECT id, name from Student where $CONDITIONS' --split-by Student.id --hbase-create-table --hbase-table student --column-family i
第二个 sqoop 命令有什么我遗漏的吗?该文档在 HBase 导入方面非常有限。
如果有帮助,这里是命令 2 的日志:
13/08/06 21:15:43 INFO db.DataDrivenDBInputFormat: BoundingValsQuery: SELECT MIN(t1.id), MAX(t1.id) FROM (SELECT * from Student where (1 = 1) ) AS t1
13/08/06 21:15:46 INFO mapred.JobClient: Running job: job_201308061021_0025
13/08/06 21:15:47 INFO mapred.JobClient: map 0% reduce 0%
13/08/06 21:19:08 INFO mapred.JobClient: map 75% reduce 0%
13/08/06 21:19:09 INFO mapred.JobClient: map 100% reduce 0%
13/08/06 21:19:12 INFO mapred.JobClient: Job complete: job_201308061021_0025
13/08/06 21:19:12 INFO mapred.JobClient: Counters: 17
13/08/06 21:19:12 INFO mapred.JobClient: Job Counters
13/08/06 21:19:12 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=212866
13/08/06 21:19:12 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0
13/08/06 21:19:13 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0
13/08/06 21:19:13 INFO mapred.JobClient: Launched map tasks=4
13/08/06 21:19:13 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0
13/08/06 21:19:13 INFO mapred.JobClient: File Output Format Counters
13/08/06 21:19:13 INFO mapred.JobClient: Bytes Written=0
13/08/06 21:19:13 INFO mapred.JobClient: FileSystemCounters
13/08/06 21:19:13 INFO mapred.JobClient: HDFS_BYTES_READ=441
13/08/06 21:19:13 INFO mapred.JobClient: FILE_BYTES_WRITTEN=362752
13/08/06 21:19:13 INFO mapred.JobClient: File Input Format Counters
13/08/06 21:19:13 INFO mapred.JobClient: Bytes Read=0
13/08/06 21:19:13 INFO mapred.JobClient: Map-Reduce Framework
13/08/06 21:19:13 INFO mapred.JobClient: Map input records=4
13/08/06 21:19:13 INFO mapred.JobClient: Physical memory (bytes) snapshot=428892160
13/08/06 21:19:13 INFO mapred.JobClient: Spilled Records=0
13/08/06 21:19:13 INFO mapred.JobClient: CPU time spent (ms)=7730
13/08/06 21:19:13 INFO mapred.JobClient: Total committed heap usage (bytes)=312672256
13/08/06 21:19:13 INFO mapred.JobClient: Virtual memory (bytes) snapshot=5353742336
13/08/06 21:19:13 INFO mapred.JobClient: Map output records=4
13/08/06 21:19:13 INFO mapred.JobClient: SPLIT_RAW_BYTES=441
13/08/06 21:19:13 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 213.1239 seconds (0 bytes/sec)
13/08/06 21:19:13 INFO mapreduce.ImportJobBase: Retrieved 4 records.