libname sasdata 'SAS-library';
libname hdp hadoop user=myusr1 pwd=mypwd1 server='hdpcluster' schema=statsdiv;
proc append base=[hdp.Hadoop_Hive_table_name] data=[sasdata.sasdataset_name];
run;
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
Try these commands directly on Hive :
use <DATABASENAME>; show create table <TABLENAME> ;
Post the Output , which would be similar as below.
/**********SAMPLE OUTPUT********************/ 1 CREATE TABLE `class`( 2 `name` string COMMENT 'from deserializer', 3 `sex` string COMMENT 'from deserializer', 4 `age` string COMMENT 'from deserializer', 5 `height` string COMMENT 'from deserializer', 6 `weight` string COMMENT 'from deserializer') 7 ROW FORMAT SERDE 8 'org.apache.hadoop.hive.serde2.OpenCSVSerde' 9 WITH SERDEPROPERTIES ( 10 'separatorChar'=',') 11 STORED AS INPUTFORMAT 12 'org.apache.hadoop.mapred.TextInputFormat' 13 OUTPUTFORMAT 14 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 15 LOCATION 16 'hdfs://<path>' 17 TBLPROPERTIES ( 18 'COLUMN_STATS_ACCURATE'='true', 19 'SAS OS Name'='Linux', 20 'SAS Version'='9.04.01M4P11092016', 21 'numFiles'='1', 22 'numRows'='19', 23 'rawDataSize'='0', 24 'totalSize'='644', 25 'transient_lastDdlTime'='1560450111') /*********************************************************/
based on how it is configured the output might differ from above
hi,
sas data type numeric will be changed to double in hive.
sas data type char will be changed to varchar in hive.
i created the table in hive with partition year_month=201801 , using the data set in sas.
now i am trying to append data to existing hive table with pratition year_month=201802.
using proc sql insert syntax. getting errors as below like this 20 same errors i am getting , when i check fields in sas and hive shown below , pls help.
129 R50_DUNGR NUM 3 --- in sas
`r50_dungr` double, --- in hive
182 R50_SIGN_ID Char 1 --- in sas
`r50_sign_id` varchar(1), --- hive
183 R50_CTOPEN Num 5 --- sas
`r50_ctopen` double, --- in hive
ERROR: Value 182 on the SELECT clause does not match the data type of the corresponding column listed after the INSERT table name.
ERROR: Value 183 on the SELECT clause does not match the data type of the corresponding column listed after the INSERT table name.
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: