Search code examples
sql-serverhadoophivesandboxsqoop

How do I use Sqoop for importing data from a relational DB to sandbox Hive?


How do I use Sqoop for importing data from a relational DB to Hive in Sandbox. I have Installed Horton Works sandbox in MY PC. Nw i want to know this migration.I have referd this link http://hortonworks.com/kb/using-apache-sqoop-for-data-import-from-relational-dbs/ But i am confused with some doubt 1, Is it need any Sqoop software for running? 2, In above mensioned link some code is there where i will put this code? In Hive query window? 3, Is it possible to migrate a database Fully(or at a time table only)? 4, What about Stored procedure and Viwes where i will kept all these?


Solution

  • 1- You will need Microsoft SQL Server Connector for Apache Hadoop to do that which can be downloaded from here.

    2- You have to issue the import command from the Sqoop shell. I would suggest you to go through the Sqoop document once, specially section 7.2.10 which tell us about importing data into Hive.

    3- You could:

    4- And once your data in inside the Hadoop cluster you can no more use your SQL procedures. Stored procedure languages typically do more of their logic with result sets. Because hive result sets are typically large the aggregations and transformations are done either with functions or streaming.You need to think about some alternative. But you can have views in Hive. To find more on views in Hive you can go here.

    HTH