Jackie-Jiang commented on code in PR #14452: URL: https://github.com/apache/pinot/pull/14452#discussion_r1887544770
########## pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java: ########## @@ -255,7 +255,14 @@ public static class Broker { public static final String CONFIG_OF_BROKER_QUERY_REWRITER_CLASS_NAMES = "pinot.broker.query.rewriter.class.names"; public static final String CONFIG_OF_BROKER_QUERY_RESPONSE_LIMIT = "pinot.broker.query.response.limit"; - public static final int DEFAULT_BROKER_QUERY_RESPONSE_LIMIT = Integer.MAX_VALUE; + public static final String CONFIG_OF_BROKER_DEFAULT_QUERY_LIMIT = + "pinot.broker.default.query.limit"; + + public static final int DEFAULT_BROKER_QUERY_LIMIT_OVERRIDE = Integer.MAX_VALUE; Review Comment: Let's keep the name consistent with config key, and make it next to `CONFIG_OF_BROKER_QUERY_RESPONSE_LIMIT` (i.e. keep line 258 unchanged) ########## pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java: ########## @@ -255,7 +255,14 @@ public static class Broker { public static final String CONFIG_OF_BROKER_QUERY_REWRITER_CLASS_NAMES = "pinot.broker.query.rewriter.class.names"; public static final String CONFIG_OF_BROKER_QUERY_RESPONSE_LIMIT = "pinot.broker.query.response.limit"; - public static final int DEFAULT_BROKER_QUERY_RESPONSE_LIMIT = Integer.MAX_VALUE; + public static final String CONFIG_OF_BROKER_DEFAULT_QUERY_LIMIT = + "pinot.broker.default.query.limit"; + + public static final int DEFAULT_BROKER_QUERY_LIMIT_OVERRIDE = Integer.MAX_VALUE; + + // -1 means no limit; value of 10 aligns limit with PinotQuery's defaults. Review Comment: I don't think v1 allows no limit. What is the behavior when limit is not set? ########## pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java: ########## @@ -140,7 +140,9 @@ public abstract class BaseSingleStageBrokerRequestHandler extends BaseBrokerRequ protected final int _defaultHllLog2m; protected final boolean _enableQueryLimitOverride; protected final boolean _enableDistinctCountBitmapOverride; - protected final int _queryResponseLimit; + protected final int _queryResponseLimitOverride; Review Comment: Let's keep the variable name unchanged. This is not only for override, but actually the cap of the allowed limit ########## pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java: ########## @@ -308,6 +313,10 @@ protected BrokerResponse handleRequest(long requestId, String query, SqlNodeAndO } } + if (isDefaultQueryResponseLimitEnabled() && !pinotQuery.isSetLimit()) { Review Comment: Will we ever hit this? In `PinotQuery` thrift definition, limit has a default value 10. Will limit always be set? -- 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