【原创】大叔经验分享(55)spark连接kudu报错
spark-2.4.2
kudu-1.7.0
开始尝试
1)自己手工将jar加到classpath
spark-2.4.2-bin-hadoop2.6
+
kudu-spark2_2.11-1.7.0-cdh5.16.1.jar
# bin/spark-shell
scala> val df = spark.read.options(Map("kudu.master" -> "master:7051", "kudu.table" -> "impala::test.tbl_test")).format("kudu").load
java.lang.ClassNotFoundException: Failed to find data source: kudu. Please find packages at http://spark.apache.org/third-party-projects.html
at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:660)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:194)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:167)
... 49 elided
Caused by: java.lang.ClassNotFoundException: kudu.DefaultSource
at scala.reflect.internal.util.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:72)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.spark.sql.execution.datasources.DataSource$.$anonfun$lookupDataSource$5(DataSource.scala:634)
at scala.util.Try$.apply(Try.scala:213)
at org.apache.spark.sql.execution.datasources.DataSource$.$anonfun$lookupDataSource$4(DataSource.scala:634)
at scala.util.Failure.orElse(Try.scala:224)
at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:634)
... 51 more
2)采用官方的方式(将kudu版本改为1.7.0)
spark-2.4.2-bin-hadoop2.6
# bin/spark-shell --packages org.apache.kudu:kudu-spark2_2.11:1.7.0
same error
3)采用官方的方式(不修改)
spark-2.4.2-bin-hadoop2.6
# bin/spark-shell --packages org.apache.kudu:kudu-spark2_2.11:1.9.0
scala> val df = spark.read.options(Map("kudu.master" -> "master:7051", "kudu.table" -> "impala::test.tbl_test")).format("kudu").load
java.lang.NoClassDefFoundError: scala/Product$class
at org.apache.kudu.spark.kudu.Upsert$.<init>(OperationType.scala:41)
at org.apache.kudu.spark.kudu.Upsert$.<clinit>(OperationType.scala)
at org.apache.kudu.spark.kudu.DefaultSource$$anonfun$getOperationType$2.apply(DefaultSource.scala:217)
at org.apache.kudu.spark.kudu.DefaultSource$$anonfun$getOperationType$2.apply(DefaultSource.scala:217)
at scala.Option.getOrElse(Option.scala:138)
at org.apache.kudu.spark.kudu.DefaultSource.getOperationType(DefaultSource.scala:217)
at org.apache.kudu.spark.kudu.DefaultSource.createRelation(DefaultSource.scala:104)
at org.apache.kudu.spark.kudu.DefaultSource.createRelation(DefaultSource.scala:87)
at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:318)
at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:167)
... 49 elided
Caused by: java.lang.ClassNotFoundException: scala.Product$class
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 61 more
看起来是scala版本冲突,到spark下载页面发现一句话:
Note that, Spark is pre-built with Scala 2.11 except version 2.4.2, which is pre-built with Scala 2.12.
4)kudu-spark改为scala2.12
spark-2.4.2-bin-hadoop2.6
# bin/spark-shell --packages org.apache.kudu:kudu-spark2_2.12:1.9.0
:::::::::::::::::::::::::::::::::::::::::::::: :: UNRESOLVED DEPENDENCIES :: :::::::::::::::::::::::::::::::::::::::::::::: :: org.apache.kudu#kudu-spark2_2.12;1.9.0: not found ::::::::::::::::::::::::::::::::::::::::::::::
好吧,下载2.4.3
5)采用官方的方式(继续)
spark-2.4.3-bin-hadoop2.6
# bin/spark-shell --packages org.apache.kudu:kudu-spark2_2.11:1.9.0
scala> val df = spark.read.options(Map("kudu.master" -> "master:7051", "kudu.table" -> "impala::test.tbl_test")).format("kudu").load
df: org.apache.spark.sql.DataFrame = [order_no: string, id: bigint ... 28 more fields]
正常了
6)采用官方的方式(将kudu版本改为1.7.0)
spark-2.4.3-bin-hadoop2.6
# bin/spark-shell --packages org.apache.kudu:kudu-spark2_2.11:1.7.0
same error
看来spark连接kudu只能采用scala2.11+kudu-spark2_2.11:1.9.0
参考:
https://kudu.apache.org/docs/developing.html
http://spark.apache.org/downloads.html
【原创】大叔经验分享(55)spark连接kudu报错的更多相关文章
- 【原创】大叔经验分享(53)kudu报错unable to find SASL plugin: PLAIN
kudu安装后运行不正常,master中找不到任何tserver,查看tserver日志发现有很多报错: Failed to heartbeat to master:7051: Invalid arg ...
- 【原创】大叔经验分享(51)docker报错Exited (137)
docker container启动失败,报错:Exited (137) *** ago,比如 Exited (137) 16 seconds ago 这时通过docker logs查不到任何日志,从 ...
- 【原创】大叔经验分享(63)kudu vs parquet
一 对比 存储空间对比: 查询性能对比: 二 设计方案 将数据拆分为:历史数据(hdfs+parquet+snappy)+ 近期数据(kudu),可以兼具各种优点: 1)整体低于10%的磁盘占用: 2 ...
- 【原创】大叔经验分享(61)kudu rebalance报错
kudu rebalance命令报错 terminate called after throwing an instance of 'std::regex_error' what(): regex_e ...
- 【原创】大叔经验分享(62)kudu副本数量
kudu的副本数量是在表上设置,可以通过命令查看 # sudo -u kudu kudu cluster ksck $master ... Summary by table Name | RF | S ...
- 【原创】大叔经验分享(59)kudu查看table size
kudu并没有命令可以直接查看每个table占用的空间,可以从cloudera manager上间接查看 CM is scrapping and aggregating the /metrics pa ...
- 【原创】大叔经验分享(58)kudu写入压力大时报错
kudu写入压力大时报错 19/05/18 16:53:12 INFO AsyncKuduClient: Invalidating location fd52e4f930bc45458a8f29ed1 ...
- 【原创】大叔经验分享(38)beeline连接hiveserver2报错impersonate
beeline连接hiveserver2报错 Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost: ...
- 【原创】大叔问题定位分享(33)beeline连接presto报错
hive2.3.4 presto0.215 使用hive2.3.4的beeline连接presto报错 $ beeline -d com.facebook.presto.jdbc.PrestoDriv ...
随机推荐
- Java多线程-程序运行堆栈分析
class文件内容 class文件包含JAVA程序执行的字节码:数据严格按照格式紧凑排列在class文件中的二进制流,中间无任何分隔符:文件开头有一个0xcafebabe(16进制)特殊的一个标志. ...
- springboot中如何启动tomcat
springboot启动时,会自动识别出当前环境是否是web环境还是非web环境. 默认的web环境的context(DEFAULT_WEB_CONTEXT_CLASS):org.springfram ...
- 自定义Dialog布局的弹窗功能的简单实现
package com.loaderman.dialogdemo; import android.os.Bundle; import android.support.v7.app.AlertDialo ...
- numpy之数组计算
# coding=utf-8import numpy as npimport random #数组和数字计算,进行广播计算,包括加减乘除 t8 = t8 +2 print(t8,t8.dtype,t8 ...
- Linux scp 免密码 传输文件
Linux scp 免密码 传输文件 背景介绍 最近项目是集群化部署(由 node1,node2,node3 三台 CentOS 7.4 的虚拟机构成). 但是,涉及到跨机器同步文件的问题,想通过写s ...
- JAVA学习记录<一>
一: JAVA初体验: 1.JAVA简介: 2.环境搭建: 3:MyEclipse的使用简介: 4:程序的移植:项目的导入,导出. 5:学习JAVA的经验: 多写,多问,总结和复习!!!
- python去掉空格和 b
直接看下面实例: In [52]: output=subprocess.check_output(["head -c 16 /dev/urandom | od -An -t x | tr - ...
- subprocess.call 使用
1.subprocess.call 里面的命令分开写,实例如下: subprocess.call 是不能作为赋值的,需要用到 subprocess.check_output 函数,而且如果要引用赋值就 ...
- Nginx动态添加模块 平滑升级
已经安装好的Nginx动态添加模块 说明: 已经安装好的Nginx,需要添加一个未被编译安装的模块,需要怎么弄呢? 这里已安装第三方nginx-rtmp-module模块为例 nginx的模块是需要重 ...
- 关于组播数据包“发不出去",c#无法接收
问题一:发不出去 最近做一个小东西改进方案需要用到组播,简单来说就是我先作为服务器端组播发送设备编号,然后组播成员作为客户端接收消息后先确认对方是不是在呼叫我.是的话就返回一个消息,这样我服务器端就可 ...