How to Use Oracle Wallet with Sqoop Developer API

When using Sqoop from the command line, I can use Oracle Wallet as described in the ASF Blog like:

export HADOOP_OPTS= "-Doracle.net.tns_admin=$PWD/wallet -Doracle.net.wallet_location=$PWD/wallet"

sqoop import -D mapred.map.child.java.opts= '-Doracle.net.tns_admin=. -Doracle.net.wallet_location=.' 

-files $HOME/wallet/cwallet.sso,\
$HOME/wallet/ewallet.p12,\
$HOME/wallet/sqlnet.ora,\
$HOME/wallet/tnsnames.ora \

-connect ‘jdbc:oracle:thin:@w_orcl’ \

<<rest of sqoop options>>

But how can I use the Oracle Wallet when using Sqoop's dev API, when doing something like...

import com.cloudera.sqoop.SqoopOptions()
import org.apache.sqoop.tool.ImportTool()

val options = new SqoopOptions()

// set the sqoop options here

val importTool = new ImportTool()
importTool.run(options)

...inside a Spark job that is meant to programmaticly automate multiple Sqoop jobs and SparkSQL queries?

Upvotes: 4

Views: 269

Answers (0)

Related Questions