Reputation: 11
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
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
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