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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -