Skip to content

SHOW SCHEMAS IN <catalog> fails for catalog names containing hyphens - missing backtick quoting #1141

@jcap

Description

@jcap

Summary

Catalog names containing hyphens (e.g., a-b-c-d) cause INVALID_IDENTIFIER errors because the driver doesn't quote them with backticks.

Versions

  • Working: 2.7.5 (Simba)
  • Broken: 3.0.3+ (OSS)

Error

[INVALID_IDENTIFIER] The unquoted identifier a-b-c-d is invalid and must be back quoted as: `a-b-c-d`.

Root Cause

In PR #953, CommandBuilder.java uses:

SHOW_SCHEMAS_IN_CATALOG_SQL = "SHOW SCHEMAS IN %s"

This should be:

SHOW_SCHEMAS_IN_CATALOG_SQL = "SHOW SCHEMAS IN `%s`"

Reproduction

  1. Create a catalog with a hyphen in the name
  2. Connect via JDBC driver 3.0.3+
  3. Browse schemas in a JDBC client (e.g., DBeaver)

Expected

Catalog names should be backtick-quoted per Databricks identifier rules:
https://docs.databricks.com/en/sql/language-manual/sql-ref-identifiers.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions