当前位置:网站首页>Caused by: scala.MatchError: None (of class scala.None$)
Caused by: scala.MatchError: None (of class scala.None$)
2022-07-26 11:00:00 【胖胖学编程】
代码中使用 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 { //这块出的问题
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)
}
}
}原因是json串非法
1.json串与串之间不应该有逗号

2.下面的连个框中,第一个的id格式不对

边栏推荐
- Basic use of logging
- Smart contract DAPP system development process technology
- 232. Implement queue with stack
- 菜鸟看源码之ArrayDeque
- Introduction to authoringrealm
- MySql基础知识汇总
- During the interview, how did the interviewer evaluate the level of rust engineers?
- Novice source code hashtable
- Capture ZABBIX performance monitoring chart with selenium
- 36.【const函数放在函数前后的区别】
猜你喜欢
随机推荐
Synchronized与ReentrantLock
产品无力销量下滑 上汽名爵还能否走出阴霾
-bash: ./build.sh: /bin/bash^M: 坏的解释器: 没有那个文件或目录
Simple use of MFC multithreading
实时流式协议--RTSP
pytest conftest.py和fixture的配合使用
pytest pytest. Ini configuration case grouping case skipping
Att request of ble
Traversal recursion + iteration of binary tree
Admit it, investing in new energy is for security
像素和内存的关系
pytest pytest.ini配置 用例分组 用例跳过
349. Intersection of two arrays
配置文件以rc结尾什么意思
During the interview, how did the interviewer evaluate the level of rust engineers?
Esxi6.5 patch update
MySQL死锁分析
Pytest execution rules_ Basic usage_ Common plug-ins_ Common assertions_ Common parameters
BLE之ATT请求
ThreadPoolExecutor是怎样执行任务的









