uber / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
7.96k stars 772 forks source link

Add In Clause handling in json indexed col (Attr) #6147

Closed bowenxia closed 4 days ago

bowenxia commented 5 days ago

What changed? Added IN Clause handling for json indexed col (Attr) And unit test with 100% coverage of the new function.

Why? One customer complained that they had error when using IN Clause after we migrated their domain to Pinot. Because previously ES supported that. Pinot DOES supported this for all other system keys; but in a json indexed col like ATTR (we stored this column in a json format), we need to handle IN clause in a different way.

Sample query: if we input: BinaryChecksums IN ("uDeploy:e6b658fc4ae98445a356d2218316081f7113fcdf") It would be processed to: and JSON_MATCH(Attr, '"$.BinaryChecksums" IN (''uDeploy:e6b658fc4ae98445a356d2218316081f7113fcdf'')') or JSON_MATCH(Attr, '"$.BinaryChecksums[*]" IN (''uDeploy:e6b658fc4ae98445a356d2218316081f7113fcdf'')')

How did you test it? unit test

Potential risks

Release notes

Documentation Changes

codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.72%. Comparing base (0b46176) to head (71af3ac).

:exclamation: Current head 71af3ac differs from pull request most recent head 46d3ac5

Please upload reports for the commit 46d3ac5 to get more accurate results.

Additional details and impacted files | [Files](https://app.codecov.io/gh/uber/cadence/pull/6147?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) | Coverage Ξ” | | |---|---|---| | [common/pinot/pinotQueryValidator.go](https://app.codecov.io/gh/uber/cadence/pull/6147?src=pr&el=tree&filepath=common%2Fpinot%2FpinotQueryValidator.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-Y29tbW9uL3Bpbm90L3Bpbm90UXVlcnlWYWxpZGF0b3IuZ28=) | `86.02% <100.00%> (+1.13%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/uber/cadence/pull/6147/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/uber/cadence/pull/6147?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) > `Ξ” = absolute (impact)`, `ΓΈ = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/uber/cadence/pull/6147?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Last update [0b46176...46d3ac5](https://app.codecov.io/gh/uber/cadence/pull/6147?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber).
coveralls commented 5 days ago

Pull Request Test Coverage Report for Build 019051d7-b549-4c26-b296-87c3bc87a437

Details


Files with Coverage Reduction New Missed Lines %
service/matching/tasklist/matcher.go 1 90.55%
common/task/weighted_round_robin_task_scheduler.go 2 89.05%
common/peerprovider/ringpopprovider/config.go 2 81.58%
common/util.go 2 91.84%
service/history/task/task.go 3 84.81%
common/persistence/nosql/nosql_task_store.go 3 85.52%
service/history/handler/handler.go 3 96.2%
service/history/task/timer_standby_task_executor.go 3 85.63%
service/history/task/fetcher.go 3 85.57%
service/history/task/transfer_standby_task_executor.go 6 86.33%
<!-- Total: 34 -->
Totals Coverage Status
Change from base Build 0190508e-3f7e-4c0d-b546-4eaa2a2045f1: 0.01%
Covered Lines: 107119
Relevant Lines: 149706

πŸ’› - Coveralls
coveralls commented 4 days ago

Pull Request Test Coverage Report for Build 0190567b-a424-4d32-a57e-d52b447b9cb0

Details


Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 2 89.05%
service/matching/tasklist/db.go 2 73.23%
common/util.go 2 91.84%
common/log/tag/tags.go 3 50.46%
common/persistence/nosql/nosql_task_store.go 3 85.52%
service/history/task/timer_standby_task_executor.go 3 85.63%
common/task/fifo_task_scheduler.go 4 83.51%
service/history/task/transfer_standby_task_executor.go 6 86.94%
service/matching/tasklist/task_reader.go 9 75.33%
<!-- Total: 34 -->
Totals Coverage Status
Change from base Build 0190508e-3f7e-4c0d-b546-4eaa2a2045f1: 0.004%
Covered Lines: 107110
Relevant Lines: 149706

πŸ’› - Coveralls