Sql – Is it possible to connect to TeraData from Spark SQL and run queries over it

apache-spark, sql, teradata

So far, I have been able to Connect and run queries over Mysql database using spark SQL using Mysql JDBC driver registering it as spark Data frame.

Is it possible to connect to TeraData from Spark SQL and run queries over it?

Best Solution

Question : Is it possible to connect to TeraData from Spark SQL and run queries over it?

Yes its possible.

create a dataframe like below example and run spark sql on top of that.

Below is the way for spark jdbc

val jdbcDF = sqlContext.load("jdbc", Map(  "url" -> "jdbc:teradata://<server_name>, TMODE=TERA, user=my_user, password=*****",  "dbtable" -> "schema.table_name", // here also can be select query  "driver" -> "com.teradata.jdbc.TeraDriver"))