Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

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?

New Contributor
 
1 ACCEPTED SOLUTION

@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

@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

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

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.