In Apache Spark 2.0.0, is it possible to fetch a query from an external database (rather than grab the whole table)?

Same as in 1.x you can pass valid subquery as dbtable argument for example:

...
.option("dbtable", "(SELECT foo, bar FROM schema.tablename) AS tmp")
...

Leave a Comment