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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.