Search code examples
scalaapache-sparkprestotrino

Connecting Presto from Spark Scala


I am new to spark. I am trying to connect to presto instance using Spark Scala. For the Presto server SSL is true and I have a Presto Keystore. My question is how will I pass this information in the connection string. Below is my Code snippit

val enrdata = sqlcontext.read.format("jdbc").option("url", "jdbc:presto://hostname:1111/hive").option("query", carrier_info).option("user", "test1").option("password", "pass123").option("driver", "io.prestosql.jdbc.PrestoDriver").load()

Solution

  • You need to add .option("SSL","true") option. https://trino.io/docs/current/installation/jdbc.html#connection-parameters