Member since
05-30-2018
1322
Posts
715
Kudos Received
148
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 4041 | 08-20-2018 08:26 PM | |
| 1943 | 08-15-2018 01:59 PM | |
| 2370 | 08-13-2018 02:20 PM | |
| 4102 | 07-23-2018 04:37 PM | |
| 5010 | 07-19-2018 12:52 PM |
07-07-2016
02:52 AM
@Frank Welsch Yes.
... View more
07-06-2016
10:28 PM
5 Kudos
This tutorial will show how to export data out of hbase table into csv format. We will use airport data from american statical association available here. Assume you have a sandbox up and running lets start. First ssh into your sandbox and switch user to hdfs sudo su - hdfs Then grab the airport data by issues a wget wget http://stat-computing.org/dataexpo/2009/airports.csv For my example the file is located /home/hdfs/airports.csv Now lets create a hbase table called "airports" with column family "info". Do this in hbase shell Now that the table is created lets load it. Get out of hbase shell. as user hdfs run the following to load the table hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=, -Dimporttsv.columns="HBASE_ROW_KEY,info:iata,info:airport,info:city,info:country,info:lat,info:long" airports hdfs://sandbox.hortonworks.com:/tmp/airports.csv That will kick off map reduce job to load airport table in hbase. once that is done you can do a quick verify in hbase shell by running counts 'airports' You should see 3368 records in the table. Now lets log into pig shell. We will create a variable called airport_data which we will load our hbase table into by issuing: airport_data = LOAD 'hbase://airports'
USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(
'info:iata,info:airport,info:city,info:country,info:lat,info:long', '-loadKey true')
AS (iata,airport,city,country,lat,long); Now that we have our data in a variable lets dump it to hdfs using csv format by issuing: store airport_data into 'airportData/export' using PigStorage(','); So we have dumped the export into hdfs directory airportData/export. Lets go view it And there you go. We have loaded data into hbase table. Exported data from the table using pig in csv format. Happy pigging.
... View more
Labels:
07-06-2016
08:39 PM
1 Kudo
Follow the instructions here on how to download and import the vm into virtual box Once you have imported the vm select the vm and click on setting Then click on network To assign a IP in the attach to down drop list select "Bridge Adapter" Then under option Promiscuous Mode select "Allow All" Now start your vm Once the machine is up verify you have a IP address Now you have IP for your vm. have fun.
... View more
Labels:
07-06-2016
05:17 PM
hmmm wow. nice work.
... View more
07-06-2016
05:06 PM
@Ali Bajwa yes /etc/hosts works. also I enabled bridge network to get a ip.
... View more
07-06-2016
03:57 PM
@mqureshi do you mind sharing details of the change? Would be useful to others.w
... View more
07-06-2016
01:55 AM
@avoma oozie-861 has been closed in 3.3.0.
... View more
07-06-2016
12:45 AM
@Krzysztof Zarzycki I don't see it supported in the 2.4.2 release notes. I downloaded 2.5 sandbox. May be in that release.
... View more
07-06-2016
12:41 AM
@Emily Sharpe you can create columns as place holders. I have done this in a few projects. If you want to filter out you can use api setFilterIfIMissing and singlecolumnvaluefilter.
... View more