Skip to content

Allow use of table options not registered in TableOption and extend known TableOptions #1586

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

Closed

Conversation

seungh0
Copy link
Contributor

@seungh0 seungh0 commented Jun 23, 2025

  • Allow use of table options not registered in TableOption

  • Add support for additional table options

    • default_time_to_live
    • speculative_retry
    • memtable_flush_period_in_ms
    • cdc
    • read_repair
    • min_index_interval
    • max_index_interval
    • crc_check_chance

Since I thought there might be different opinions on this commit,
I decided to split it into two separate commits for now.

Closes #1584

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

See spring-projects#1584

- default_time_to_live
- cdc
- speculative_retry
- memtable_flush_period_in_ms
- crc_check_chance
- min_index_interval
- max_index_interval
- read_repair

Signed-off-by: seungh0 <will.seungho@gmail.com>
@seungh0 seungh0 force-pushed the GH-1584-add-new-table-options branch from b8f32ec to 0444035 Compare June 23, 2025 16:44
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 23, 2025
@seungh0 seungh0 force-pushed the GH-1584-add-new-table-options branch from ab2ded1 to e2d9c5a Compare June 23, 2025 16:47
@seungh0 seungh0 changed the title Add support for additional table options Allow use of table options not registered in TableOption (+ Add support for additional table options) Jun 23, 2025
return;
}
createTableSpecification.with(key, value, false, false);
}
Copy link
Contributor Author

@seungh0 seungh0 Jun 23, 2025

Choose a reason for hiding this comment

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

In the current situation, if users manually apply escaping and quoting, it could result in double escaping/quoting if the option is later added to TableOption in a future version.

So I considered two options:

  1. Apply escaping and quoting only when the option is not part of TableOption and the value is a string — as implemented in the PR.
  2. Enhance CqlStringUtils to detect whether the value is already escaped or quoted, and skip escaping if so.

I chose option 1, considering the potential side effects.
What do you think is the better approach?

Copy link
Member

Choose a reason for hiding this comment

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

Providing values as strings in a map is convenient and doing so might cause a moment of surprise when an option (e.g. bloom_filter_fp_chance) was not defined in TableOptions and the value of 0.3 gets quoted to 0.3. However, Cassandra seems not to care whether a value is quoted. Let's keep only the quoting and expect escaping by the caller.

Having the framework doing something that you cannot disable causes more inconvenience than doing less in the framework and allowing the caller to update their inputs.

see spring-projects#1584

Signed-off-by: seungh0 <will.seungho@gmail.com>
@seungh0 seungh0 force-pushed the GH-1584-add-new-table-options branch from e2d9c5a to 58f1595 Compare June 23, 2025 16:55
@seungh0 seungh0 changed the title Allow use of table options not registered in TableOption (+ Add support for additional table options) Allow use of table options not registered in TableOption (+ Add support for additional table options) Jun 23, 2025
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 30, 2025
Copy link
Member

@mp911de mp911de 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 decent pull request. I'm going to merge this one for the next release.

@mp911de mp911de changed the title Allow use of table options not registered in TableOption (+ Add support for additional table options) Allow use of table options not registered in TableOption and extend known TableOptions Jun 30, 2025
mp911de pushed a commit that referenced this pull request Jun 30, 2025
- default_time_to_live
- cdc
- speculative_retry
- memtable_flush_period_in_ms
- crc_check_chance
- min_index_interval
- max_index_interval
- read_repair

Closes #1584
Original pull request: #1586

Signed-off-by: seungh0 <will.seungho@gmail.com>
mp911de pushed a commit that referenced this pull request Jun 30, 2025
See #1584
Original pull request: #1586

Signed-off-by: seungh0 <will.seungho@gmail.com>
mp911de added a commit that referenced this pull request Jun 30, 2025
Refine enum constructors to common creation patterns. Improve boolean option handling in TableOptionsSpecification. Quote unknown TableOptions as Cassandra accepts quoted options.

Add since tags.

Simplify tests.

See #1584
Original pull request: #1586
@mp911de mp911de added this to the 5.0 M4 (2025.1.0) milestone Jun 30, 2025
@mp911de
Copy link
Member

mp911de commented Jun 30, 2025

Thank you for your contribution. That's merged and polished now.

@mp911de mp911de closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing TableOptions
3 participants