Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14601

Altering table/partition file format with preexisting data should not be allowed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Bug
    • None
    • None
    • Metastore
    • None

    Description

      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:

      create table test (id int);
      insert into test values (1);
      alter table test set fileformat parquet;
      insert into test values (2);
      select * from test;
      

      Will result in:

      java.lang.RuntimeException: .../000000_0 is not a Parquet file (too small) (state=,code=0)
      

      Attachments

        Activity

          People

            zsombor.klara Barna Zsombor Klara
            zsombor.klara Barna Zsombor Klara
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: