RE: save DF to JDBC

2015-10-05 Thread Young, Matthew T
I’ve gotten it to work with SQL Server (with limitations; it’s buggy and doesn’t work with some types/operations). https://spark.apache.org/docs/latest/api/java/org/apache/spark/sql/DataFrameWriter.html is the Java API you are looking for; the JDBC method lets you write to JDBC databases. I

Re: save DF to JDBC

2015-10-05 Thread Richard Hillegas
Hi Ruslan, Here is some sample code which writes a DataFrame to a table in a Derby database: import org.apache.spark.sql._ import org.apache.spark.sql.types._ val binaryVal = Array[Byte] ( 1, 2, 3, 4 ) val timestampVal = java.sql.Timestamp.valueOf("1996-01-01 03:30:36") val dateVal =

Re: save DF to JDBC

2015-10-05 Thread Ruslan Dautkhanov
Thank you Richard and Matthew. DataFrameWriter first appeared in Spark 1.4. Sorry, I should have mentioned earlier, we're on CDH 5.4 / Spark 1.3. No options for this version? Best regards, Ruslan Dautkhanov On Mon, Oct 5, 2015 at 4:00 PM, Richard Hillegas wrote: > Hi