[
https://issues.apache.org/jira/browse/HIVE-14601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Barna Zsombor Klara resolved HIVE-14601.
----------------------------------------
Resolution: Not A Bug
Altering a table file format with records inside is indeed useful if the user
forgets to specify the correct format and uploads the data file directly to the
table location. In this case the user should be able to alter the file format
to the correct value to fix the table setup.
> Altering table/partition file format with preexisting data should not be
> allowed
> --------------------------------------------------------------------------------
>
> Key: HIVE-14601
> URL: https://issues.apache.org/jira/browse/HIVE-14601
> Project: Hive
> Issue Type: Bug
> Components: Metastore
> Reporter: Barna Zsombor Klara
> Assignee: Barna Zsombor Klara
> Priority: Minor
>
> The file format of a table or a partition can be changed using an alter
> statement. However this only affects the metadata, the data in hdfs is not
> changed, leading to a table from which you cannot select anymore.
> Changing the file format back fixes the issue, but a better approach would be
> to prevent the alter to the file format if we have data in the tables.
> The issue is reproducible by executing the following commands:
> {code}
> create table test (id int);
> insert into test values (1);
> alter table test set fileformat parquet;
> insert into test values (2);
> select * from test;
> {code}
> Will result in:
> {code}
> java.lang.RuntimeException: .../000000_0 is not a Parquet file (too small)
> (state=,code=0)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)