Support Questions
Find answers, ask questions, and share your expertise

java.lang.ClassCastException: org.openx.data.jsonserde.json.JSONObject cannot be cast to java.lang.Long

Solved Go to solution
Highlighted

java.lang.ClassCastException: org.openx.data.jsonserde.json.JSONObject cannot be cast to java.lang.Long

New Contributor

**Hello, I am trying to load json data into hive table. I have created a hive table and loaded data into hive table.When i tried to retrieve that data i am getting the following exception.(select 8 from fs_json;)Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: org.openx.data.jsonserde.json.JSONObject cannot be cast to java.lang.Long


I have checked with many posts in internet but haven't got my answer.Please help me.Thank you in advance.**

I am posting  my hive table.........
ADD JAR /rahul/json-serde-1.3.6-SNAPSHOT-jar-with-dependencies.jar;
create table fs_json(text string,
id bigint,
source string,
entities struct<symbols:array<string>,
user_mentions:array<struct<screen_name:string,
name:string>>,
urls:array<string>>,
retweet_count bigint,
`user` struct<
id:bigint,
profile_background_image_url_http:string,
profile_text_color:string,
profile_image_url_https:string,
entities:struct<url:struct<
urls:array<struct<expanded_url:string,
display_url:string>>>>>
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
STORED AS TEXTFILE;I am posting you my json data............
My JSOn data:
[{ "contributors": null, "truncated": false, "text": "@AlDominick We hope you had a wonderful day, Al! Thanks for sharing.", "is_quote_status": false, "in_reply_to_status_id": 734844228761591809, "id": 734935544967385090, "favorite_count": 0, "source": "

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: java.lang.ClassCastException: org.openx.data.jsonserde.json.JSONObject cannot be cast to java.lang.Long

Super Guru

@Practise Hadoop can you try with 1.3.7 serde?

View solution in original post

4 REPLIES 4
Highlighted

Re: java.lang.ClassCastException: org.openx.data.jsonserde.json.JSONObject cannot be cast to java.lang.Long

Super Guru

@Practise Hadoop can you try with 1.3.7 serde?

View solution in original post

Highlighted

Re: java.lang.ClassCastException: org.openx.data.jsonserde.json.JSONObject cannot be cast to java.lang.Long

New Contributor

@Sunile Manjee Thank you so much its working

,

@Sunile Manjee

Thanks for the info.....its working

Re: java.lang.ClassCastException: org.openx.data.jsonserde.json.JSONObject cannot be cast to java.lang.Long

New Contributor

can you please share 1.3.7 serde

Highlighted

Re: java.lang.ClassCastException: org.openx.data.jsonserde.json.JSONObject cannot be cast to java.lang.Long

New Contributor

@teja i can share you.

just write your email id below