feat: Parser Enhancements Batch 5 - ARRAY Constructor, WITHIN GROUP & JSONB Operators #187
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.
Summary
Implements three new parser features for PostgreSQL SQL compatibility:
?,?|,?&operators which were incorrectly being converted to placeholder tokensARRAY[...]literals andARRAY(SELECT...)subquery syntax with proper AST nodes and poolingPERCENTILE_CONT,PERCENTILE_DISC,MODE, andLISTAGGfunctionsChanges
Token Types & Keywords
TokenTypeArray(395) andTokenTypeWithin(396) token typesARRAYandWITHINkeywords to keywords.go and tokenizer.goAST Nodes
ArrayConstructorExpressionwithElementsand optionalSubqueryfieldsWithinGroupfield toFunctionCallstruct for ordered-set aggregatesArrayConstructorExpressionin pool.goParser
parseArrayConstructor()function in expressions.goparseFunctionCall()in window.go to parse WITHIN GROUP clausesTests
array_constructor_test.go: 15+ test cases for ARRAY syntax variationswithin_group_test.go: 12+ test cases for ordered-set aggregatesjson_operators_test.go: Parser tests for JSONB operatorsoperators_test.go: Extended operator parsing testsTest plan
Closes #178, #182, #183
🤖 Generated with Claude Code