DATA Step, Macro, Functions and more

Reading and Parsing Hive Array complex data types in to a sas data table

Reply
Contributor
Posts: 29

Reading and Parsing Hive Array complex data types in to a sas data table

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?

Regular Learner
Posts: 1

Re: Reading and Parsing Hive Array complex data types in to a sas data table

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

Valued Guide
Posts: 797

Re: Reading and Parsing Hive Array complex data types in to a sas data table

JSON parsing?

 

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

Ask a Question
Discussion stats
  • 2 replies
  • 464 views
  • 0 likes
  • 3 in conversation