BookmarkSubscribeRSS Feed
to_the_point
Calcite | Level 5

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?

2 REPLIES 2
liucheng8611
Calcite | Level 5

 Hi, I'm having the same chanllenges... Would you please help if you figure it out already? Thanks 🙂

mkeintz
PROC Star

JSON parsing?

 

Is proc groovy cool?  If so, see Hello Groovy in SAS 9.3.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2241 views
  • 0 likes
  • 3 in conversation