There are two ways to load json file formats into hive.
1.
create table json_guru(str string);
load data inpath 'home/hduser/test.json' into table json_guru;
select * from json1;
select get_json_object(str,'$.ecode') as ecode, get_json_object(str,'$.ename') as ename ,get_json_object(str,'$.sal') as salary from json_guru;
where the json data somewhat looks like this.
2.
The second way is to use hive json serde jar to do the same . Please have a look below for your reference.
CREATE TABLE my_table (field1 string, field2 int,
field3 string, field4 double)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde' ;
Add the Jar :- ADD JAR /path-to/hive-json-serde.jar;
load the file :- load data inpath 'folder/to/json/data.json' into my_table;