I'm trying to read in a set of data from a Hive table which contains a complex data type (array) - effectively a JSON type structure.
I'm using SAS 9.4m3 and I can definitely retrieve the data using a simple libname statement but it arrives as a string with all the curly brackets and separators. I have an a Hive query that retrieves the data directly through Hive, but I'm having trouble making that query work through an explicit sql passthrough in SAS. it's very annoying.
the Hive query looks like this:
select a.var1, b.col.var1, c.col, d.col
from
taba a
lateral view explode(tabb) b
lateral view explode(b.value.var_x) c
lateral view explode(b.value.var_y) d
lateral view explode(b.value.var_z) e
where a.var1 = 'xyz123' limit 10;
when I wrap this in a proc sql wrapper for an hadoop connection (explicit passthrough) I get return code 2 from map reduce. The proc sql wrapper works for simple queries.
any thoughts comments or questions?
Hi, I'm having the same chanllenges... Would you please help if you figure it out already? Thanks 🙂
JSON parsing?
Is proc groovy cool? If so, see Hello Groovy in SAS 9.3.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.