Skip to content

Comments

CASSANALYTICS-120: Quote identifiers option must be set to true if ttl has mixed case column name#172

Open
sarankk wants to merge 4 commits intoapache:trunkfrom
sarankk:CASSANALYTICS-120
Open

CASSANALYTICS-120: Quote identifiers option must be set to true if ttl has mixed case column name#172
sarankk wants to merge 4 commits intoapache:trunkfrom
sarankk:CASSANALYTICS-120

Conversation

@sarankk
Copy link
Contributor

@sarankk sarankk commented Feb 14, 2026

If users set TTL column name or timestamp column name to be mixed case, they have to set quote identifiers option to true for Cassandra to resolve the column name correctly. Sometimes users miss setting quote identifiers option and perRowTTL setting incorrectly overrides their existing TTL with null values when bulk write job runs. This patch fixes this, by checking for mixed case column names and setting quote identifiers option when required.

@sarankk sarankk requested a review from frankgh February 14, 2026 00:55
@sarankk
Copy link
Contributor Author

sarankk commented Feb 14, 2026

Thanks @frankgh for the review, good spot. Addressed your comment. Instead of automatically setting quote identifiers option to true, added a validation instead to throw if users use mixed case column names without quote identifiers. With current behavior, when perRow TTL option is set with mixed case TTL column name and without quote identifiers, the job succeeds but silently rewrites existing TTLs of the rows to null. Hence throwing to fix this.

WriterOptions.QUOTE_IDENTIFIERS.name(), WriterOptions.QUOTE_IDENTIFIERS.name());
}

private boolean doesNotHaveUpperCaseChars(String name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure is there a existing Java utility function to o this check. Java experts may comment here.

@skoppu22
Copy link
Contributor

+1 Looks good

Copy link
Contributor

@frankgh frankgh left a comment

Choose a reason for hiding this comment

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

The approach now seems better than before. When we don't quote we validate that the TTL and Timestamp columns only have lowercase. However, this doesn't cover for the case of special characters. I suggest leveraging the bridge.maybeQuoteIdentifier(String) functionality to make a determination whether the input is valid or not

@sarankk sarankk requested a review from frankgh February 19, 2026 17:23
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.

3 participants