Created on 04-21-2016 01:30 PM - edited 09-16-2022 03:15 AM
Created 04-21-2016 02:29 PM
You need use sqoop for direct import on hive form sql.
First download sql jdbc https://www.microsoft.com/en-us/download/details.aspx?id=11774
place jar on sqoop master server: /usr/hdp/current/sqoop-server/lib
use this command for import:
import --connect jdbc:sqlserver://[SQL_SERVER_NAME]:[SQL_PORT]/[DB-NAME] --username "[SQL_USERNAME]" --password "[PASSWORD]" --query '[INSERT QUERY HERE] WHERE $CONDITIONS' -m 1 --hive-import --hive-database [DB_HIVE] --create-hive-table --hive-table [HIVE_TABLE]
if use --query you must have WHERE $CONDITIONS on query.
Created 04-21-2016 02:02 PM
You can simply use sqoop
Created 04-21-2016 02:05 PM
Created 04-21-2016 02:29 PM
You need use sqoop for direct import on hive form sql.
First download sql jdbc https://www.microsoft.com/en-us/download/details.aspx?id=11774
place jar on sqoop master server: /usr/hdp/current/sqoop-server/lib
use this command for import:
import --connect jdbc:sqlserver://[SQL_SERVER_NAME]:[SQL_PORT]/[DB-NAME] --username "[SQL_USERNAME]" --password "[PASSWORD]" --query '[INSERT QUERY HERE] WHERE $CONDITIONS' -m 1 --hive-import --hive-database [DB_HIVE] --create-hive-table --hive-table [HIVE_TABLE]
if use --query you must have WHERE $CONDITIONS on query.