yashmayya commented on code in PR #14452:
URL: https://github.com/apache/pinot/pull/14452#discussion_r1853704897


##########
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:
   Could we instead keep the default value for 
`pinot.broker.default.query.response.limit` as 10 and avoid this "enabled" 
check? Basically we'd then simply set the query limit to whatever the value of 
the config is (when there's no explicit limit set in the query).



##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java:
##########
@@ -254,7 +254,11 @@ 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_RESPONSE_LIMIT =
+        "pinot.broker.default.query.response.limit";

Review Comment:
   What do you think about naming this `pinot.broker.default.query.limit` 
instead? I know that this isn't exactly aligned with the other config name but 
I agree with you in that it seems poorly named (both the "response" aspect and 
the fact that it doesn't state that it's an override) and it's fine if we don't 
stick to the same pattern.



##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BrokerQueryLimitTest.java:
##########
@@ -0,0 +1,189 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.collect.ImmutableList;
+import java.io.File;
+import org.apache.avro.file.DataFileWriter;
+import org.apache.avro.generic.GenericData;
+import org.apache.avro.generic.GenericDatumWriter;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableType;
+import org.apache.pinot.spi.data.FieldSpec;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.CommonConstants;
+import org.apache.pinot.spi.utils.builder.ControllerRequestURLBuilder;
+import org.apache.pinot.spi.utils.builder.TableConfigBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.*;
+
+
+// this test uses separate cluster because it needs to change broker 
configuration
+// which is only done once per suite
+public class BrokerQueryLimitTest extends BaseClusterIntegrationTest {

Review Comment:
   Do we really need an entire integration test suite for this? Seems a little 
heavyweight especially considering Pinot's integration tests have a fairly 
significant setup time / cost associated with them. We might be okay with 
simple unit tests for this instead.



-- 
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

Reply via email to