-
Notifications
You must be signed in to change notification settings - Fork 16
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
POC for deleteOne and deleteMany for tables #1324
Conversation
Encapsulates behavior for clauses that can be validated and better supports schema object types.
This PR refactors how we process filters by moving the base class FilterableResolver that was used by command resolvers to be standalone class FilterResolver that has CollectionFilterResolver and TableFilterResolver subclasses. The changes to the resolvers are mostly to handle this change, other than findOne. The next part is findOne updated to process the filter for a table. Using the TableFilterResolver to make filters, which then use the NativeTypeTableFilter and JSONCodec to map from the types used for JSOn into what CQL expects. This is POC work, we then need to expand this to handle all the situations we expect.
POC to show pushing the projection down how we build the select and how we build the document from the row. see OperationProjection
Tis commit changes the InsertTableOperation to use the same JSONCodec created to process data for a filter to transform the data from the incoming document into what the driver wants to write to the CQL column
Expands the JSONCode to support mapping toJSON from the objects the driver sent, to be used in the projection
refactoring out so we can re-use things in the update command
Continues to refactor how we build a CQL statement using the Java driver, see the CQLClause and it's subclasses for the structure. UpdateOneCommandResolver works with tables, creates a TableUpdateOperation and re-uses the where clause from select. Only supports the $set and $unset operations for now.
Adds a new DeleteTableOperation and re-uses the filter resolving, and resolver framework for tables. Note: we cannot know the number of records deleted, and we cannot limit the number - unless we validate that the entire PK was supplied. Will check those things when we get to Beta,
|
||
var statement = delete.build(positionalValues.toArray()); | ||
|
||
LOGGER.warn("DELETE CQL: {}", delete.asCql()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change to Info or just delete the the log if these are just added for debug purpuse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def will do once we get out of alpha, there are they to make it easy to see the CQL we are generating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left one suggestion
@amorton what is the status of this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does:
Adds a new DeleteTableOperation and re-uses the filter resolving, and resolver framework for tables.
Note: we cannot know the number of records deleted, and we cannot limit the number - unless we validate that the entire PK was supplied. Will check those things when we get to Beta,
Which issue(s) this PR fixes:
Fixes #
Checklist