You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import java.util._
import java.sql._
Class.forName("jp.ne.opt.redshiftfake.postgres.FakePostgresqlDriver")
val endpoint = "http://localhost:9444/" // in production, scheme will be "s3://"
val url = "jdbc:postgresql://localhost:5439/testdb"
val prop = new Properties()
prop.setProperty("driver", "jp.ne.opt.redshiftfake.postgres.FakePostgresqlDriver")
prop.setProperty("user", "rsdbo")
prop.setProperty("password", "testpass")
val conn = DriverManager.getConnection(url, prop)
val stmt = conn.createStatement()
val unloadSql =
s"""unload ('select * from tbl') to '${endpoint}foo/unloaded_'
|credentials 'aws_access_key_id=AKIAXXXXXXXXXXXXXXX;aws_secret_access_key=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
|manifest""".stripMargin
println(unloadSql)
stmt.execute(unloadSql)
The error i'm getting is:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "unload"
Position: 1
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
The text was updated successfully, but these errors were encountered:
Hi, I'm trying to get this driver to work in Python, but wanted to test with it in Scala first. I'm unable to get the example on the readme to work.
My build.sbt file looks like:
and my scala code looks like:
The error i'm getting is:
The text was updated successfully, but these errors were encountered: