BookmarkSubscribeRSS Feed
ARC2
Fluorite | Level 6

Say I have a SAS dataset (or a hive table) with an id variable plus variables x1-x5 and I want to read this data into a hive table with the x1-x5 in a hive array. What goes in the select statement to get those variables into an array? Or is select not the right way?

 

Thanks.

 

1 REPLY 1
Patrick
Opal | Level 21

That's not a SAS but a Hive SQL question.

After a quick Google seems there is an array() function for this.

 

From: https://dwgeek.com/hive-array-functions-usage-and-examples.html/

 
 
 

Following is the syntax of array function.

array(value1, value2, value2,...)

where, value is of type string or integer.

 
 

CFC_SAS_Communities_400x225.jpgCFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1439 views
  • 0 likes
  • 2 in conversation