Skip to content
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

Minor clean up on #1698 fix based on code review comments #1805

Merged
merged 3 commits into from
Jan 2, 2025

Conversation

tatu-at-datastax
Copy link
Contributor

What this PR does:

Cleans up PR #1798 (for #1698) to simplify code, avoid adding new method.
Based on PR review comments added post-merge.

Which issue(s) this PR fixes:
N/A

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@@ -45,7 +44,7 @@ public Optional<ColumnsDescContainer> schemaDescription() {
return Optional.empty();
}
var apiColumns = schemaObject.apiTableDef().primaryKeys();
var unsupported = apiColumns.filterBySupport(ApiSupportDef::isUnsupportedInsert);
var unsupported = apiColumns.filterBySupport(x -> !x.insert());
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 I fully understand why Matcher cannot be used in this case. Aaron has the negation example in WriteableTableRowBuilder (sorry, there are so many NO_MATCHES examples and I just randomly picked one previously.)

I tried ApiSupportDef.Matcher.NO_MATCHES.withInsert(false) here and it could pass the test insertValidVectorKey you added in the previous PR. So I think it works? I don't mean we always need to have the same way, just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To me this way seems bit simpler than building and using a Matcher, that's all. I am sure Matcher could be used, and would make sense for more complex cases.
So maybe just matter of preference.

@tatu-at-datastax tatu-at-datastax merged commit 7c3d330 into main Jan 2, 2025
3 checks passed
@tatu-at-datastax tatu-at-datastax deleted the tatu/1698-post-merge-cleanup branch January 2, 2025 17:55
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.

2 participants