Database Prefixes are Case-Sensitive

Open
#333 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend, databases

Research direction

Reproduce the issue with Waggle Dance configured with a prefixed_ HMS prefix, comparing get_database() and get_table() calls against the listed mixed-case scenarios. Trace how the prefix is matched and verify that database names are handled case-insensitively while preserving the expected NoSuchObjectException behavior.

Written by the indexing model from the issue text.

Description

Describe the bug
The get_database() and get_table() methods are case-sensitive when using a HMS with a prefix.

Hive Metastore Directly, no prefix

When connecting directly to the Hive Metastore via Thrift, everything works as expected. Running get_database() for each of these scenarios:

my_database: Success 👍
MY_DATABASE: Success 👍
my_database_does_not_exist: NoSuchObjectException(message='my_database_does_not_exist') 👍
MY_DATABASE_DOES_NOT_EXIST: NoSuchObjectException(message='MY_DATABASE_DOES_NOT_EXIST') 👍

Waggle Dance with a Prefix

However, when connecting to Waggle Dance and adding a prefix, it becomes case-sensitive:

  • prefixed_my_database: Success 👍
  • PREFIXED_MY_DATABASE: NoSuchObjectException(message='prefixed_my_database')" ❌
  • prefixed_my_database_does_not_exist: NoSuchObjectException(message='my_database_does_not_exist')" 👍
  • PREFIXED_MY_DATABASE_DOES_NOT_EXIST: NoSuchObjectException(message='prefixed_my_database_does_not_exist')" 👍

Note, the NoSuchObjectException message differs in the last two scenarios; one contains the prefix and the other does not. This suggests that the lowercase version matched the prefix config, but then discovered that the database doesn't exist. Whereas the ALL CAPS version didn't match the prefix config, and attempted the entire database name, which also doesn't exist.

The same behavior occurs with get_table(), but only the database name is case-sensitive

To Reproduce
Waggle Dance configured with a prefixed_ prefix for the HMS.

Expected behavior
Database names should be case-insensitive.

Dominant language
Java
Stars
289
Forks
79
Avg merge
1d 18h
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ExpediaGroup/waggle-dance

All issues in ExpediaGroup/waggle-dance

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.