Git Product home page Git Product logo

importtsv's Introduction

Generating Hfile from TSV/CSV file

Build jar cp/sftp cloudera cdh service

mvn clean package
cp target/import-tsv-0.0.1.jar /opt/cloudera/parcels/CDH-5.13.1-1.cdh5.13.1.p0.2/lib/hbase/lib

Uploaded test.csv To HDFS

cat << EOF >test.csv 
a1,b1,c1
a2,b2
a3,,c3
a4,b4,null
EOF
hdfs dfs -mkdir -p /tmp/src
hdfs dfs -put test.csv /tmp/src

HBase table splits Region(5 node)

create 'test',{NAME => 'T', VERSIONS => 10},SPLITS => ['3|','6|','9|','c|']  

Generating Hfile (rowkey=HmacMD5(privateKeyStr,column[T:b]))

hbase org.apache.hadoop.hbase.mapreduce.ImportTsv \
-Dimporttsv.separator=, \
-Dimporttsv.skip.empty.columns=true \
-Dimporttsv.columns=HBASE_ROW_KEY,T:a,T:b,T:c \
-Dgenerate.rowkey=2 \
-Dhmacmd5.secretKey=privateKeyStr \
-Dimporttsv.log.bad.lines=true
-Dimporttsv.bulk.output=/tmp/test \
'test' /tmp/src/test.csv

Load Incremental HFiles

hbase org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles \
/tmp/test test

importtsv's People

Watchers

James Cloos avatar Yongbin Xu avatar

Forkers

namiy-yy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.