Skip to content

[Improvement] Support creating Doris tables with range/list partitions via Gravitino UI #12094

Description

@LauraXia123

Description

Currently, the Gravitino Web UI does not fully support creating Doris tables with range or list partitions. Several improvements are needed to make this workflow functional end-to-end.

Current issues

1. Range partition field reset bug

When filling in Range Partition fields (Name, Upper Bound, Lower Bound), entering a value in one field resets the other fields. This is caused by Ant Design Form.useWatch triggering cascading re-renders that overwrite sibling field values when used inside nested Form.List.

2. Range partition missing type field in JSON

The backend requires each assignment object to include type: "range" and properties: null, but the frontend was only sending { name, upper, lower }, causing a Malformed json request error (code 1001).

3. List partition UI not implemented

The UI had no support for list partition interaction, submission, or display. Users could select the "list" strategy but could not define partition assignments (name + values).

4. List partition lists semantics mismatch

The backend expects LiteralDTO[][] where each inner array represents one IN tuple whose length must equal the number of partition columns. The initial frontend implementation incorrectly treated comma-separated values as a single tuple instead of splitting them for single-column partitions, causing The number of partitioning columns must be consistent error (code 1001).

5. Doris list partition column must be NOT NULL

Doris requires list partition columns to be NOT NULL, but the UI does not enforce or auto-set this constraint, causing The list partition column must be NOT NULL error (code 1002).

6. Doris OLAP table first column type restriction

Doris OLAP tables do not allow float, double, string, or array as the first column. The UI does not warn users about this, causing The olap table first column could not be float, double, string or array error (code 1002).

Proposed improvements

  1. Fix range partition field reset: Use form.getFieldValue() for synchronous reads instead of Form.useWatch for columns/fieldName, and manage assignment state via form.setFieldValue directly instead of nested Form.List. Use CSS hidden instead of conditional rendering to prevent Form.List unmount/remount.

  2. Add type and properties fields: Include type: "range" / type: "list" and properties: null in assignment objects submitted to the backend.

  3. Implement list partition UI: Add ListAssignments component with support for multiple value groups (each group = one IN tuple), matching the backend LiteralDTO[][] semantics.

  4. Correct lists construction: For single-column partitions, split comma-separated values into individual tuples ([[v1], [v2], [v3]]). For multi-column partitions, keep all values in one tuple ([[v1, v2]]).

  5. Auto-set NOT NULL for list partition columns: When strategy is "list" and provider is "jdbc-doris", automatically set the partition column to required: true.

  6. Add validation hints for Doris-specific restrictions: Warn users when the first column type is float/double/string for Doris tables.

Affected files

  • web-v2/web/src/components/PartitionPanel.js - Partition UI components
  • web-v2/web/src/app/catalogs/rightContent/CreateTableDialog.js - Table creation dialog
  • web-v2/web/src/config/index.js - Partition configuration

Related

Metadata

Metadata

Assignees

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