How can I create a partitioned table 'like' an unpartitioned table with Hive HQL? -


i've got table 2 weeks worth of entries, , copy entries table partitioned date (creating if not exist).

i'm writing luigi task this, , love independent of table schema--i.e. wouldn't have specify column names , types, , create table if not exists when necessary.

i hoping use:

create table if not exists test_part comment 'this test table see if partitioning works in case' partitioned (event_date string) select *, '2014-12-15' source_db.source_table  event_at <'2014-12-16' , event_at >='2014-12-15'; 

but of course fails with: failed: semanticexception [error 10068]: create-table-as-select not support partitioning in target table

i tried again "like" same results. there way missing? doesn't have atomic. multiple sequential commands fine.

you not create table as.

you create table first using describe source_table , make insert table partition (event_date string)

2 steps works better.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -