Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with drop partition when it contains null and type is INT/DATE #40

Open
thomaskreutzer opened this issue Jul 18, 2023 · 1 comment

Comments

@thomaskreutzer
Copy link

-- In order to work around the issue change the column type to string
ALTER TABLE tablename PARTITION COLUMN (partn STRING);
-- Drop the offending partitions
ALTER TABLE tablename DROP PARTITION (partn='HIVE_DEFAULT_PARTITION');
-- Change the column type back to int
ALTER TABLE tablename PARTITION COLUMN (partn INT);

Possibly hive SRE can be enhanced to detect this and write the above statements when it would not be possible for the empty partitions to be dropped due to mismatch of data type.

@alexvdedov
Copy link

alexvdedov commented Jul 19, 2023

Not sure if thats related, but after ID'ing missing HDFS locations based on Hive partition metadata analysis, SRE generates a bunch of mkdir directives. Some of these commands, if applied, seem to be capable of exacerbating the problem. For example:

mkdir -p "hdfs://namotdev2/data/gfctocon/work/hive/marketquoteevent/quotedate=__HIVE_DEFAULT_PARTITION__/marketquotesource=BLOOMBERG/loaddate=__HIVE_DEFAULT_PARTITION__"
In the above table, partition columns loaddate and quotedate are defined as DATE. I've see similar issue with INTs as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants