Skip to content

Avoid create tables with system column names#878

Merged
wuchong merged 6 commits into
apache:mainfrom
zhaomin1423:f_810
May 19, 2025
Merged

Avoid create tables with system column names#878
wuchong merged 6 commits into
apache:mainfrom
zhaomin1423:f_810

Conversation

@zhaomin1423

Copy link
Copy Markdown
Member

Purpose

Linked issue: close #810

Brief change log

Verify that the system columns are used.

Tests

API and Format

Documentation

@CLAassistant

CLAassistant commented May 14, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@wuchong wuchong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution @zhaomin1423 , the changes looks good in general. I left some minor comments.

import static org.assertj.core.api.Assertions.assertThatThrownBy;

/** Test for {@link TableDescriptorValidation} . */
public class TableDescriptorValidationTest {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add an integration test testCreateTableWithInvalidColumns in FlussAdminITCase? If the IT case is added, I think we don't need this unit test anymore.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, updated

zhaomin1423 and others added 2 commits May 15, 2025 22:35
…eDescriptorValidation.java

Co-authored-by: Jark Wu <imjark@gmail.com>

private static void checkSystemColumns(RowType schema) {
List<String> fieldNames = schema.getFieldNames();
List<String> systemColumns =

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.

Can we create a set at the class level here? The list is going to grow, and it would help us to have a faster lookup via set and save us from recreating the same list on every function call.
@wuchong What do you think?

private static final Set<String> SYSTEM_COLUMNS = Collections.unmodifiableSet(
    new HashSet<>(Arrays.asList(OFFSET_COLUMN_NAME, TIMESTAMP_COLUMN_NAME, BUCKET_COLUMN_NAME)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@zhaomin1423 could you update PR for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated, thanks @MehulBatra

@MehulBatra

Copy link
Copy Markdown
Contributor

Thank you for your Contribution! left one comment remaining, looks good.

@wuchong wuchong merged commit 5dccb0d into apache:main May 19, 2025
caozhen1937 pushed a commit to caozhen1937/fluss that referenced this pull request May 21, 2025
polyzos pushed a commit to polyzos/fluss that referenced this pull request Jun 6, 2025
polyzos pushed a commit to polyzos/fluss that referenced this pull request Jun 6, 2025
ZmmBigdata pushed a commit to ZmmBigdata/fluss that referenced this pull request Jun 20, 2025
polyzos pushed a commit to polyzos/fluss that referenced this pull request Aug 30, 2025
polyzos pushed a commit to HZY-Wade/fluss that referenced this pull request Aug 31, 2025
Ugbot pushed a commit to Ugbot/fluss that referenced this pull request Apr 26, 2026
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.

Avoid create tables with system column names

4 participants