-
Notifications
You must be signed in to change notification settings - Fork 11
patch - support for search queries on top of flattened postgres table… #223
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #223 +/- ##
============================================
- Coverage 79.60% 78.55% -1.05%
- Complexity 1048 1069 +21
============================================
Files 204 206 +2
Lines 5084 5228 +144
Branches 416 449 +33
============================================
+ Hits 4047 4107 +60
- Misses 741 813 +72
- Partials 296 308 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
...ent-store/src/main/java/org/hypertrace/core/documentstore/model/config/ConnectionConfig.java
Outdated
Show resolved
Hide resolved
| protected final ObjectMapper MAPPER = new ObjectMapper(); | ||
| protected ResultSet resultSet; | ||
| private final boolean removeDocumentId; | ||
| final boolean removeDocumentId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this package private may introduce some confusion and can be error prone. Can we see if it's possible to avoid it?
...e/src/main/java/org/hypertrace/core/documentstore/postgres/query/v1/PostgresQueryParser.java
Outdated
Show resolved
Hide resolved
… added quotes around fields
document-store/src/main/java/org/hypertrace/core/documentstore/postgres/PostgresCollection.java
Show resolved
Hide resolved
| private void addColumnToJsonNode( | ||
| ObjectNode jsonNode, String columnName, String columnType, int columnIndex) | ||
| throws SQLException { | ||
| switch (columnType.toLowerCase()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we face some issue, while using this one - mapValueToJsonNode? Can that be reused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we ran into a issue, that's why we created this separately
document-store/src/main/java/org/hypertrace/core/documentstore/postgres/PostgresCollection.java
Show resolved
Hide resolved
kotharironak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add few test cases.
...-store/src/main/java/org/hypertrace/core/documentstore/postgres/PostgresTableIdentifier.java
Show resolved
Hide resolved
| * different strategies for handling containment operations based on the context of the query (e.g., | ||
| * first-class fields vs. JSON fields). | ||
| */ | ||
| public interface PostgresContainsRelationalFilterParserInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we supporting CONTAINS already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, some queries have that so I added it
...documentstore/postgres/query/v1/parser/filter/PostgresInRelationalFilterParserInterface.java
Show resolved
Hide resolved
| String flatStructureCollection = context.getFlatStructureCollectionName(); | ||
| boolean isFirstClassField = | ||
| flatStructureCollection != null | ||
| && flatStructureCollection.equals(context.getTableIdentifier().getTableName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we are applying to specific table name match. So, either table is flat table or it may contains json or non-json field. Looks like we are adding few checks, assuming we will do re-work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we have added a jira to relook at this
… structure
Description
Please include a summary of the change, motivation and context.
Testing
Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.
Checklist:
Documentation
Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.