Reply
New Contributor
Posts: 3
Registered: ‎12-20-2018

Impala to query Hive table built from JSON

Trying to understand if this use case is possible. I have a json file that I want to build a hive table with. Here is an example of what I could use to do that - https://pkghosh.wordpress.com/2012/05/06/hive-plays-well-with-json/ .

 

However, once built, I would like to query using impala as below or am I restricted to using Hive queries for sushc tables? 

 

SELECT b.blogID, c.email FROM comments a LATERAL VIEW json_tuple(a.value, 'blogID', 'contact') b 
AS blogID, contact  LATERAL VIEW json_tuple(b.contact, 'email', 'website') c 
AS email, website WHERE b.blogID='64FY4D0B28'; 

 

Cloudera Employee
Posts: 761
Registered: ‎03-23-2015

Re: Impala to query Hive table built from JSON

LATERAL VIEW is not available in Impala yet, see below link:
https://www.cloudera.com/documentation/enterprise/latest/topics/impala_langref_unsupported.html#lang...

Currently only Hive supports it.