1
votes

I have Clustered Table in HIVE.

All queries works in hive-client.

But in presto I can't run any query with this table:

     Query ... failed: Hive table is corrupt. 
     It is declared as being bucketed, but the files do not match the 
     bucketing declaration. 
     The number of files in the directory (0) does not match the declared 
     bucket count (8) for partition: <UNPARTITIONED>

After set hive.enforce.bucketing = true;

Error:

Query ... failed: Hive table is corrupt. 
It is declared as being bucketed, but the files do not match the bucketing declaration. 
Found sub-directory in bucket directory for partition: <UNPARTITIONED>

Need help.

1

1 Answers

2
votes

set hive.enforce.bucketing = true makes sure the data you insert is put in the right bucket. It seems like a previously inserted data causes this corruption.
You should remove it and insert again, setting hive.enforce.bucketing to true beforehand.