apache / apache/gravitino

[Improvement] web-v2(UI): Add unsupported column types for OceanBase/StarRocks/Hudi and support optional precision for time/timestamp/timestamp_tz

Open
#12,208 0 comments 0 reactions 1 assignee Claimed by @LauraXia123 View on GitHub
improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

## Description

This issue tracks two related changes in the Gravitino UI (`unified-catalog-ui`):

### 1. Add `UnsupportColumnType` configurations for 3 missing catalog providers

The `UnsupportColumnType` map in `src/config/index.ts` controls which column types are filtered out in the `CreateTableDialog` per provider. Three providers were missing from this configuration:

#### `jdbc-oceanbase`
OceanBase doesn't support the following Gravitino types:
- `boolean`, `fixed`, `struct`, `list`, `map`, `interval_day`, `interval_year`, `union`, `uuid`

#### `jdbc-starrocks`
StarRocks doesn't support the following Gravitino types:
- `fixed`, `timestamp_tz`, `interval_day`, `interval_year`, `union`, `uuid`

#### `lakehouse-hudi`
Hudi has more limited type support than Hive. It doesn't support:
- `byte`, `char`, `fixed`, `interval_day`, `interval_year`, `short`, `time`, `timestamp_tz`, `union`, `uuid`, `varchar`

### 2. Support optional precision parameter for `time`, `timestamp`, `timestamp_tz`

Previously, the UI only supported parameterized types via `ColumnWithParamType = ["char", "varchar", "fixed"]` (with required length parameter L) and `decimal` (with required P and S). The `time`, `timestamp`, and `timestamp_tz` types also accept an optional precision parameter (P, range 0-12) per the Gravitino `Types.java` definition, but the UI had no input for it.

Changes:
- Added `ColumnWithPrecisionType = ["time", "timestamp", "timestamp_tz"]` constant
- Added precision input (`InputNumber` with `min=0, max=12, placeholder="P"`) in `ColumnTypeComponent.tsx`
- Precision is **optional** — if not provided, the type is submitted without parentheses (e.g., `timestamp`), and the backend uses its default precision per provider
- If provided, the type is submitted with precision (e.g., `timestamp(6)`)
- Edit/backfill flow correctly handles both `Timestamp(6)` and `Timestamp` forms

## Files Changed

- `src/config/index.ts` — Added `ColumnWithPrecisionType` constant and 3 `UnsupportColumnType` entries
- `src/components/dialogComponent/common/ColumnTypeComponent.tsx` — Added precision input handling for `time`/`timestamp`/`timestamp_tz`

## References

- Gravitino `Types.java`: `MAX_ALLOWED_PRECISION = 12`, `DATE_TIME_PRECISION_NOT_SET = -1`
- OceanBase type support: https://gravitino.apache.org/docs/0.8.0-incubating/catalog-relational-oceanbase/
- StarRocks type support: https://gravitino.apache.org/docs/0.8.0-incubating/catalog-relational-starrocks/
- Hudi type support: https://gravitino.apache.org/docs/0.8.0-incubating/catalog-lakehouse-hudi/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.