Created on 04-12-2017 12:53 AM - edited 09-16-2022 04:26 AM
Hi,
Can anyone can help me to find a solution on transfering data from Hive to Sql Server? The Idea is Hive is our back up and im trying to load it to sql server.
Thank you in advance.!
Created 04-12-2017 05:00 AM
Sqoop allows you to export data from Hive to SQL Server, see Sqoop documentation here. A sample command to export a hive table would look like this:
sqoop export --connect "jdbc:sqlserver://SQLHOST:9433;databaseName=DBNAME;user=USER;password=PASSWORD" --table TABLENAME --export-dir HDFS_EXPORT_DIR
Created 04-12-2017 07:17 AM
Hi @Deepesh,
thank you for your response, but i have some question.
--table TABLENAME - is this the table on sql server where i want to dump the data?
--export-dir HDFS_EXPORT_DIR - and this command is for HDFS? but my data is on Hive.
Please correct me if im wrong
Created 04-12-2017 12:51 PM
i got this error
17/04/12 15:28:29 INFO mapreduce.Job: Counters: 8 Job Counters Failed map tasks=1 Launched map tasks=1 Rack-local map tasks=1 Total time spent by all maps in occupied slots (ms)=654614 Total time spent by all reduces in occupied slots (ms)=0 Total time spent by all map tasks (ms)=327307 Total vcore-milliseconds taken by all map tasks=327307 Total megabyte-milliseconds taken by all map tasks=502743552 17/04/12 15:28:29 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead 17/04/12 15:28:29 INFO mapreduce.ExportJobBase: Transferred 0 bytes in 342.7432 seconds (0 bytes/sec) 17/04/12 15:28:29 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead 17/04/12 15:28:29 INFO mapreduce.ExportJobBase: Exported 0 records. 17/04/12 15:28:29 ERROR mapreduce.ExportJobBase: Export job failed! 17/04/12 15:28:29 ERROR tool.ExportTool: Error during export: Export job failed!