asolimando commented on code in PR #5390:
URL: https://github.com/apache/calcite/pull/5390#discussion_r4474231454
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java:
##########
@@ -306,6 +306,12 @@ protected RelMdSize() {}
* is nullable.
*/
public @Nullable Double averageTypeValueSize(RelDataType type) {
+ if (type.getPrecision() == RelDataType.PRECISION_NOT_SPECIFIED
+ && SqlTypeUtil.inCharOrBinaryFamilies(type)) {
+ // Use a default estimate for unspecified precision, matching the
+ // cap used for large VARCHAR and VARBINARY types
+ return 100d;
Review Comment:
Yes, it appears in three places now, it's better as a constant. I have
optimistically squashed and force-pushed in 51ffa9459 since the change is
minimal and it shouldn't be controversial.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]