This is an automated email from the ASF dual-hosted git repository. dmollitor pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push: new 804bf60 HIVE-23007: Do Not Consider Client Session For Default Fetch Size (David Mollitor reviewed by Naveen Gangam) 804bf60 is described below commit 804bf60e6f6b363297855804c9351c80299b9280 Author: David Mollitor <dmolli...@apache.org> AuthorDate: Fri Mar 27 12:01:19 2020 -0400 HIVE-23007: Do Not Consider Client Session For Default Fetch Size (David Mollitor reviewed by Naveen Gangam) --- .../hive/service/cli/thrift/ThriftCLIService.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java index a7fe049..6f8ad00 100644 --- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -28,7 +28,7 @@ import org.apache.hive.service.rpc.thrift.TSetClientInfoResp; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; -import java.util.HashMap; +import java.util.Collections; import java.util.Map; import java.util.concurrent.TimeUnit; import javax.security.auth.login.LoginException; @@ -321,17 +321,14 @@ public abstract class ThriftCLIService extends AbstractService implements TCLISe LOG.info("Client protocol version: " + req.getClient_protocol()); TOpenSessionResp resp = new TOpenSessionResp(); try { - SessionHandle sessionHandle = getSessionHandle(req, resp); + final SessionHandle sessionHandle = getSessionHandle(req, resp); + + final int fetchSize = hiveConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_RESULTSET_DEFAULT_FETCH_SIZE); + resp.setSessionHandle(sessionHandle.toTSessionHandle()); - Map<String, String> configurationMap = new HashMap<String, String>(); - // Set the updated fetch size from the server into the configuration map for the client - HiveConf sessionConf = cliService.getSessionConf(sessionHandle); - configurationMap.put( - HiveConf.ConfVars.HIVE_SERVER2_THRIFT_RESULTSET_DEFAULT_FETCH_SIZE.varname, - Integer.toString(sessionConf != null ? - sessionConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_RESULTSET_DEFAULT_FETCH_SIZE) : - hiveConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_RESULTSET_DEFAULT_FETCH_SIZE))); - resp.setConfiguration(configurationMap); + resp.setConfiguration(Collections + .singletonMap(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_RESULTSET_DEFAULT_FETCH_SIZE.varname, + Integer.toString(fetchSize))); resp.setStatus(OK_STATUS); ThriftCLIServerContext context = (ThriftCLIServerContext)currentServerContext.get();