Is it possible to convert entire database from SQL into Parquet format. Since writing schema for every table is time consuming are there any simple way to make it work on any database with latest version of Spark and Parquet on a cluster. Simple way of doing it per table I guess should be:
import org.apache.spark.sql.SQLContext
import java.util.HashMap
val sqlctx = new SQLContext(sc)
var options: HashMap[String, String] = new HashMap
val url_total = "jdbc:mysql://127.0.0.1:3306/DBNAME" + "?user=" + "USERNAME" + "&password=" + "PWD";
options.put("driver", "com.mysql.jdbc.Driver")
options.put("url", url_total)
options.put("dbtable", "test")
val df = sqlctx.load(source="jdbc", options)
df.toDF().saveAsParquetFile("file:///somefile.parquet")