Skip to content

Conversation

@schiller-oliver
Copy link

@schiller-oliver schiller-oliver commented May 16, 2023

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.encodeTableName is 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.

@schiller-oliver schiller-oliver changed the title Encode database name when generating database path HIVE-27348: Encode database name when generating database path May 16, 2023
Copy link

@aturoczy aturoczy left a comment

Choose a reason for hiding this comment

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

Just for consideration.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 19 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@schiller-oliver
Copy link
Author

schiller-oliver commented Jun 12, 2023

@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 :)).

@github-actions
Copy link

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.
Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.

@github-actions github-actions bot added the stale label Aug 12, 2023
@github-actions github-actions bot closed this Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants