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

Update documentation for JSON Index with latest enhancements #334

Merged
merged 2 commits into from
May 20, 2024

Conversation

Comment on lines +412 to +418
Find all persons who have at least one address that is not in the US:

```sql
SELECT ...
FROM mytable
WHERE JSON_MATCH(person, '"$.addresses[*].country" != ''us''')
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Jackie-Jiang should we explicitly call out that this semantic is different in previous versions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can add a note stating exclusive predicate doesn't work properly on array, and cannot be nested in the previous version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not just the array based lookups, there's also the non-existent key case (5th point in this PR description - apache/pinot#13139). I'm wondering how we can best phrase these differences in semantics? If we call out all the details with examples, it might end up being unnecessarily confusing to new users.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The current one looks good. We may iterate on this if user asks for it

@@ -419,6 +448,8 @@ FROM mytable
WHERE JSON_MATCH(person, '"$.name"=''adam'' AND "$.addresses[*].number"=112')
```

`NOT IN` and `!=` can be used in nested filter expressions starting from Pinot 1.2.0. Note that `IS NULL` cannot be used in nested filter expressions currently.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOT IN and != can be used in nested filter expressions starting from Pinot 1.2.0

I'm wondering if this needs to be stated explicitly or can be omitted?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can put them in a hint blob. We can phrase it as it was not supported before 1.2.0

@Jackie-Jiang Jackie-Jiang merged commit 284e899 into pinot-contrib:latest May 20, 2024
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