Skip to content

[spark] Support ADD COLUMN in Spark catalog - #4174

Open
Xtpacz wants to merge 4 commits into
apache:mainfrom
Xtpacz:spark-add-column
Open

[spark] Support ADD COLUMN in Spark catalog#4174
Xtpacz wants to merge 4 commits into
apache:mainfrom
Xtpacz:spark-add-column

Conversation

@Xtpacz

@Xtpacz Xtpacz commented Sep 1, 2026

Copy link
Copy Markdown

Purpose

Linked issue: close #xxx

support alter table ... add column in fluss-spark catalog

Brief change log

  • convert spark AddColumn changes to fluss table changes.
  • Support column type, nullability, comment, position
  • reject nested column additions
  • add related test

Tests

added a test.

API and Format

no

Documentation

no

@Xtpacz

Xtpacz commented Sep 2, 2026

Copy link
Copy Markdown
Author

@Yohahaha @luoyuxia PTAL🙏🏻

@Yohahaha Yohahaha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments, thank you!

throw new UnsupportedOperationException(
s"Adding nested columns is not supported: ${p.fieldNames().mkString(".")}")
}
org.apache.fluss.metadata.TableChange.addColumn(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need support spark ColumnDefaultValue here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fluss doesn't support column defaults (no field anywhere in TableChange/Schema), and since we don't implement SupportsColumnDefaultValue
I added a guard, so a future SupportsColumnDefaultValue would fail loudly rather than drop defaults.
any case you think we should handle here?


protected def lakeFormat: Option[DataLakeFormat] = None

test("Catalog: add columns") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test not cover ColumnPosition, comments, nullable, please enrich test cases

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the catch~ added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants