phoenix spark插件

ttcibm8c  于 2021-06-10  发布在  Hbase
关注(0)|答案(1)|浏览(454)

插件更新到spark 2.0了吗?我不能用这个插件

val df = spark.read
        .format("org.apache.phoenix.spark")
        .option("table", "web_stat")
        .option("zkUrl", "localhost:2181")
        .option("driver","org.apache.phoenix.jdbc.PhoenixDriver")
        .load()

错误:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/sql/DataFrame

只要jdbc连接Phoenix城就行了!
当我使用spark jdbc连接器时,它就来了

val df = spark.read
        .format("jdbc")
        .option("driver", "org.apache.phoenix.jdbc.PhoenixDriver")
        .option("url", " jdbc:phoenix:localhost:2181")
        .option("dbtable", "web_stat")
        .load()

错误
org.apache.spark.sql.execution.datasources.jdbc.jdbcrdd$.resolvetable(jdbcrdd)的线程“main”java.lang.nullpointerexception中出现异常。scala:167)在org.apache.spark.sql.execution.datasources.jdbc.jdbcreation。scala:117)在org.apache.spark.sql.execution.datasources.jdbc.jdbcrelationprovider.createrelation(jdbcrelationprovider)。scala:53)位于org.apache.spark.sql.execution.datasources.datasource.resolvererelation(datasource。scala:345)位于org.apache.spark.sql.dataframereader.load(dataframereader。scala:149)在org.apache.spark.sql.dataframereader.load(dataframereader。scala:122)位于org.apache.spark.sql.phoenix.sparkphoenix示例$.main(sparkphoenix示例)。scala:65)

wtlkbnrh

wtlkbnrh1#

spark 2.0尚未与phoenix合作。查看此url以获取修补程序https://issues.apache.org/jira/browse/phoenix-3333

相关问题