Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop export from hive to maria db

Sqoop export from hive to maria db

 
5 REPLIES 5
Highlighted

Re: Sqoop export from hive to maria db

Master Collaborator

Try DASH DASH for your arguments:

--hcatalog

--table

Also, best advice always try and search your errors for solutions: "sqoop Unrecognized argument: -hcatalog", "sqoop Unrecognized argument: -table"

I like to search here, stack, or google....

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

Highlighted

Re: Sqoop export from hive to maria db

Mentor

@Gayathri Devi

Can you share your complete sqoop command

Highlighted

Re: Sqoop export from hive to maria db

Hi @Gayathri Devi
it seems you're trying to use

-hcatalog-table
The argument value for this option is the HCatalog tablename. The presence of the --hcatalog-table option signifies that the import or export job is done using HCatalog tables, and it is a required option for HCatalog jobs.

But it looks like you have an accidental space between the -hcatalog and -table, resulting in a command syntax issue;

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.5/bk_data-movement-and-integration/content/sq...

Highlighted

Re: Sqoop export from hive to maria db

@Gayathri Devi
Perhaps this works, i haven't tried this myself yet as I don't currently have any lab setup using mariaDB.
Edit; This may also be helpful: https://sqoop.apache.org/docs/1.4.2/SqoopUserGuide.html#_syntax_3
I've noticed now the --export-dir is also required;

sqoop export \
--connect "jdbc:mariadb://localhost/example" \
--username mariadb \
--password mariadb \
--table hivetable \
--export-dir /apps/hive/warehouse/hivetable
Highlighted

Re: Sqoop export from hive to maria db

@Gayathri Devi
I've created a database in MariaDB and exported a hive table using sqoop on my lab setup.
This worked well for me;

[sqoop@jsneep-lab ~]$ sqoop export --connect jdbc:mysql://172.3.2.1/export --username mariadb --password mariadb --table exported --direct --export-dir /apps/hive/warehouse/drivers

Make sure you have /usr/share/java/mysql-connector-java.jar present on your system, this gave me trouble initially.

Don't have an account?
Coming from Hortonworks? Activate your account here