当前位置:网站首页>Caused by: scala. MatchError: None (of class scala.None$)
Caused by: scala. MatchError: None (of class scala.None$)
2022-07-26 11:22:00 【Pangpang learns programming】
The code uses import scala.util.parsing.json.JSON
val inpath="hdfs://node01:8020/tmp/InternationalData_source/InternationalData.IBRD_Value.json"
val lines: RDD[Option[Any]] = jsonStr.map(one_line => JSON.parseFull(one_line))
val pre_rdd = lines.map {
r =>
r match { // This problem
case Some(maps: Map[String, Any]) => {
val my_map: HashMap[String, String] = new HashMap[String, String]()
maps.foreach(t => {
my_map += (t._1 -> t._2.toString.replace("\n", ""))
})
my_map("_id") = my_map("_id").substring(12, 36)
(scala.util.Random.nextInt(200).toString + "_" + "IBRD_" + my_map("SourceCode"), my_map)
}
}
}as a result of json Illegal string
1.json There should be no commas between strings

2. In the next box , The first of id Wrong format

边栏推荐
- pytest conftest.py和fixture的配合使用
- win10 1903 笔记本开热点出现蓝屏问题
- Basic concepts of JVM and memory management model
- List and dictionary instance applications (※)
- 脉冲波形的产生与变换
- [开发工具] IEDA报红
- easyui02
- Leetcode-209. subarray with the smallest length (binary, prefix and, sliding window)
- Admit it, investing in new energy is for security
- [vscode]如何远程连接服务器
猜你喜欢
随机推荐
新来个技术总监要我做一个 IP 属地功能~
Logging advanced use
静态路由和动态路由
HCI interface
Admit it, investing in new energy is for security
Solve the problem of the popularity of org.apache.commons.codec.binary.base64
Bash shell learning notes (III)
349. Intersection of two arrays
The company cannot access station B
36. [difference between const function and function]
Pytest case execution sequence
pytest conftest.py和fixture的配合使用
承认吧 投新能源就是为了安全感
[学习进度]5月
Pytest fixture decorator
QT——LCDNumber
Le audio specification overview
数据可视化-《白蛇2:青蛇劫起》(2)
Logging learning final edition - configured different levels of log printing colors
Pytest execution rules_ Basic usage_ Common plug-ins_ Common assertions_ Common parameters








![[vscode]如何远程连接服务器](/img/b4/9a80ad995bd589596d8b064215b55a.png)
