Я использую PySpark 2 и пытаюсь получить доступ к данным из Vertica, аутентифицированным Kerberos.
Я использую следующий механизм с драйвером JDBC:
# PySpark python 3.5
krb_url = "jdbc:vertica://vertica.example.net:5433/DB;" + \
"integratedSecurity=true;authenticationSchema=JavaKeberos;principal=userx;keytab=/home/userx/userx.keytab;"
query = " (SELECT id FROM schema.table limit 10) as t1"
kdf = spark.read.format("jdbc") \
.option("driver", "com.vertica.jdbc.Driver") \
.option("url", krb_url) \
.option("dbtable", query) \
.load()
Однако я получаю следующееошибка:
Py4JJavaError: An error occurred while calling o68.load.
: java.lang.NullPointerException
at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:72)
at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.<init>(JDBCRelation.scala:113)
at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:47)
at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:306)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:178)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
at py4j.Gateway.invoke(Gateway.java:280)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:214)
at java.lang.Thread.run(Thread.java:745)