Smut
Smut

Reputation: 89

Why does Sqoop ignore column names when importing data from SQL Database

I have following command for transferring data from my SQL database to my Azure Data Lake:

sqoop-import --connect "jdbc:sqlserver://MYDB.database.windows.net:1433;username=MYUSERNAME@MYDB;password=MYPW;database=MYDb" --table TABLENAME --target-dir adl://TESTTT.azuredatalakestore.net/Sqoop/TABLENAME

The result is fine except the fact that it doesn't include column names, is there a way to include these column names?

enter image description here

Upvotes: 2

Views: 2743

Answers (1)

Sandeep Singh
Sandeep Singh

Reputation: 8000

Typically Sqoop import doesn't support column name while importing data into HDFS. If you want to carry the schema with the data then you might consider having Sqoop to import data into Avro file format.

Other work around is that, you can use Sqoop Hive import to import the entire table as Hive table on your Hadoop Environment.

Here is good read reference for Hive import.

  1. Sqoop Hive Import
  2. Sqoop Importing data into Hive.

Upvotes: 3

Related Questions