Skip to content

Database Prefixes are Case-SensitiveΒ #333

@baumandm

Description

@baumandm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions