When I run the following against a Calcite connection containing the PostgreSQL 
"dvdstore" sample database:

  select avg(products.price) from dvdstore.products group by products.category

The following SQL is executed on the server:

  SELECT CAST(SUM("price") / COUNT(*) AS DECIMAL(19, 0)) FROM "products" GROUP 
BY “category"

Is there some way I can prevent Calcite from rounding it (price is a decimal 
type)? Is there some reason it isn’t just sending the aggregate as an AVG?

        -Marc

Reply via email to