Skip to content

Restrict drop column operations for hive tables #20807

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

Open
Praveen2112 opened this issue Feb 22, 2024 · 3 comments · May be fixed by #25656
Open

Restrict drop column operations for hive tables #20807

Praveen2112 opened this issue Feb 22, 2024 · 3 comments · May be fixed by #25656
Labels
bug Something isn't working good first issue Good for newcomers hive Hive connector

Comments

@Praveen2112
Copy link
Member

As per the Hive docs - https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AlterTable/Partition/Column

REPLACE COLUMNS removes all existing columns and adds the new set of columns. This can be done only for tables with a native SerDe (DynamicSerDe, MetadataTypedColumnsetSerDe, LazySimpleSerDe and ColumnarSerDe). Refer to Hive SerDe for more information. REPLACE COLUMNS can also be used to drop columns. For example, "ALTER TABLE test_change REPLACE COLUMNS (a int, b int);" will remove column 'c' from test_change's schema.

But we try to run replace columns operation for all the file formats which provides inconsistent behavior both from Trino's hive connector and querying hive directly.

@Praveen2112 Praveen2112 added good first issue Good for newcomers hive Hive connector bug Something isn't working labels Feb 23, 2024
@pojith
Copy link

pojith commented Feb 25, 2024

.take

@jksimoniii
Copy link

@Praveen2112 @pojith How should we handle REPLACE COLUMNS for non-native SerDe? Should an exception be thrown?

@Praveen2112
Copy link
Member Author

I think we should mimic Hive's behaviour with respect to various supported formats supported by the Trino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers hive Hive connector
3 participants