spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mich Talebzadeh <>
Subject Re: jdbcRRD and dataframe
Date Mon, 25 Jul 2016 14:38:44 GMT
Hi Marco,

what is in your UDF getConnection and why not use DF itself?

I guess it is all connection attributes

val c = HiveContext.load("jdbc",
Map("url" -> _ORACLEserver,
"user" -> _username,
"password" -> _password))


Dr Mich Talebzadeh

LinkedIn *

*Disclaimer:* Use it at your own risk. Any and all responsibility for any
loss, damage or destruction of data or any other property which may arise
from relying on this email's technical content is explicitly disclaimed.
The author will in no case be liable for any monetary damages arising from
such loss, damage or destruction.

On 25 July 2016 at 15:14, Marco Colombo <> wrote:

> Hi all,
> I was using JdbcRRD and signature for constructure was accepting a function to get a
DB connection. This is very useful to provide my own connection handler.
> I'm valuating to move to daraframe, but I cannot how to provide such function and migrate
my code. I want to use my own 'getConnection' rather than provide connection details.
> JdbcRDD(SparkContext sc,
>        scala.Function0<java.sql.Connection> getConnection,
>        .....,
> to
>  val df: DataFrame ="jdbc").options(options).load();
> How this can be achieved?
> Thanks!

View raw message