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

Pinot handle customer keyword type empty val #6302

Merged
merged 14 commits into from
Sep 24, 2024

Conversation

bowenxia
Copy link
Contributor

What changed?

  • Factor out create keyword query function
  • Add a query to handle keyword query when value is empty

Why?

  • Factor out create keyword query function:
    • to make code reuseable
  • Add a query to handle keyword query when value is empty
    • this used to be an edge case that we forgot to handle. It caused errors in mono repo when custom queries a keyword field with empty value.
    • the customStringField query code was reused because querying an empty string basically means querying an empty keyword since when value is empty, it doesn't need partial match.

How did you test it?
unit test, manually test in Pinot

Potential risks

Release notes

Documentation Changes

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.23%. Comparing base (75079f7) to head (2f86179).
Report is 1 commits behind head on master.

Additional details and impacted files
Files with missing lines Coverage Δ
common/pinot/pinotQueryValidator.go 87.82% <100.00%> (+0.12%) ⬆️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75079f7...2f86179. Read the comment docs.

@@ -115,7 +115,7 @@ func TestValidateQuery(t *testing.T) {
},
"Case8-4: query with custom keyword field not equal": {
query: "CustomKeywordField != 0",
validated: "JSON_MATCH(Attr, '\"$.CustomKeywordField\"!=''0''') and JSON_MATCH(Attr, '\"$.CustomKeywordField[*]\"!=''0''')",
validated: "(JSON_MATCH(Attr, '\"$.CustomKeywordField\"!=''0''') and JSON_MATCH(Attr, '\"$.CustomKeywordField[*]\"!=''0'''))",
Copy link
Member

Choose a reason for hiding this comment

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

nit consider using backticks to make things more readable when fighting quotes in quites

ie

`(JSON_MATCH(Attr, '"$.CustomKeywordField"!=''0''') and JSON_MATCH(Attr, '"$.CustomKeywordField[*]"!=''0'''))`

I guess, or similar, I'm having slight trouble following this because I've not spent enough time close to the Pinot component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do in the next PR. I enabled auto-merge for this one

@bowenxia bowenxia merged commit 50e3558 into master Sep 24, 2024
21 checks passed
@bowenxia bowenxia deleted the xbowen_pinot_handle_customer_keyword_type_empty_val branch September 24, 2024 21:20
dkrotx pushed a commit to dkrotx/cadence that referenced this pull request Sep 26, 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