-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-27348: Encode database name when generating database path #4329
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
Conversation
aturoczy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for consideration.
...one-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java
Outdated
Show resolved
Hide resolved
|
Kudos, SonarCloud Quality Gate passed! |
|
@aturoczy Would you be able to give me some hint what's necessary to make some progress with this PR? I'm new to this community, thus I don't know whom to ping to get some official review (and approval :)). |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |








What changes were proposed in this pull request?
This PR encodes that database name when using it to generate the default database path. For this purpose, the method
MetaStoreUtils.encodeTableNameis used. This is analogous to how table names are encoded when used to generate the default path for a table.Why are the changes needed?
If the database name is not encoded, special characters which are allowed in schema names are used as is in the path. This causes problems in cases where these special characters are not allowed. One example being URI generation from the database path.
Does this PR introduce any user-facing change?
The default location for a database change in case the database name contains special characters. For example,
my{schema}resulted in "my{schema}.db", now it results in "my-123-schema-125-.db".How was this patch tested?
I've extended the name of the schema created in test special_character_in_tabnames_1.q such that it contains additional, problematic characters. Without the fix, the modified test case fails, with the fix, the modified test case runs clean.