apache / apache/paimon

[Feature] Paimon Support Spark Field Metadata

Open
#5,015 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.

### Motivation

After Spark3.3+, which support field with meatdata, currently paimon schema don't support the field metadata, So we need to support this.
And, after Spark3.4, Spark SQL Support FIELD DEFAULT VALUE, which is add field default value into field metadata. So If we wanna support SPARK DEFAULT VALUE, we need support metadata first.

### Solution

1. When Create Spark Table, add the metadata configs into schema options field.
2. When Load Spark Table, add the metadata configs from options into StructType
3. Whe Alter Spark Table, should support AddColumn(contains defaultValue), UpdateColumnDefaultValue, DeleteColumn(delete metadata in options)

### Anything else?

_No response_

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the Spark table create, load, and alter paths described in the issue, including AddColumn, UpdateColumnDefaultValue, and DeleteColumn. Verify how schema options are written and read, then confirm that field metadata and default-value metadata survive creation, loading, and each alteration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spark
Domain
data-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.