Created
October 6, 2020 16:50
-
-
Save naren-dremio/f961e3313b83e1e69cff0ec834fa09db to your computer and use it in GitHub Desktop.
dremio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%scala | |
Class.forName("com.dremio.jdbc.Driver") | |
val jdbcPort = 31010 | |
val jdbcDatabase = "DREMIO" | |
val user = "" | |
val password = "" | |
val tbl = "postgres.public.actor" | |
// Create the JDBC URL without passing in the user and password parameters. | |
val jdbcUrl = "jdbc:dremio:direct=<HOST>:31010" | |
// Create a Properties() object to hold the parameters. | |
import java.util.Properties | |
val connectionProperties = new Properties() | |
connectionProperties.put("user", user) | |
connectionProperties.put("password", password) | |
val driverClass = "com.dremio.jdbc.Driver" | |
connectionProperties.setProperty("Driver", driverClass) | |
val employees_table = spark.read.jdbc(jdbcUrl, tbl, connectionProperties) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment