spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mungeol Heo <>
Subject JSON lib works differently in spark-shell and IDE like intellij
Date Wed, 05 Apr 2017 09:52:36 GMT

I am using "minidev" which is a JSON lib to remove duplicated keys in
JSON object.



Test Code

import net.minidev.json.parser.JSONParser
val badJson = "{\"keyA\":\"valueA\",\"keyB\":\"valueB\",\"keyA\":\"valueA\"}"
val json = new JSONParser(JSONParser.MODE_PERMISSIVE).parse(badJson.toLowerCase())


The source code placed above works at IDE like intellij.
But, it gives error at spark-shell


net.minidev.json.parser.ParseException: Unexpected duplicate key:keya
at position 33.


BTW, both IDE and spark-shell using same version of scala which is 2.11.8.
And, of course, same version of "minidev"

Any help will be great.
Thank you.

To unsubscribe e-mail:

View raw message