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

_id field to support String, Number, Boolean and Null Json type #66

Merged
merged 13 commits into from
Feb 2, 2023

Conversation

maheshrajamani
Copy link
Contributor

@maheshrajamani maheshrajamani commented Feb 1, 2023

Implementation for DB storage and filter logic for id fields Issue #58

@@ -61,8 +61,10 @@ public static Map<QueryOuterClass.Value, QueryOuterClass.Value> getDoubleMapValu
return to;
}

public static QueryOuterClass.Value getDocumentIdValue(DocumentId documentId) {
public static List<QueryOuterClass.Value> getDocumentIdValue(DocumentId documentId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this because Tuples are expressed as Lists in protobuf/bridge/grpc?

Copy link
Contributor

@tatu-at-datastax tatu-at-datastax left a comment

Choose a reason for hiding this comment

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

I think this makes sense: at first I was confused by new JsonType but I think I got it.

Couple of changes that I think are needed:

  • toString() is not allowed to return null AFAIK (for NullId)
  • Need to add constants for numeric type ids (probably in DocumentId), refer to those
  • Can eliminate one part of BiMap: dynamical lookup only needed going from database tinyint into JsonType; but the other direction (DocumentId subtypes' value()) can just directly return constant

@maheshrajamani maheshrajamani requested a review from a team as a code owner February 2, 2023 02:21
@@ -163,6 +207,73 @@ public void insertDocument() {
.body("data.docs[0]", jsonEquals(expected));
}

@Test
public void insertDocumentWithDifferentTypes() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good!

Copy link
Contributor

@tatu-at-datastax tatu-at-datastax left a comment

Choose a reason for hiding this comment

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

Looks very good, I like it!

@maheshrajamani maheshrajamani merged commit 0183022 into main Feb 2, 2023
@maheshrajamani maheshrajamani deleted the key-type-change branch February 2, 2023 17:26
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