Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How does spark support connecting to two different databases in a single app

Solved Go to solution
Highlighted

How does spark support connecting to two different databases in a single app

New Contributor

I'm thinking to connect spark from MySQL to Postgres in one single app could anyone help me how to do it I have tried adding jars of both the DB's in the classpath but either of the one works, please shed light or guide me on this

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How does spark support connecting to two different databases in a single app

@Naresh AR

You can create 2 different dataframes with 2 different jdbc sources(one with mysql and another one with postgres) and make sure both the jdbc jars are present in spark's classpath.

2 REPLIES 2

Re: How does spark support connecting to two different databases in a single app

@Naresh AR

You can create 2 different dataframes with 2 different jdbc sources(one with mysql and another one with postgres) and make sure both the jdbc jars are present in spark's classpath.

Re: How does spark support connecting to two different databases in a single app

New Contributor

@Sandeep Nemuri my use case was to move the MySQL data to PostgreSQL for which my cluster has 5tb ram and data may grow (as of now 200Million) is that achievable from spark and will that affect the cluster.

Previously data transfer was from sqoop to hive and then any target db