Skip to content

Conversation

@zhaomin1423
Copy link
Member

Purpose

Linked issue: close #810

Brief change log

Verify that the system columns are used.

Tests

API and Format

Documentation

@CLAassistant
Copy link

CLAassistant commented May 14, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@wuchong wuchong left a comment

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
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
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
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
Member

Choose a reason for hiding this comment

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

+1

Copy link
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
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
Contributor

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

@wuchong wuchong merged commit 5dccb0d into apache:main May 19, 2025
5 of 6 checks passed
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 Alibaba-HZY/fluss that referenced this pull request Aug 31, 2025
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