yashmayya commented on code in PR #15263: URL: https://github.com/apache/pinot/pull/15263#discussion_r2002493528
########## pinot-query-planner/src/main/java/org/apache/pinot/query/type/TypeSystem.java: ########## @@ -62,16 +62,36 @@ public boolean shouldConvertRaggedUnionTypesToVarying() { return true; } + @Override + public int getMaxScale(SqlTypeName typeName) { + return typeName == SqlTypeName.DECIMAL ? MAX_DECIMAL_SCALE : super.getMaxScale(typeName); + } + @Override public int getMaxNumericScale() { return MAX_DECIMAL_SCALE; } + @Override + public int getDefaultScale(SqlTypeName typeName) { + return typeName == SqlTypeName.DECIMAL ? MAX_DECIMAL_SCALE : super.getDefaultScale(typeName); + } + + @Override + public int getMaxPrecision(SqlTypeName typeName) { + return typeName == SqlTypeName.DECIMAL ? MAX_DECIMAL_PRECISION : super.getMaxPrecision(typeName); + } + @Override public int getMaxNumericPrecision() { return MAX_DECIMAL_PRECISION; } + @Override + public int getDefaultPrecision(SqlTypeName typeName) { + return typeName == SqlTypeName.DECIMAL ? MAX_DECIMAL_PRECISION : super.getDefaultPrecision(typeName); Review Comment: Btw our default here is actually `DECIMAL(1000, 1000)` - precision of 1000, and scale of 1000. `DECIMAL(1000, 2000)` is impossible because scale can never be larger than precision. Our default means that we can have a total of 1000 significant digits, but also up to 1000 digits after the decimal. We don't allow specifying precision and scale for our `BIG_DECIMAL` columns and FWIW Postgres also allows `NUMERIC` without explicit precision and scale to mean an "unconstrained" numeric - https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL. Postgres also supports a maximum specified precision of 1000 (and scale can be between -1000 to 1000). -- 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