Duansg opened a new pull request, #3482: URL: https://github.com/apache/hertzbeat/pull/3482
## What's changed? Please refer to: [#3480](https://github.com/apache/hertzbeat/issues/3480) Main issue: 1. Only the first non-empty item of `leftOperand` and `rightOperand` was processed, merging once instead of intersecting all non-empty items, resulting in an incorrect outcome. 2. The tags are not aligned, and no matching is done for the tag sets; they are merged directly, which causes tag confusion and results in errors. This is because the semantics of `and` are based on the intersection of tag sets, and the result only retains the tags and values from the left side. Modification details: 1. Fixed the semantic issue with `and`. For details, see: [Logical/set binary operators](https://prometheus.io/docs/prometheus/latest/querying/operators/#logicalset-binary-operators) 2. Optimize parsing and union matching processing performance. 3. Add/fix test cases and pass historical cases successfully . <img width="1509" alt="iShot_2025-06-20_10 31 20" src="https://github.com/user-attachments/assets/2601c69c-153e-4e06-86b9-d0e5845bd129" /> <img width="1510" alt="iShot_2025-06-20_10 31 57" src="https://github.com/user-attachments/assets/65437a81-a1ae-4e90-b6fe-f595aebec1c3" /> <img width="1511" alt="iShot_2025-06-20_10 32 37" src="https://github.com/user-attachments/assets/fe29d111-876f-4c29-8370-3fede38458b5" /> <img width="808" alt="iShot_2025-06-20_10 38 30" src="https://github.com/user-attachments/assets/6e6aa08d-f1cb-4087-a709-d5b58e6b3dc8" /> ## Checklist - [x] I have read the [Contributing Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide) - [x] I have written the necessary doc or comment. - [x] I have added the necessary unit tests and all cases have passed. ## Add or update API - [ ] I have added the necessary [e2e tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have passed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
