It is possible to export data from HDFS to RDBMS table using Sqoop. But it seems like we need to have existing table.
Is there some parameter to tell Sqoop do the 'CREATE TABLE' thing and export data to this newly crated table?
If yes, is it going to work with Oracle?
Sqoop - Export. Those are read and parsed into a set of records and delimited with user-specified delimiter. The default operation is to insert all the record from the input files to the database table using the INSERT statement. In update mode, Sqoop generates the UPDATE statement that replaces the existing record into the database.
Bookmark this question. Show activity on this post. It is possible to export data from HDFS to RDBMS table using Sqoop. But it seems like we need to have existing table. Is there some parameter to tell Sqoop do the 'CREATE TABLE' thing and export data to this newly crated table? If yes, is it going to work with Oracle? Show activity on this post.
TemplateTableName is a table that exists in Oracle prior to executing the Sqoop command. ps. You'll have to use --direct sqoop export option to activate sqoop direct mode = 'Data Connector for Oracle and Hadoop' (aka OraOOP - older name).
This tip gives basic commands to import table from Mysql to Hadoop File system and Import the files from HDFS back to Mysql. Sqoop is basically used to Import data from RDBMS system to Hadoop distributed File system (HDFS). And for Exporting data from HDFS back to RDBMS, Sqoop is used.
You can actually execute arbitrary SQL queries and DDL via sqoop eval, at least with MySQL and MSSQL. I'd expect it to work with Oracle as well. MSSQL example:
sqoop eval --connect 'jdbc:sqlserver://<DB SERVER>:<DB PORT>;
database=<DB NAME>' --query "CREATE TABLE..."
--username <USERNAME> -P
I'm afraid that Sqoop do not support creating tables in the RDBMS at the moment. Sqoop uses the table in RDBMS to get metadata (number of columns and their data types), so I'm not sure where Sqoop could get the metadata to create the table for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With