Prakash Tripathi
Prakash Tripathi

Reputation: 11

Spark Sql vs Spark Data frame API

Can anyone explain when to use Spark SQL(plain sql queries) and Spark Data Frame methods .I see we can do every operation with spark sql . Which is better in performance

Upvotes: 1

Views: 294

Answers (2)

jishmisc28
jishmisc28

Reputation: 9

From a usage perspective, it's hard to catch a syntax error until runtime in Spark SQL while using Dataframe APIs we can catch those at compile time.

Upvotes: 0

OneCricketeer
OneCricketeer

Reputation: 191983

They are both equally performant.

Using dataframe APIs guarantees type safety, and can be further optimized by the SQL engine/query builder

Upvotes: 1

Related Questions