Skip to content

Avoid create tables with system column names #810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 2 tasks
wuchong opened this issue Apr 30, 2025 · 4 comments
Open
1 of 2 tasks

Avoid create tables with system column names #810

wuchong opened this issue Apr 30, 2025 · 4 comments

Comments

@wuchong
Copy link
Member

wuchong commented Apr 30, 2025

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

#640 introduced some system columns (__offset, __timestamp, __bucket) for lake enabled tables. We should throw exceptions during the creation of the table (even if lake is not enabled for them). This allows users to enable lake for the tables in the future without throwing exceptions.

Solution

No response

Anything else?

No response

Willingness to contribute

  • I'm willing to submit a PR!
@zhaomin1423
Copy link

Could you assign it to me?

@MehulBatra
Copy link
Contributor

MehulBatra commented May 2, 2025

@wuchong After reviewing the requirements, I propose an implementation. Please let me know if this sounds correct to you. If so I can help @zhaomin1423 to get this started.

  1. Create a static unmodifiableList containing the system column names (__offset, __timestamp, __bucket) that are reserved for lake-enabled tables

  2. Enhance the validation in src/main/java/com/alibaba/fluss/server/utils/TableDescriptorValidation.java to:

    • Always validate against reserved system column names during table creation, regardless of whether lake is currently enabled
  3. In the validateTableDescriptor method:

    • Check if the table DDL request contains any of the reserved system column names
    • If found, throw an exception with a clear message explaining that these are reserved for internal system use
  4. Add a Unit Test for the same.

  5. Consider adding documentation that explains the reserved column name restrictions and their purpose(can be done as a separate part, as we might need to consider a separate page, which will contain all the system reserved keywords)

@wuchong
Copy link
Member Author

wuchong commented May 4, 2025

@MehulBatra the proposal sounds great to me!

@zhaomin1423 are you interested in implementing this?

@zhaomin1423
Copy link

@MehulBatra the proposal sounds great to me!

@zhaomin1423 are you interested in implementing this?

Yes, thanks @MehulBatra

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

No branches or pull requests

3 participants