Commit a54bcd5
authored
Sync Repos: Release 170.179.0 (#192)
* 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.01 parent c6e10b2 commit a54bcd5
File tree
19 files changed
+334
-194
lines changed- .github/instructions
- SqlScriptDom
- Parser/TSql
- ScriptDom/SqlServer/ScriptGenerator
- Test/SqlDom
- Baselines170
- BaselinesFabricDW
- TestScripts
- release-notes/170
19 files changed
+334
-194
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
324 | 343 | | |
325 | 344 | | |
326 | 345 | | |
| |||
800 | 819 | | |
801 | 820 | | |
802 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
803 | 854 | | |
804 | 855 | | |
805 | 856 | | |
| |||
808 | 859 | | |
809 | 860 | | |
810 | 861 | | |
| 862 | + | |
811 | 863 | | |
812 | 864 | | |
813 | 865 | | |
814 | | - | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4808 | 4808 | | |
4809 | 4809 | | |
4810 | 4810 | | |
| 4811 | + | |
4811 | 4812 | | |
4812 | 4813 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19321 | 19321 | | |
19322 | 19322 | | |
19323 | 19323 | | |
19324 | | - | |
19325 | | - | |
19326 | | - | |
19327 | | - | |
19328 | | - | |
19329 | | - | |
| 19324 | + | |
| 19325 | + | |
| 19326 | + | |
19330 | 19327 | | |
19331 | | - | |
| 19328 | + | |
| 19329 | + | |
| 19330 | + | |
| 19331 | + | |
| 19332 | + | |
| 19333 | + | |
| 19334 | + | |
| 19335 | + | |
| 19336 | + | |
19332 | 19337 | | |
19333 | | - | |
19334 | | - | |
| 19338 | + | |
| 19339 | + | |
| 19340 | + | |
| 19341 | + | |
19335 | 19342 | | |
19336 | | - | |
| 19343 | + | |
| 19344 | + | |
| 19345 | + | |
| 19346 | + | |
| 19347 | + | |
| 19348 | + | |
| 19349 | + | |
| 19350 | + | |
| 19351 | + | |
| 19352 | + | |
19337 | 19353 | | |
19338 | 19354 | | |
19339 | 19355 | | |
| |||
33167 | 33183 | | |
33168 | 33184 | | |
33169 | 33185 | | |
| 33186 | + | |
33170 | 33187 | | |
33171 | 33188 | | |
33172 | 33189 | | |
| |||
33177 | 33194 | | |
33178 | 33195 | | |
33179 | 33196 | | |
| 33197 | + | |
| 33198 | + | |
| 33199 | + | |
| 33200 | + | |
| 33201 | + | |
| 33202 | + | |
33180 | 33203 | | |
33181 | 33204 | | |
33182 | 33205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23761 | 23761 | | |
23762 | 23762 | | |
23763 | 23763 | | |
23764 | | - | |
23765 | | - | |
23766 | 23764 | | |
23767 | 23765 | | |
23768 | 23766 | | |
| |||
23774 | 23772 | | |
23775 | 23773 | | |
23776 | 23774 | | |
23777 | | - | |
23778 | | - | |
23779 | | - | |
23780 | | - | |
23781 | | - | |
23782 | | - | |
23783 | | - | |
23784 | | - | |
23785 | | - | |
23786 | | - | |
23787 | | - | |
23788 | | - | |
23789 | | - | |
23790 | | - | |
23791 | | - | |
23792 | | - | |
23793 | 23775 | | |
23794 | | - | |
23795 | | - | |
23796 | | - | |
23797 | | - | |
23798 | | - | |
23799 | | - | |
23800 | | - | |
23801 | | - | |
23802 | | - | |
23803 | | - | |
23804 | | - | |
23805 | | - | |
23806 | | - | |
23807 | | - | |
23808 | | - | |
23809 | | - | |
23810 | | - | |
23811 | | - | |
23812 | | - | |
| 23776 | + | |
23813 | 23777 | | |
23814 | 23778 | | |
23815 | 23779 | | |
23816 | 23780 | | |
23817 | 23781 | | |
23818 | 23782 | | |
23819 | 23783 | | |
23820 | | - | |
23821 | | - | |
23822 | | - | |
23823 | | - | |
23824 | | - | |
23825 | | - | |
23826 | | - | |
23827 | | - | |
23828 | | - | |
23829 | | - | |
23830 | | - | |
23831 | | - | |
23832 | | - | |
23833 | | - | |
23834 | | - | |
23835 | | - | |
23836 | | - | |
23837 | | - | |
23838 | | - | |
23839 | | - | |
23840 | | - | |
23841 | | - | |
23842 | | - | |
23843 | | - | |
23844 | | - | |
23845 | | - | |
23846 | | - | |
23847 | | - | |
23848 | | - | |
23849 | | - | |
23850 | | - | |
23851 | | - | |
23852 | | - | |
23853 | | - | |
23854 | | - | |
23855 | | - | |
23856 | | - | |
23857 | | - | |
23858 | | - | |
23859 | 23784 | | |
23860 | 23785 | | |
23861 | 23786 | | |
| |||
23868 | 23793 | | |
23869 | 23794 | | |
23870 | 23795 | | |
23871 | | - | |
23872 | | - | |
23873 | | - | |
23874 | | - | |
23875 | | - | |
23876 | | - | |
23877 | | - | |
23878 | | - | |
23879 | | - | |
23880 | | - | |
23881 | | - | |
23882 | | - | |
23883 | | - | |
23884 | | - | |
23885 | | - | |
23886 | | - | |
23887 | | - | |
23888 | | - | |
23889 | | - | |
23890 | | - | |
23891 | | - | |
23892 | | - | |
23893 | | - | |
23894 | | - | |
23895 | | - | |
23896 | | - | |
23897 | | - | |
23898 | | - | |
23899 | | - | |
23900 | | - | |
23901 | | - | |
23902 | | - | |
23903 | | - | |
23904 | | - | |
23905 | | - | |
23906 | | - | |
23907 | | - | |
23908 | | - | |
23909 | | - | |
23910 | | - | |
23911 | | - | |
23912 | | - | |
23913 | | - | |
23914 | | - | |
23915 | | - | |
23916 | | - | |
23917 | | - | |
23918 | | - | |
23919 | | - | |
23920 | | - | |
23921 | | - | |
23922 | | - | |
23923 | | - | |
23924 | | - | |
23925 | | - | |
23926 | | - | |
23927 | | - | |
23928 | 23796 | | |
23929 | 23797 | | |
23930 | 23798 | | |
23931 | | - | |
23932 | | - | |
23933 | 23799 | | |
23934 | 23800 | | |
23935 | 23801 | | |
| |||
23940 | 23806 | | |
23941 | 23807 | | |
23942 | 23808 | | |
23943 | | - | |
23944 | | - | |
23945 | | - | |
23946 | | - | |
23947 | | - | |
23948 | | - | |
23949 | | - | |
23950 | | - | |
23951 | | - | |
23952 | | - | |
23953 | | - | |
23954 | | - | |
23955 | | - | |
23956 | 23809 | | |
23957 | | - | |
23958 | | - | |
23959 | | - | |
23960 | | - | |
23961 | | - | |
23962 | | - | |
23963 | | - | |
23964 | | - | |
23965 | | - | |
23966 | | - | |
23967 | | - | |
23968 | | - | |
23969 | | - | |
23970 | | - | |
23971 | | - | |
23972 | | - | |
| 23810 | + | |
23973 | 23811 | | |
23974 | 23812 | | |
23975 | 23813 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
0 commit comments