Search code examples
hivesqoop

Sqoop Query into Hive Table


I want to specify a file location in the --query argument of a sqoop import query, something like this
--query "/home_dir/z0027vp/sqoop_common.sql"

Is it possible in Hive? I searched online regarding this and could not find information regarding it. Any help would be greatly appreciated.


Solution

  • No this is not possible in sqoop import. You have to mention SQL query itself in --query argument.

    First of all you can't use your SQL as it it in sqoop free form query. You need to add WHERE $CONDITIONS in the query.

    Check documentation for more details.

    So read this file home_dir/z0027vp/sqoop_common.sql and modifty SQL by adding WHERE $CONDITIONS and then modify your shell script and execute sqoop command.