Skip to content

Conversation

@suddendust
Copy link
Contributor

Description

This Adds support for CONTAINS, NOT CONTAINS, IN and NOT IN operators for nested json fields for flat collections.

Testing

Added integration tests for all relational operators in FlatCollectionJsonbRelationalOperatorTest.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.41%. Comparing base (704c275) to head (51a6a62).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ter/PostgresNotContainsRelationalFilterParser.java 87.50% 0 Missing and 1 partial ⚠️
...er/filter/PostgresNotInRelationalFilterParser.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #243      +/-   ##
============================================
+ Coverage     80.10%   80.41%   +0.31%     
- Complexity     1134     1151      +17     
============================================
  Files           215      215              
  Lines          5488     5495       +7     
  Branches        482      486       +4     
============================================
+ Hits           4396     4419      +23     
+ Misses          764      750      -14     
+ Partials        328      326       -2     
Flag Coverage Δ
integration 80.41% <90.00%> (+0.31%) ⬆️
unit 57.74% <85.00%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

boolean isFirstClassField =
postgresQueryParser.getPgColTransformer() instanceof FlatPostgresFieldTransformer;
// Check if LHS is a JSON field (JSONB column access)
boolean isJsonField = expression.getLhs() instanceof JsonIdentifierExpression;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@suresh-prakash I tried avoiding this instanceof check but using a visitor just to check this seems like an overkill. Do you think we can avoid this using some other method?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can use a strategy pattern and pass the object instance via. PostgresQueryParser.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed this offline. @suddendust will plan to pick this up separately.

@suddendust suddendust changed the title Support for Relational Operators on JSONB Nested Fields for Flat Collections Support for Relational Operators on Nested Fields in Flat Collections Oct 23, 2025
@suddendust suddendust changed the title Support for Relational Operators on Nested Fields in Flat Collections Relational pperators on nested fields in flat collections Oct 23, 2025
@suddendust suddendust changed the title Relational pperators on nested fields in flat collections Relational operators on nested fields in flat collections Oct 23, 2025
suresh-prakash
suresh-prakash previously approved these changes Oct 27, 2025
@suresh-prakash suresh-prakash merged commit 4192bde into hypertrace:main Oct 27, 2025
6 checks passed
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