Skip to content

Support Cockroach DB as Metastore #2464

@sathesuraj

Description

@sathesuraj

Is your feature request related to a problem? Please describe.

Currently, Polaris does not support CockroachDB. It only supports PostgreSQL, even though CockroachDB is highly compatible with PostgreSQL.

Describe the solution you'd like

CockroachDB uses INT8 (64-bit signed integer) as the default storage type for INT, INTEGER, and BIGINT data types. It does not support a 32-bit integer type (INT4) as a separate storage type. This design simplifies type handling and avoids integer overflow issues.

In Polaris, a JDBC connection is used to create metastore tables by executing SQL files. These files define types as INT and BIGINT. During the bootstrap process, when Polaris attempts to read INT columns from CockroachDB as the Integer Java datatype, it fails because CockroachDB stores these as INT8, which should be read as Long in Java.

One option would be to update sql scripts to use INT4 and INT8 instead of INT, it should work with both PostgreSQL and Cockroach DB.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions