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
{{ message }}
Repository navigation
Allow table-valued functions to accept non-scalar parameters #37535
Our TableValuedExpression currently accepts scalar parameters only (SqlExpression). However, we have some cases where we need to pass non-scalars. For example, SQL Server's VECTOR_DISTANCE() accepts a table expression - including alias:
SELECT TOP (10) s.id,
s.title,
r.distanceFROM VECTOR_SEARCH(
TABLE =dbo.sessionsAS s,
COLUMN = embedding,
SIMILAR_TO = @qv,
METRIC ='cosine',
TOP_N =10
) AS r
WHERE accepted =1ORDER BYr.distance;
SELECTFT_TBL.Description
,KEY_TBL.RANKFROMProduction.ProductDescriptionAS FT_TBL
INNER JOIN FREETEXTTABLE(Production.ProductDescription,
Description,
'high level of performance',
LANGUAGE N'English', 2) AS KEY_TBL
ONFT_TBL.ProductDescriptionID= KEY_TBL.[KEY]
ORDER BY RANK DESC;
Outside of SQL Server usage is probably quite limited; PostgreSQL has json_populate_recordset(), which accepts any record/composite type. Though it's unclear as of yet whether these would be considered scalars or not, If/when we implement support for records/composites.
In any case, there seems to be no harm in relaxing the parameter type; note that any code currently passing SqlExpression continues to work - we've just relaxed the accepted parameter type (this is potentially a provider-facing binary break, but very low-impact).
Activity
WIP
WIP
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch()
Implement support for SQL Server VectorSearch() (dotnet#37536)