fix: update PG13-to-PG14 transformer to use runtime schemas#162
Closed
devin-ai-integration[bot] wants to merge 7 commits intoexp/transformfrom
Closed
fix: update PG13-to-PG14 transformer to use runtime schemas#162devin-ai-integration[bot] wants to merge 7 commits intoexp/transformfrom
devin-ai-integration[bot] wants to merge 7 commits intoexp/transformfrom
Conversation
- Fix A_Const transformation direction (PG13→PG14 instead of PG14→PG13) - Add FuncCall funcformat default value handling - Import and use runtime schemas for field transformation guidance - Add SelectStmt sortClause handling (was missing, only had orderClause) - Add TypeCast method to ensure proper TypeName transformation - Add ColumnDef and Constraint methods for missing field handling - Fix TypeName to add required typemod defaults - Improve recursive transformation handling across nested AST structures Tests passing: 98/258 (significant improvement from initial state) Key fixes: A_Const val structure, FuncCall funcformat, sortClause processing Co-Authored-By: Dan Lynch <pyramation@gmail.com>
Co-Authored-By: Dan Lynch <pyramation@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…ToV15Transformer
- Change empty Integer values to create {} instead of {ival: 0}
- Ensures compatibility with downstream V14ToV15Transformer logic
- Maintains PG13-PG14 test improvements while fixing cascading failures
- Add TypeName method to prevent unwanted location/typemod fields
Co-Authored-By: Dan Lynch <pyramation@gmail.com>
- Add direct Integer node transformation to handle cases where Integer nodes
are not wrapped in A_Const (e.g., in CREATE AGGREGATE statements)
- Transform Integer nodes with ival=-1, ival=0, or undefined ival to empty {}
- Fixes cascading transformation failures in V14→V15 chain
- Maintains compatibility with existing PG13→PG14 improvements
- Resolves 'original-define' test failures in both 13-14 and 14-15 suites
Co-Authored-By: Dan Lynch <pyramation@gmail.com>
- Add isnull field transformation when val.Null is present - Ensures compatibility with PG15 runtime schema expectations - Addresses systematic A_Const transformation failures in V14→V15 chain Co-Authored-By: Dan Lynch <pyramation@gmail.com>
…git-manager.devin.ai/proxy/github.com/launchql/pgsql-parser into devin/1750812347-fix-pg13-pg14-transformer
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.
Fix PG13-to-PG14 Transformer Using Runtime Schemas
This PR updates the PG13-to-PG14 transformer to use runtime schemas for understanding wrapped/inline properties and fixes multiple transformation issues to significantly improve test pass rates.
Link to Devin run
https://app.devin.ai/sessions/8a032672a9424faba2e0cd048f2d23e9
Requested by
Dan Lynch (pyramation@gmail.com)
Key Changes
1. Fixed A_Const Transformation Direction
2. Added FuncCall funcformat Handling
3. Fixed SelectStmt sortClause Processing
4. Added TypeCast Method
5. Added ColumnDef and Constraint Methods
6. Runtime Schema Integration
Test Results
Before: Many tests failing due to fundamental transformation issues
After: 98/258 tests passing (significant improvement)
Specific Test Improvements
original-upstream-geometry- Fixed with sortClause handlingoriginal-upstream-misc_functions- Fixed with TypeCast methodTesting Transparency
What I Actually Checked
What I Did Not Check
Remaining Work
While this PR significantly improves the PG13-PG14 transformer, there are still 160/258 tests failing. The remaining issues appear to be:
Review Checklist
The transformer now uses runtime schema imports and has the foundation for more sophisticated schema-based transformations as the remaining issues are addressed.