walterddr commented on issue #10318: URL: https://github.com/apache/pinot/issues/10318#issuecomment-1450432071
It is possible to mimic Postgres behavior. Calcite RelDataTypeFactory has precision and scale associated with each numeric type. we can apply the function as above with several caveats see https://github.com/apache/calcite/blob/2dba40e7a0a5651eac5a30d9e0a72f178bd9bff2/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java#L562-L587 1. for all the precision and scale factors listed --> we round up to the nearest associated Pinot type. - according to calcite: INTEGER(10, 0) and BIGINT(38, 0), FLOAT(14, 7), DOUBLE(30, 15), - for example: so if our scale calculation results in a (12, 2) --> this matches to FLOAT 2. we don't need to exactly compute the ceil(log10(count()), we can use the table size to estimate given that the scale differences are so large between 2 pinot data types -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org