-
Notifications
You must be signed in to change notification settings - Fork 30
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
Update the spec to fix the issue 782 #943
Conversation
Signed-off-by: Otavio Santana <[email protected]>
…tead of field Signed-off-by: Otavio Santana <[email protected]>
…abase Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
@njr-11, when you have time, could you review this one, please? |
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.
To start out with, I reviewed the first two sections adding some suggestions for making the making the requirements more clear of what must be supported vs what is not required. I don't have expertise in these NoSQL databases, so I might have gotten some of the clarifications incorrect. I tried to use what the TCK is enforcing in the referenced issues as a guide, as well as the proposed text that was here.
I'll follow this up with reviewing the other sections but wanted to save this before an error occurs and I need to start over.
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
When using NoSQL databases, the support for restrictions varies depending on the database type: | ||
|
||
- **Key-Value Databases**: Support for the equals restriction and the `Not` restriction is required for the `Id` attribute. There is no requirement to support other types of restrictions, the `And` and `Or` keywords, or restrictions on other entity attributes. Queries in key-value databases are typically limited to operations using the `Id` attribute only. | ||
- **Wide-Column Databases**: Wide-column databases must support the `AND` operator but are not required to support the `Or` operator. Restrictions must be supported for the key attribute that is annotated with `jakarta.nosql.Id`. Support for restrictions on other attributes is not required. Typically they can be used if they are indexed as secondary indexes, although support varies by database provider. |
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.
It happens in the majority of NoSQL databases of wide-column, but not all.
Those are samples, that is the reason we don't make it mandatory, I can assume to the majority, but not for all
NoSQL Database | Supports AND Operator |
---|---|
Apache Cassandra | ✅ Yes |
Apache HBase | ❌ No |
ScyllaDB | ✅ Yes |
Google Bigtable | ❌ No |
Amazon Keyspaces | ✅ Yes |
Hypertable | ❌ No |
Azure Cosmos DB (Cassandra API) | ✅ Yes |
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.
That's good information. I think the TCK might need to be updated because it only makes the allowance to not support for Key-Value, not Column,
try {
AsciiCharacter del = characters.findByIsControlTrueAndNumericValueBetween(33, 127);
assertEquals(127, del.getNumericValue());
assertEquals("7f", del.getHexadecimal());
assertEquals(true, del.isControl());
} catch (UnsupportedOperationException x) {
if (type.isKeywordSupportAtOrBelow(DatabaseType.KEY_VALUE)) {
// Key-Value databases might not be capable of And.
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.
@njr-11, what do you want to do?
A) Finish those topicinat the documentation and then go to fix the TCK
B) Open a PR in parallel to fix it simultaneously.
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.
@njr-11, what do you want to do?
A) Finish those topicinat the documentation and then go to fix the TCK
B) Open a PR in parallel to fix it simultaneously.
It is completely fine to use separate PRs to split out work such as updating errors that we spot in the TCK while working on this. There is another minor error that I noticed as well. I'll get a PR (#946) open for that and we can continue on with the documentation accordingly.
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.
Thanks, it does make sense. I reviewed and moved it.
Thanks, @njr-11 , NoSQL can help with that. I accepted your points, plus I give you some context. |
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.
Some more comments. Still need to cover the last 2 sections.
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
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 made it through reviewing the remaining sections. I'm still unsure what to suggest for Document and Graph Databases with respect to arithmetic operations and parentheses, having noted that the TCK seems to have requirements for Graph.
When using NoSQL databases, the support for restrictions varies depending on the database type: | ||
|
||
- **Key-Value Databases**: Support for the equals restriction and the `Not` restriction is required for the `Id` attribute. There is no requirement to support other types of restrictions, the `And` and `Or` keywords, or restrictions on other entity attributes. Queries in key-value databases are typically limited to operations using the `Id` attribute only. | ||
- **Wide-Column Databases**: Wide-column databases must support the `AND` operator but are not required to support the `Or` operator. Restrictions must be supported for the key attribute that is annotated with `jakarta.nosql.Id`. Support for restrictions on other attributes is not required. Typically they can be used if they are indexed as secondary indexes, although support varies by database provider. |
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.
That's good information. I think the TCK might need to be updated because it only makes the allowance to not support for Key-Value, not Column,
try {
AsciiCharacter del = characters.findByIsControlTrueAndNumericValueBetween(33, 127);
assertEquals(127, del.getNumericValue());
assertEquals("7f", del.getHexadecimal());
assertEquals(true, del.isControl());
} catch (UnsupportedOperationException x) {
if (type.isKeywordSupportAtOrBelow(DatabaseType.KEY_VALUE)) {
// Key-Value databases might not be capable of And.
[WARNING] | ||
==== | ||
When working with NoSQL databases, the `count` operation may not be supported, depending on the database structure and capabilities: | ||
|
||
- **Key-Value Databases**: In general, the majority of Key-Value databases do not support counting. Their design focuses on retrieving values by keys rather than aggregating data. | ||
|
||
- **Other NoSQL Databases**: Support for the `count` operation varies significantly: | ||
- **Wide-Column Databases**: Counting might require additional configurations, such as enabling secondary indexes or performing costly full table scans, which can affect performance. | ||
- **Graph and Document Databases**: These databases typically support counting, though performance may vary based on factors like indexing and query complexity. | ||
|
||
==== | ||
|
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.
Yeah, I can see why implementing count in Java would be a poor choice. I think the concern here will be whether any of this is a breaking change because we are lifting a requirement for it to work - if anyone was relying on it already, it will break if taken away, but that might as much an issue from the Jakarta Data provider as the spec itself.
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
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 proposed some updates to align with what I think was the outcome of the discussion on parentheses for Graph databases, if I understood correctly.
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Thanks, I've modified this one. Please check. |
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.
Thanks for getting all of this detail written into the spec!
Thank you for all the support. It is not done yet, but I will create a new PR. This one is already big enough. |
This PR has the goal of fixing some points that we find on the TCK review:
There are three more to fix. However, those will go using Javadoc. Thus, I will create as we finish and solve this one.
Ref: #782