Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #228 +/- ##
============================================
- Coverage 78.55% 78.19% -0.37%
- Complexity 1069 1086 +17
============================================
Files 206 210 +4
Lines 5228 5383 +155
Branches 449 466 +17
============================================
+ Hits 4107 4209 +102
- Misses 813 858 +45
- Partials 308 316 +8
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:
|
7b05f4b to
20d6116
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PROMPT TO THE AGENT
Document-Store Library PostgreSQL Query Interface Refactoring
CONTEXT & BACKGROUND
You are working with the document-store library, which provides a QueryLayer interface for consuming services. The library has two critical interfaces:
SCOPE: Focus exclusively on the PostgreSQL implementation located at:
@document-store/src/main/java/org/hypertrace/core/documentstore/postgres
Specifically, concentrate on the PostgreSQL implementations of:
CURRENT PROBLEM
The PostgreSQL implementation of the query interface has a critical limitation:
REFACTORING GOALS
Primary Goal (Priority 1):
Extend query generation support to include these data types while maintaining extensible design:
Secondary Goal (Future Enhancement):
The output parsing already exists in:
@document-store/src/main/java/org/hypertrace/core/documentstore/postgres/PostgresCollection.java:PostgresResultIteratorWithBasicTypes:prepareDocument
Query results should be parsed and returned as JsonNode (acknowledge existing support, will enhance later).
CURRENT IMPLEMENTATION DETAILS
Existing Workaround:
A temporary solution exists in FieldToPgColumnTransformer:transform that handles first-class fields based on:
flatStructureCollection.equals(postgresQueryParser.getTableIdentifier().getTableName())
Recent Interface Additions:
The following interfaces have been created for SQL query generation for first-class fields:
IMPLEMENTATION REQUIREMENTS
Mandatory Constraints:
The registry-based approach should replace the current hardcoded pattern:
flatStructureCollection.equals(context.getTableIdentifier().getTableName()...<NewlyCreatedRegistry>:<isFirstClassColumn>This registry lookup will determine whether to use JSON or non-JSON parser implementations. The decision affects the following parser pairs:
PostgresContainsRelationalFilterParser(JSON) vsPostgresContainsRelationalFilterParserNonJsonField(non-JSON)PostgresInRelationalFilterParser(JSON) vsPostgresInRelationalFilterParserNonJsonField(non-JSON)Additional parser classes that currently handle only JSON-based query generation must have corresponding non-JSON implementations created. Reference implementations for the non-JSON variants are available at:
document-store/src/main/java/org/hypertrace/core/documentstore/postgres/query/v1/parser/filter/nonjson/field/Input/Output Specification:
DELIVERABLES
Please provide:
SUCCESS CRITERIA
ADDITIONAL NOTES