Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Spark create table from multiple jobs vs single job method

avatar
Rising Star

Hi,

 

I have a table with a lot of data,

I want to create a new table based on some column values from this based

 

which method is most efficient and cluster resources friendly

 

Pseudo-Code

 

1. single job

        insert into myNewTable

         select * from myOldTable

         where a=xxx etc.

 

2. two jobs:

    job1. create datafame from select statement      

         select * from myOldTable

         where a=xxx etc. as dataframe

 

    job2 write dataframe as new table

         insert into myNewTable select from dataframe

1 ACCEPTED SOLUTION

avatar
Super Guru
Hi,

I do not think there is any different. Spark lazily executes statements, so you second 2 jobs version will behave the same way as the first single job, in my opinion.

Cheers
Eric

View solution in original post

1 REPLY 1

avatar
Super Guru
Hi,

I do not think there is any different. Spark lazily executes statements, so you second 2 jobs version will behave the same way as the first single job, in my opinion.

Cheers
Eric