You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Ved Prakash <me...@gmail.com> on 2008/03/11 10:41:14 UTC

loading data into hbase table

Hi friends,

I have a table dump in csv format, I wanted to load this data into my hbase
table instead of typing it as inserts. I did a web search and also looked
into the hbase documentation but couldn't find any thing.

Can someone tell me how to load a file from local disk into hbase table on
hdfs?

Thanks

Re: loading data into hbase table

Posted by Ved Prakash <me...@gmail.com>.
Thanks for the pseudo code Jim. Bryan thanks for the information.

Regards.

On Tue, Mar 11, 2008 at 10:04 PM, Jim Kellerman <ji...@powerset.com> wrote:

> Unless there are some unstated requirements, a simple Java program can do
> what you want.
>
> pseudo code:
> open csv file using java.io.File
> open table in hbase: HTable table = new HTable(conf,mytablename)
> while (more records in csv file) {
>  read line from csv, split into columns
>  id = table.startUpdate(rowname)
>  for (each column-name, value-pair) {
>    table.put(id, column-name, column-value)
>  }
>  table.commit(id)
> }
>
> ---
> Jim Kellerman, Senior Engineer; Powerset
>
>
> > -----Original Message-----
> > From: Ved Prakash [mailto:meramailinglist@gmail.com]
> > Sent: Tuesday, March 11, 2008 2:41 AM
> > To: core-user@hadoop.apache.org
> > Subject: loading data into hbase table
> >
> > Hi friends,
> >
> > I have a table dump in csv format, I wanted to load this data
> > into my hbase table instead of typing it as inserts. I did a
> > web search and also looked into the hbase documentation but
> > couldn't find any thing.
> >
> > Can someone tell me how to load a file from local disk into
> > hbase table on hdfs?
> >
> > Thanks
> >
> > No virus found in this incoming message.
> > Checked by AVG.
> > Version: 7.5.518 / Virus Database: 269.21.7/1322 - Release
> > Date: 3/9/2008 12:17 PM
> >
> >
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.518 / Virus Database: 269.21.7/1322 - Release Date: 3/9/2008
> 12:17 PM
>
>

RE: loading data into hbase table

Posted by Jim Kellerman <ji...@powerset.com>.
Unless there are some unstated requirements, a simple Java program can do what you want.

pseudo code:
open csv file using java.io.File
open table in hbase: HTable table = new HTable(conf,mytablename)
while (more records in csv file) {
  read line from csv, split into columns
  id = table.startUpdate(rowname)
  for (each column-name, value-pair) {
    table.put(id, column-name, column-value)
  }
  table.commit(id)
}

---
Jim Kellerman, Senior Engineer; Powerset


> -----Original Message-----
> From: Ved Prakash [mailto:meramailinglist@gmail.com]
> Sent: Tuesday, March 11, 2008 2:41 AM
> To: core-user@hadoop.apache.org
> Subject: loading data into hbase table
>
> Hi friends,
>
> I have a table dump in csv format, I wanted to load this data
> into my hbase table instead of typing it as inserts. I did a
> web search and also looked into the hbase documentation but
> couldn't find any thing.
>
> Can someone tell me how to load a file from local disk into
> hbase table on hdfs?
>
> Thanks
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.518 / Virus Database: 269.21.7/1322 - Release
> Date: 3/9/2008 12:17 PM
>
>

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.518 / Virus Database: 269.21.7/1322 - Release Date: 3/9/2008 12:17 PM


RE: loading data into hbase table

Posted by Jim Kellerman <ji...@powerset.com>.
Unless there are some unstated requirements, a simple Java program can do what you want.

pseudo code:
open csv file using java.io.File
open table in hbase: HTable table = new HTable(conf,mytablename)
while (more records in csv file) {
  read line from csv, split into columns
  id = table.startUpdate(rowname)
  for (each column-name, value-pair) {
    table.put(id, column-name, column-value)
  }
  table.commit(id)
}

---
Jim Kellerman, Senior Engineer; Powerset


> -----Original Message-----
> From: Ved Prakash [mailto:meramailinglist@gmail.com]
> Sent: Tuesday, March 11, 2008 2:41 AM
> To: core-user@hadoop.apache.org
> Subject: loading data into hbase table
>
> Hi friends,
>
> I have a table dump in csv format, I wanted to load this data
> into my hbase table instead of typing it as inserts. I did a
> web search and also looked into the hbase documentation but
> couldn't find any thing.
>
> Can someone tell me how to load a file from local disk into
> hbase table on hdfs?
>
> Thanks
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.518 / Virus Database: 269.21.7/1322 - Release
> Date: 3/9/2008 12:17 PM
>
>

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.518 / Virus Database: 269.21.7/1322 - Release Date: 3/9/2008 12:17 PM


Re: loading data into hbase table

Posted by Bryan Duxbury <br...@rapleaf.com>.
Ved,

At the moment you're stuck loading the data via one of the APIs  
(Java, REST or Thrift) yourself. We would like to have import tools  
for HBase, but we haven't gotten around to it yet.

Also, there's now a separate HBase mailing list at hbase- 
user@hadoop.apache.org. Your questions about HBase are better asked  
there in the future.

-Bryan

On Mar 11, 2008, at 2:41 AM, Ved Prakash wrote:

> Hi friends,
>
> I have a table dump in csv format, I wanted to load this data into  
> my hbase
> table instead of typing it as inserts. I did a web search and also  
> looked
> into the hbase documentation but couldn't find any thing.
>
> Can someone tell me how to load a file from local disk into hbase  
> table on
> hdfs?
>
> Thanks