0

I was using hive CLI to directly run the INSERT OVERWRITE LOCAL DIRECTORY 'local/machine/folder/location' SELECT * FROM table. The Hive CLI would download/get the file to the client machine location.

Now I'm moving to beeline. The same command invoked through beeline would download/get the file to hiveserver2 machine.

beeline -u ${hive_resource_jdbcurl} ${hive_resource_username} ${hive_resource_password} ${hive_resource_driverclass} -S -e "${insert_overwrite_command}"

Want to know if there is any way to get the file to the client instead of hiveserver2 machine.

Eg., HiverServer2 machine - HS2_Machine AppServer/WebServer machine - App1_Machine

Beeline command(Insert overwrite local directory) will be triggered from App1_Machine which will move the output to local directory in HS2_Machine. I want to know if there is a way/command to get the file to appserver App1_Machine local.

PS: Don't want to scp or move the file from HS2_Machine to AppServer using scp/ftp, because I'm dealing with huge volume and I don't want two operation (Storing it in HS2_Machine and then moving that huge file into App1_Machine).

Makubex
  • 419
  • 3
  • 19
  • 1
    Possible duplicate of [Export as csv in beeline hive](https://stackoverflow.com/questions/39577036/export-as-csv-in-beeline-hive) – OneCricketeer May 20 '18 at 14:39
  • @cricket_007 : Thanks for the suggestion. I'm already using that only in beeline. I've edited my question to add more clarity. – Makubex May 21 '18 at 03:44
  • 1
    The marked duplicate exports a CSV wherever you run the command not the Hive server... You don't need scp or overwrite local directory – OneCricketeer May 21 '18 at 03:49
  • @cricket_007: My bad. I missed out the redirection used in that query. Thanks. – Makubex May 21 '18 at 03:49

0 Answers0