TimothyDing opened a new issue, #9913:
URL: https://github.com/apache/gravitino/issues/9913

   ### Describe the subtask
   
   ## **Implementation Status**
   
   The Hologres JDBC Catalog has been implemented and is located under 
`catalogs-contrib/catalog-jdbc-hologres`. The implementation includes the 
following completed features:
   
   ### **Completed: Core Catalog Infrastructure**
   
   * **HologresCatalog** (`HologresCatalog.java`): Main catalog class extending 
`JdbcCatalog`, with `shortName()` returning `"jdbc-hologres"`. Creates all 
necessary converters and operations.
   * **HologresCatalogOperations** (`HologresCatalogOperations.java`): Extends 
`JdbcCatalogOperations`, handles PostgreSQL driver deregistration on close to 
avoid memory leaks.
   * **HologresCatalogCapability** (`HologresCatalogCapability.java`): Defines 
naming rules following PostgreSQL conventions (regex: 
`^[_a-zA-Z\p{L}/][\w\p{L}-$/=]{0,62}$`) and reserves system schema names 
(`pg_catalog`, `information_schema`, `hologres`).
   
   ### **Completed: Schema (Database) Operations**
   
   * **HologresSchemaOperations** (`HologresSchemaOperations.java`): Extends 
`JdbcDatabaseOperations`, implements schema CRUD operations.
     - Maps Hologres Database to JDBC Catalog, Hologres Schema to JDBC Schema.
     - Filters out system schemas: `pg_toast`, `pg_catalog`, 
`information_schema`, `hologres`, `hg_internal`, `hg_recyclebin`, 
`hologres_object_table`, `hologres_sample`, `hologres_streaming_mv`, 
`hologres_statistic`.
     - Supports schema comments via `COMMENT ON SCHEMA` syntax.
   
   ### **Completed: Table Operations**
   
   * **HologresTableOperations** (`HologresTableOperations.java`): Extends 
`JdbcTableOperations`, implements full table lifecycle management.
     - **Table Type Support**: Supports listing and loading of `TABLE`, 
`PARTITIONED TABLE`, `VIEW`, and `FOREIGN TABLE` types.
     - **Table CRUD**: CREATE TABLE with column definitions, PRIMARY KEY and 
UNIQUE KEY indexes, column comments, and table comments.
     - **ALTER TABLE**: Supports rename table, add/drop/rename columns, update 
column type, update column nullability, update column default value, update 
column comment, update table comment, add/drop indexes, and update column 
auto-increment.
     - **Table Properties (Read-only)**: Reads table properties from 
`hologres.hg_table_properties` system table, including: `orientation`, 
`distribution_key`, `clustering_key`, `segment_key`, `bitmap_columns`, 
`dictionary_encoding_columns`, `primary_key`, `time_to_live_in_seconds`, 
`table_group`, `storage_format`, `binlog_level`.
     - **Partition Detection**: Queries `pg_catalog.pg_partitioned_table` and 
`pg_catalog.pg_attribute` system tables to detect LIST partitioned tables and 
returns `Transforms.list()` with partition column names.
     - **Auto-increment**: Supports `GENERATED BY DEFAULT AS IDENTITY` for 
auto-increment columns.
   
   ### **Completed: Type Conversion**
   
   * **HologresTypeConverter** (`HologresTypeConverter.java`): Bidirectional 
type mapping between Hologres and Gravitino types.
   * **HologresColumnDefaultValueConverter** 
(`HologresColumnDefaultValueConverter.java`): Handles PostgreSQL-style default 
value casting (e.g., `'value'::type`).
   * **HologresExceptionConverter** (`HologresExceptionConverter.java`): Maps 
PostgreSQL SQLSTATE error codes to Gravitino exceptions.
   
   ### **Completed: Configuration and Build**
   
   * **Build**: `build.gradle.kts` with dependencies on `catalog-jdbc-common`, 
PostgreSQL driver for testing, and testcontainers support.
   * **Config**: `jdbc-hologres.conf` with JDBC connection configuration 
template.
   * **Service Registration**: 
`META-INF/services/org.apache.gravitino.CatalogProvider` for catalog 
auto-discovery.
   
   ### **Completed: Unit Tests**
   
   * **TestHologresTypeConverter**: Covers all supported type conversions 
including boolean, integer types, float types, date/time types, decimal, 
varchar, char, text, binary, array types, and external types.
   
   ### Parent issue
   
   https://github.com/apache/gravitino/issues/9886


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to