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

Revert "Remove usages of Hadoop Path for Hive LocationService" #17947

Closed
wants to merge 1 commit into from

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Jun 19, 2023

Description

Revert 8bd9f75.
Relates to #17804 (comment)

Release notes

(x) This is not user-visible or docs only and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Jun 19, 2023
@github-actions github-actions bot added hive Hive connector tests:hive labels Jun 19, 2023
@martint
Copy link
Member

martint commented Jun 19, 2023

Why revert? What would it take to fix the issue, instead?

cc @electrum

@findepi
Copy link
Member

findepi commented Jun 19, 2023

Hadoop Path doesn't support paths with double slashes.
Before 8bd9f75 Trino did not create Hive tables with such paths, sot he problem wasn't as exposed to users.

Since that commit we no longer normalize table location during CREATE TABLE, so Trino can easily create Hive tables with double slashes in the location, but these are not supported yet: #17804 (comment).

We should restore normalization to fix the problem and unblock the release.
Then we should probably reintroduce 8bd9f75 behind a config toggle, so that we can revisit all Hive connector places and fix (and test cover) all the changes related to de-hadoop-path-ing (#15921). Once all places are fixed, we should have disable table location normalization during CREATE TABLE by default.

@ebyhr ebyhr force-pushed the ebi/hive-double-slash branch from ea5c8b4 to 2934f4d Compare June 19, 2023 09:41
{
try {
return Location.of(location);
Location.of(location); // Calling just for validation
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testTableLocationTopOfTheBucket doesn't pass without this line.

@ebyhr ebyhr force-pushed the ebi/hive-double-slash branch from 2934f4d to 784b2c3 Compare June 19, 2023 12:38
@@ -452,8 +452,9 @@ public static Location getTableDefaultLocation(Database database, HdfsContext co
throw new TrinoException(HIVE_DATABASE_LOCATION_ERROR, format("Database '%s' location is not a directory: %s", schemaName, databasePath));
}
}
Location.of(databasePath.toString()); // Calling just for validation
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testCreateSchemaWithIncorrectLocation doesn't pass without this line.

@findepi
Copy link
Member

findepi commented Jun 19, 2023

#17958 may yield similar benfits (restore normalization), with fewer lines changed.

@ebyhr ebyhr closed this Jun 21, 2023
@ebyhr ebyhr deleted the ebi/hive-double-slash branch June 21, 2023 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector
Development

Successfully merging this pull request may close these issues.

3 participants