denis-ivanov / EntityFrameworkCore.ClickHouse

ClickHouse provider for Entity Framework Core.
https://clickhouse.tech/
23 stars 5 forks source link

Count is not working #31

Closed georgeemr closed 4 months ago

georgeemr commented 7 months ago

When you call Count, the next exception is thrown.

image

The table have more than 5 million records.

Tested on 0.0.13.

Appreciate your help.

denis-ivanov commented 6 months ago

Hi, @georgeemr !

Please, provide full example, with entities and db schema.

Eflarus commented 6 months ago

You can use typecast (Int64) or (long) to fix it like here

var query =
  from MyModel mm in _context.MyModels
  group mm by mm.Name into g
  select new { g.Key, Likes = (Int64)g.Sum(o => o.Likes) };