我尝试在Spark HQL中加载以下JSON文件,但无法成功加载。给出_corrupt_record错误。
有人能解释一下这个错误吗?我可以读取和使用该文件与其他应用程序,如Notepad++(JSTool插件),我相信它是适当的,没有损坏。
{"markers": [
{
"point":new GLatLng(40.266044,-74.718479),
"homeTeam":"Lawrence Library",
"awayTeam":"LUGip",
"markerImage":"images/red.png",
"information": "Linux users group meets second Wednesday of each month.",
"fixture":"Wednesday 7pm",
"capacity":"",
"previousScore":""
},
{
"point":new GLatLng(40.211600,-74.695702),
"homeTeam":"Hamilton Library",
"awayTeam":"LUGip HW SIG",
"markerImage":"images/white.png",
"information": "Linux users can meet the first Tuesday of the month to work out harward and configuration issues.",
"fixture":"Tuesday 7pm",
"capacity":"",
"tv":""
},
{
"point":new GLatLng(40.294535,-74.682012),
"homeTeam":"Applebees",
"awayTeam":"After LUPip Mtg Spot",
"markerImage":"images/newcastle.png",
"information": "Some of us go there after the main LUGip meeting, drink brews, and talk.",
"fixture":"Wednesday whenever",
"capacity":"2 to 4 pints",
"tv":""
},
] }
发布于 2016-12-16 18:09:04
您的JSON应该在每个对象一行中
{ object1 }
{ object2 }默认read.json仅支持此结构。如果您想读取多行JSON,则可以通过sparkContext.wholeTextFiles和手动解析
在文档中是text
请注意,作为json文件提供的文件不是典型的
文件。每行必须包含一个独立的、自包含的有效JSON对象。因此,常规的多行JSON文件通常会失败。
https://stackoverflow.com/questions/41181817
复制相似问题