You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* JSON_OBJECTAGG support for OVER clause
## Description
JSON_OBJECTAGG supports windowed aggregate usage via the OVER (PARTITION BY ...) clause in SQL Server, but ScriptDOM was missing support for parsing and generating it. This PR adds OVER clause support for JSON_OBJECTAGG in the TSql170 parser and script generator.
SQL syntax now supported:
`sql
SELECT JSON_OBJECTAGG(CustomerName:OrderDate) OVER (PARTITION BY OrderDate) FROM Customers;
SELECT JSON_OBJECTAGG(CustomerName:OrderDate ABSENT ON NULL) OVER (PARTITION BY OrderDate) FROM Customers;
SELECT JSON_OBJECTAGG(CustomerName:OrderDate NULL ON NULL) OVER (PARTITION BY OrderDate) FROM Customers;
SELECT JSON_OBJECTAGG(CustomerName:OrderDate NULL ON NULL RETURNING JSON) OVER (PARTITION BY OrderDate) FROM Customers;
`
## Changes
- Updated JSON_OBJECTAGG production in TSql170.g to optionally parse an OVER clause
- Enhanced SqlScriptGeneratorVisitor.FunctionCall.cs to generate the OVER clause in the output
- Added new baseline and test scripts (JsonObjectAggOverClause170.sql in both Baselines170 and TestScripts)
## Additional Information
No AST changes were needed -- FunctionCall.OverClause already exists in Ast.xml.
The grammar uses overClauseNoOrderBy (not overClause) since, like regular aggregates (e.g., SUM() OVER (...)), the ORDER BY within the OVER clause is not applicable for JSON_OBJECTAGG as a windowed aggregate.
All older parsers (80-160) produce 4 errors each (one per test statement) since the JSON_OBJECTAGG key:value syntax is not recognized pre-TSql170.
* [SECURITY] Bump dotnet-sdk from 8.0.415 to 8.0.418
* Fix: Make VECTOR_SEARCH TOP_N parameter optional and add WITH (FORCE_ANN_ONLY) support
## Summary
Fixes ScriptDOM parser to correctly handle optional `TOP_N` parameter and `WITH (FORCE_ANN_ONLY)` query hint in `VECTOR_SEARCH` syntax, aligning with SQL Server 2025 behavior.
## Changes
**Grammar (TSql170.g)**
- Made `TOP_N` parameter optional
- Added `WITH (FORCE_ANN_ONLY)` clause parsing
**AST & Script Generator**
- Added `ForceAnnOnly` boolean to `VectorSearchTableReference`
- Updated script generator for nullable `TOP_N` and `WITH` clause output
- Full round-trip fidelity maintained
**Tests**
- Added `VectorSearchOptionalTopNTests170.sql` (4 test scenarios)
- Removed obsolete error test expecting mandatory `TOP_N`
## Example Syntax Now Supported
```sql
-- Without TOP_N
SELECT * FROM VECTOR_SEARCH(...) AS ann
-- With query hint
SELECT * FROM VECTOR_SEARCH(...) WITH (FORCE_ANN_ONLY) AS ann
-- With TOP_N (backward compatible)
SELECT * FROM VECTOR_SEARCH(..., TOP_N = 10) AS ann
```
Backward compatible - No breaking changes.
* Simplifies CREATE/ALTER EXTERNAL DATA SOURCE syntax for Fabric DW
Simplifies CREATE/ALTER EXTERNAL DATA SOURCE syntax for Fabric DW to only support
the LOCATION parameter, removing support for TYPE, PUSHDOWN, and other literal/
identifier options in the Fabric DW parser.
Added positive and negative tests for this based on the specification.
* Adding release notes for 170.179.0
-**Exact syntax verification** (Exact T-SQL from user requests is tested precisely)
862
+
-**Round-trip fidelity validation** (Baseline preserves all input syntax unless documented)
811
863
812
864
Following these guidelines ensures robust test coverage for parser functionality and prevents regressions when adding new features or fixing bugs.
813
865
814
-
**Key Principle**: Always test the exact T-SQL syntax provided in user prompts or requests to verify that the specific syntax works as expected, rather than testing generalized or simplified versions of the syntax.
866
+
**Key Principles**:
867
+
1. Always test the exact T-SQL syntax provided in user prompts or requests
0 commit comments