hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Sprague <sprag...@gmail.com>
Subject Re: Writing data to LOCAL with Hive Server2
Date Fri, 14 Mar 2014 21:41:54 GMT
well that does complicate matters then. :)  how to get a file off a host
you don't have access to? when you say no access i presume you mean you
have no login access.

I can think of some ideas:

   1. make a case to get access so rsync can connect. (best)

   2. can you run a "hdfs dfs -get" command from you client? (next best)

   3. run your query to stdout and redirect that to your file. eg. $ hive
-host foo -port 10000 -e "select foo from bar;" >my_local_file (least
desirable)

the page i was thinking of was this:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+ImportExport
don't think it helps your situation though.


Let us know how you make out!

Cheers,
Stephen.


On Fri, Mar 14, 2014 at 10:56 AM, Kumar V <kumarbuyonline@yahoo.com> wrote:

> Thanks Stephen.
> Yes, rsync would be easy.  But we don't have access to the servers the
> hiveserver2 is running on.  Basically, there is no way to reach those files
> from our boxes. That's why I was asking about writing it locally.
> I'll check this list for import/export like you mentioned.
>
> Thanks.
>
>
>   On Friday, March 14, 2014 12:23 PM, Stephen Sprague <spragues@gmail.com>
> wrote:
>  re: HiveServer2
>
> this is not natively possible (this falls under the export rubric.)
> similarly, you can't load a file directly from your client using native
> syntax (import.)
> Believe me, you're not the only one who'd like this both of these
> functions. :)
>
> I'd search this list for import or export utilities as i remember not long
> ago someone pointed to page in the doc about these.
>
>  as an alternative i just employ rsync to push or pull the file to where
> i ultimately need it.  its one line of code which is about as easy as it
> gets.
>
>
> On Fri, Mar 14, 2014 at 5:43 AM, Kumar V <kumarbuyonline@yahoo.com> wrote:
>
>  Hi,
>    Is it possible to write data to a local file system using Hive server 2
> ?
> When I use 'insert overwrite local directory /tmp/hivedata
> ...............', it writes data in the directory on the box on which hive
> server 2 is running.
> What can I do to write this data to the file system of the box I am
> running this Java/Python program from ?
>
> Other option was to write this data in HDFS.  But I would like to like to
>  write to local file if I can.
>
> Please let me know if it is possible.
>
> Thanks.
>
>
>
>
>

Mime
View raw message