You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Karthik <ka...@yahoo.com> on 2010/05/26 01:31:00 UTC
How to export Hive query results or output to a HDFS file/folder
I need to output the query results of a Hive table to a MySQL DB. We don't want to write a DBWriter as our Hadoop cluster and DB are in different Data centers. It would help if I can output/redirect the query results to a HDFS or a local file. Is there a way?
- KK.
Re: How to export Hive query results or output to a HDFS file/folder
Posted by Aaron Kimball <aa...@cloudera.com>.
Karthik,
Check out Sqoop. It lets you run a parallel export operation to insert
HDFS-file-backed data (such as Hive tables) back into a database. If you
installed Hadoop via CDH3 (Cloudera's Distribution for Hadoop), this is
available in /usr/bin/sqoop. Otherwise see http://github.com/cloudera/sqoop.
Sqoop can also copy data in from a database to HDFS.
Cheers,
- Aaron
On Tue, May 25, 2010 at 4:31 PM, Karthik <ka...@yahoo.com> wrote:
> I need to output the query results of a Hive table to a MySQL DB. We don't
> want to write a DBWriter as our Hadoop cluster and DB are in different Data
> centers. It would help if I can output/redirect the query results to a HDFS
> or a local file. Is there a way?
>
> - KK.
>
>