Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I process multiline JSON data in HIVE ?? #201

Open
debuggerrr opened this issue Nov 12, 2017 · 5 comments
Open

Can I process multiline JSON data in HIVE ?? #201

debuggerrr opened this issue Nov 12, 2017 · 5 comments

Comments

@debuggerrr
Copy link

debuggerrr commented Nov 12, 2017

I am able to create table and process data for single line JSON data but my question is can I process JSON data like below:

[{
	"field1": "data1",
	"field2": 100,
	"field3": "more data1",
	"field4": 123.001
}, {
	"field1": "data2",
	"field2": 200,
	"field3": "more data2",
	"field4": 123.002
}, {
	"field1": "data3",
	"field2": 300,
	"field3": "more data3",
	"field4": 123.003
}, {
	"field1": "data4",
	"field2": 400,
	"field3": "more data4",
	"field4": 123.004
}]

I have read that multiline JSON data wasn't supported in HIVE but can I use it now?? If yes, then please share the links where I can find this because I searched alot for this but I couldn't find any relevant material for this. Thanks in advance .

@debuggerrr debuggerrr changed the title Not able to create table for JSON data using hive serde Can I process multiline JSON data in HIVE ?? Nov 12, 2017
@rcongiu
Copy link
Owner

rcongiu commented Nov 13, 2017 via email

@debuggerrr
Copy link
Author

I am able to create table and process data for single line JSON data but my question is can I process JSON data like below:

[{
"field1": "data1",
"field2": 100,
"field3": "more data1",
"field4": 123.001
}, {
"field1": "data2",
"field2": 200,
"field3": "more data2",
"field4": 123.002
}, {
"field1": "data3",
"field2": 300,
"field3": "more data3",
"field4": 123.003
}, {
"field1": "data4",
"field2": 400,
"field3": "more data4",
"field4": 123.004
}]
I have read that multiline JSON data wasn't supported in HIVE but can I use it now?? If yes, then please share the links where I can find this because I searched alot for this but I couldn't find any relevant material for this. Thanks in advance .

@debuggerrr
Copy link
Author

Can i have an answer for this ? @rcongiu

@vincenzocapel
Copy link

Has someone an answer to this question?
I have the same issue.
thanks

@fayedd
Copy link

fayedd commented Oct 23, 2018

Since a nomal json should start wih '{' and end with '}', maybe you can remove the '[' and ']' and then set row format delimited fields terminated by ','

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants