Quantcast

How can I export HBase table using start and stop row key

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How can I export HBase table using start and stop row key

karunakar
Hi,

I would like to fetch data from hbase table using map reduce export API. I
see that I can fetch data using start and stop time, but I don't see any
information regarding start and stop row key. Can any expert guide me or
give me an example in order fetch first 1000 rows (or start and stop row
key) using export API ?

Hadoop 2.0.0-cdh4.1.2 HBase 0.92.1-cdh4.1.2

Please let me know if you need more information.

Thank you.



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/How-can-I-export-HBase-table-using-start-and-stop-row-key-tp4051960.html
Sent from the HBase User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I export HBase table using start and stop row key

Dhaval Shah
The version you are using only support PrefixFilter and RegexFilter for scans. Unless your start and stop row have the same prefix (or you can somehow get it into a regex), you won't be able to do it as is. You can always write your own export (we did that to support some more functionality like batching, etc and its very easy to do)
 
Regards,
Dhaval


________________________________
 From: karunakar <[hidden email]>
To: [hidden email]
Sent: Monday, 21 October 2013 5:40 PM
Subject: How can I export HBase table using start and stop row key
 

Hi,

I would like to fetch data from hbase table using map reduce export API. I
see that I can fetch data using start and stop time, but I don't see any
information regarding start and stop row key. Can any expert guide me or
give me an example in order fetch first 1000 rows (or start and stop row
key) using export API ?

Hadoop 2.0.0-cdh4.1.2 HBase 0.92.1-cdh4.1.2

Please let me know if you need more information.

Thank you.



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/How-can-I-export-HBase-table-using-start-and-stop-row-key-tp4051960.html
Sent from the HBase User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I export HBase table using start and stop row key

karunakar
Hi Dhaval,

Can you please share your code if possible ? it would benefit others as well.

Thanks,
karunakar.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I export HBase table using start and stop row key

Dhaval Shah
Hi Karunakar. Unfortunately due to organizational restrictions I am not allowed to share my code. However, its a very simple modification. 

Basically look at Export.java within the hbase mapreduce package. Look for the function getConfiguredScanForJob (might be named differently based on your version) and add the required hbase Filter to your scan or you can also add a start row/stop row to your scan. Should not be more than 3 lines of code to do what you need
 
Regards,
Dhaval


________________________________
 From: karunakar <[hidden email]>
To: [hidden email]
Sent: Monday, 21 October 2013 7:36 PM
Subject: Re: How can I export HBase table using start and stop row key
 

Hi Dhaval,

Can you please share your code if possible ? it would benefit others as
well.

Thanks,
karunakar.



--
View this message in context: http://apache-hbase.679495.n3.nabble.com/How-can-I-export-HBase-table-using-start-and-stop-row-key-tp4051961p4051972.html

Sent from the HBase User mailing list archive at Nabble.com.
Loading...