From fdd49274cbfeb70c4a4a4e76231b6148bc316bec Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Fri, 1 Mar 2013 15:34:54 -0800 Subject: [PATCH] HBASE-7975 ImportTsv document table creation HBASE-5741 updated ImportTsv to create the target table if it doesn't exist. This ticket updates the documentation as appropriate. --- .../src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java | 2 +- src/docbkx/ops_mgt.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java index 63ec902..2bb45c1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java @@ -345,7 +345,7 @@ public class ImportTsv { "By default importtsv will load data directly into HBase. To instead generate\n" + "HFiles of data to prepare for a bulk data load, pass the option:\n" + " -D" + BULK_OUTPUT_CONF_KEY + "=/path/for/output\n" + - " Note: if you do not use this option, then the target table must already exist in HBase\n" + + " Note: the target table will be created with default column family descriptors if it does not already exist.\n" + "\n" + "Other options that may be specified with -D include:\n" + " -D" + SKIP_LINES_CONF_KEY + "=false - fail if encountering an invalid line\n" + diff --git a/src/docbkx/ops_mgt.xml b/src/docbkx/ops_mgt.xml index a83f55d..ee8a30f 100644 --- a/src/docbkx/ops_mgt.xml +++ b/src/docbkx/ops_mgt.xml @@ -190,7 +190,7 @@ input data. By default importtsv will load data directly into HBase. To instead generate HFiles of data to prepare for a bulk data load, pass the option: -Dimporttsv.bulk.output=/path/for/output - Note: if you do not use this option, then the target table must already exist in HBase + Note: the target table will be created with default column family descriptors if it does not already exist. Other options that may be specified with -D include: -Dimporttsv.skip.bad.lines=false - fail if encountering an invalid line @@ -218,7 +218,7 @@ row10 c1 c2 For ImportTsv to use this imput file, the command line needs to look like this: - HADOOP_CLASSPATH=`${HBASE_HOME}/bin/hbase classpath` ${HADOOP_HOME}/bin/hadoop jar ${HBASE_HOME}/hbase-VERSION.jar importtsv -Dimporttsv.columns=HBASE_ROW_KEY,d:c1,d:c2 -Dimporttsv.bulk.output=hdfs://storefileoutput datatsv hdfs://inputfile + HADOOP_CLASSPATH=`${HBASE_HOME}/bin/hbase classpath` ${HADOOP_HOME}/bin/hadoop jar ${HBASE_HOME}/hbase-VERSION.jar importtsv -Dimporttsv.columns=HBASE_ROW_KEY,d:c1,d:c2 -Dimporttsv.bulk.output=hdfs://storefileoutput datatsv hdfs://inputfile ... and in this example the first column is the rowkey, which is why the HBASE_ROW_KEY is used. The second and third columns in the file will be imported as "d:c1" and "d:c2", respectively. -- 1.8.1