Support Questions

Find answers, ask questions, and share your expertise

What is the format of --connection-param-file in Sqoop? Is it same like the option-file where we can put all the arguments of sqoop on seperate line?

avatar
Explorer
 
1 ACCEPTED SOLUTION

avatar
Super Guru

@Rajendra Kalepu

When connecting to a database using JDBC, you can optionally specify extra JDBC parameters via a property file using the option --connection-param-file The contents of this file are parsed as standard Java properties and passed into the driver while creating a connection.

sqoop import --driver some_jdbc_driver --connect <connect-string> --connection-param-file

The parameters specified via the optional property file are only applicable to JDBC connections.

--options-file

Option files can be specified anywhere in the command line as long as the options within them follow the otherwise prescribed rules of options ordering. For instance, regardless of where the options are loaded from, they must follow the ordering such that generic options appear first, tool specific options next, finally followed by options that are intended to be passed to child programs

sqoop --options-file database.props --table <table> --target-dir <target_dir>

//database.props

import

--connect jdbc:mysql://localhost:5432/test_db

--username root

--password password

View solution in original post

2 REPLIES 2

avatar
Super Guru

@Rajendra Kalepu

When connecting to a database using JDBC, you can optionally specify extra JDBC parameters via a property file using the option --connection-param-file The contents of this file are parsed as standard Java properties and passed into the driver while creating a connection.

sqoop import --driver some_jdbc_driver --connect <connect-string> --connection-param-file

The parameters specified via the optional property file are only applicable to JDBC connections.

--options-file

Option files can be specified anywhere in the command line as long as the options within them follow the otherwise prescribed rules of options ordering. For instance, regardless of where the options are loaded from, they must follow the ordering such that generic options appear first, tool specific options next, finally followed by options that are intended to be passed to child programs

sqoop --options-file database.props --table <table> --target-dir <target_dir>

//database.props

import

--connect jdbc:mysql://localhost:5432/test_db

--username root

--password password

avatar
Super Guru

@Rajendra Kalepu could you please spare some time and accept the answer if it clarify your confusion. Thanks