Tim Havens 2012-06-19, 15:03
-Re: Please HELP: HIVE alter table add new partition to schema...
You can not change the partition columns. I would use a dynamic
partition insert to select all the data from the original table into
the new table.
On 6/19/12, Tim Havens <[EMAIL PROTECTED]> wrote:
> So...I have a table that has thousands of files, and Billions of rows
> related it.
> Lets make this a simple table:
> CREATE TABLE test_table (
> ts BIGINT,
> exec_time DOUBLE,
> domain_id BIGINT,
> domain_name STRING,
> PARTITIONED BY (logdate STRING, source STRING, datacenter STRING,
> hostname STRING)
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY '\t'
> COLLECTION ITEMS TERMINATED BY '\001'
> MAP KEYS TERMINATED BY '\002'
> LINES TERMINATED BY '\n'
> STORED AS TextFile;
> So...what I need to do is ADD a partition to the PARTITIONED BY spec
> The partitioned by column I want to add is 'loghour STRING'.
> I can't seem to find any way to accomplish actually adding a NEW
> PARTITION COLUMN in the 'PARTITIONED BY' spec, without completely
> recreating and reloading the table.
> What's the correct way of adding to the partition schema and new
> column like 'loghour STRING'.
> I'm not trying to add an entry into the table DATA, I'm trying to add
> a completely new PARTITIONED BY Column...
Mark Grover 2012-06-19, 15:45
Tim Havens 2012-06-19, 16:58