There isn't any automated way. Note that as the DataFrame implementation improves, it will probably do a better job with query optimization than hand-rolled Scala code. I don't know if that's true yet, though.
For now, there are a few examples at the beginning of the DataFrame scaladocs <http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.DataFrame> page showing typical scenarios. Also, the DataFrameSuite of tests in the Spark source code has many examples. If you scan through the list of methods, you'll see that many of them have the same name as the corresponding SQL keyword. HTH, Dean Dean Wampler, Ph.D. Author: Programming Scala, 2nd Edition <http://shop.oreilly.com/product/0636920033073.do> (O'Reilly) Typesafe <http://typesafe.com> @deanwampler <http://twitter.com/deanwampler> http://polyglotprogramming.com On Mon, Mar 23, 2015 at 11:42 AM, nishitd <nishitde...@yahoo.com> wrote: > I have a complex SparkSQL query of the nature > > select a.a, b.b, c.c from a,b,c where a.x = b.x and b.y = c.y > > How do I convert this efficiently into scala query of > > a.join(b,..,..) > > and so on. Can anyone help me with this? If my question needs more > clarification, please let me know. > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/Converting-SparkSQL-query-to-Scala-query-tp22192.html > Sent from the Apache Spark User List mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > >