hadoop - How to create a random partitioned data in Hive -
i have following data:
id int name string 1 2 b 3 c
i want create new table in hive partition countryid , load data table , put random value in countryid.
i'm using following commands not work:
hive> set hive.exec.dynamic.partition.mode=nonstrict hive> create table test (id int, name string) partitioned (countryid int); hive> load data inpath '/my_data.txt' table test partition (countryid = rand());
i following error:
failed: parseexception line 1:76 cannot recognize input near 'rand' '(' ')' in constant
what doing wrong?
i think want insert overwrite
insert overwrite table test partition(countryid) select id,name, rand() countryid my_data;
after create external table my_data.txt file.
Comments
Post a Comment