How do I create a hive table without any intermediate files?

前端 未结 2 1861
囚心锁ツ
囚心锁ツ 2021-01-15 23:06

I want to create and populate a hive table without loading anything from disk.

Specifically, I have

set idlist = (1,2,3);
set values = (2,3,5);
         


        
2条回答
  •  天涯浪人
    2021-01-15 23:50

    create table my_table(id int, value int);
    
    insert overwrite table my_table
    select a.id as id, b.value as value from (
      select count(*) from my_table
    ) t
    lateral view explode(array(1,2,3)) a as id
    lateral view explode(array(2,3,5)) b as value;
    

提交回复
热议问题