You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/07/10 10:27:28 UTC

[incubator-iotdb] branch master updated: check fetch size in query

This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new f80c7c3  check fetch size in query
f80c7c3 is described below

commit f80c7c3d626b98dce193c9fdf92058c009042fa5
Author: qiaojialin <64...@qq.com>
AuthorDate: Fri Jul 10 11:33:59 2020 +0800

    check fetch size in query
---
 server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index dcbbc36..3721d5a 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -142,6 +142,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
   private static final int MAX_SIZE =
       IoTDBDescriptor.getInstance().getConfig().getQueryCacheSizeInMetric();
   private static final int DELETE_SIZE = 20;
+  private static final int FETCH_SIZE = 10000;
   private static final String ERROR_PARSING_SQL =
       "meet error while parsing SQL to physical plan: {}";
   private static final List<SqlArgument> sqlArgumentList = new ArrayList<>(MAX_SIZE);
@@ -553,6 +554,11 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
     try {
       TSExecuteStatementResp resp = getQueryResp(plan, username); // column headers
 
+      // In case users forget to set this field in query, use the default value
+      if (fetchSize == 0) {
+        fetchSize = FETCH_SIZE;
+      }
+
       if (plan instanceof ShowTimeSeriesPlan) {
         //If the user does not pass the limit, then set limit = fetchSize and haslimit=false,else set haslimit = true
         if (((ShowTimeSeriesPlan) plan).getLimit() == 0) {