-
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
_id field to support String, Number, Boolean and Null Json type #66
Conversation
src/main/java/io/stargate/sgv3/docsapi/api/model/command/clause/filter/JsonType.java
Show resolved
Hide resolved
src/main/java/io/stargate/sgv3/docsapi/service/shredding/model/DocumentId.java
Outdated
Show resolved
Hide resolved
@@ -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) { |
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.
Is this because Tuples are expressed as Lists in protobuf/bridge/grpc?
src/main/java/io/stargate/sgv3/docsapi/service/operation/model/impl/DeleteOperation.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv3/docsapi/service/shredding/model/DocumentId.java
Show resolved
Hide resolved
src/main/java/io/stargate/sgv3/docsapi/service/shredding/model/DocumentId.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv3/docsapi/service/shredding/model/DocumentId.java
Outdated
Show resolved
Hide resolved
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.
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 returnnull
AFAIK (forNullId
)- 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 databasetinyint
intoJsonType
; but the other direction (DocumentId
subtypes'value()
) can just directly return constant
src/main/java/io/stargate/sgv3/docsapi/service/shredding/model/DocumentId.java
Outdated
Show resolved
Hide resolved
…csapi into key-type-change
src/main/java/io/stargate/sgv3/docsapi/service/shredding/model/DocumentId.java
Show resolved
Hide resolved
@@ -163,6 +207,73 @@ public void insertDocument() { | |||
.body("data.docs[0]", jsonEquals(expected)); | |||
} | |||
|
|||
@Test | |||
public void insertDocumentWithDifferentTypes() { |
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.
Good!
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.
Looks very good, I like it!
Implementation for DB storage and filter logic for id fields Issue #58