Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change data types for aggregate columns #483

Open
3 tasks
Grauenwolf opened this issue Jul 9, 2022 · 0 comments
Open
3 tasks

Change data types for aggregate columns #483

Grauenwolf opened this issue Jul 9, 2022 · 0 comments

Comments

@Grauenwolf
Copy link
Collaborator

Grauenwolf commented Jul 9, 2022

Say you have this aggregate.

SELECT AVG([EmployeeKey]) AS [EmployeeKey] FROM [HR].[Employee];

With enough rows, that will overflow an int.

We need an option to emit this instead:

SELECT AVG( CONVERT(real, [EmployeeKey])) AS [EmployeeKey] FROM [HR].[Employee];


  • New type called NumericDbType. This is a subset of the built-in DbType enum.
  • DatabaseMetadataCache.ToSqlType(NumericDbType, int?, int?) method that will generate a database-specific type string with optional precision and scale.
  • Add init properties named NumericDbType, Precision, and Scale to AggregateColumn. These will be used in the BuildSelectClause method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant