Sqoop Interview Questions and Answers
Ques 16. What is the purpose of the --direct-import option in Sqoop?
The --direct-import option is used to import data directly into the database without using HDFS as an intermediate storage.
Ques 17. Explain the purpose of the --query option in Sqoop.
The --query option allows you to specify a SQL SELECT statement to retrieve data during Sqoop import.
Example:
sqoop import --connect jdbc:mysql://localhost:3306/db --query SELECT * FROM mytable WHERE $CONDITIONS --split-by id
Ques 18. What is the purpose of the --null-string and --null-non-string options in Sqoop?
These options are used to specify the representation of NULL values in the imported data for string and non-string columns, respectively.
Example:
sqoop import --connect jdbc:mysql://localhost:3306/db --table mytable --null-string --null-non-string -1
Ques 19. Explain the purpose of the --boundary-query option in Sqoop.
The --boundary-query option allows you to specify a SQL query that is used to determine the range of values for the splitting column.
Example:
sqoop import --connect jdbc:mysql://localhost:3306/db --table mytable --boundary-query SELECT MIN(id), MAX(id) FROM mytable
Ques 20. What is the purpose of the --validate option in Sqoop?
The --validate option is used to perform data validation during import by comparing the source and target data counts.
Example:
sqoop import --connect jdbc:mysql://localhost:3306/db --table mytable --validate
Most helpful rated by users: