You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2019/07/15 14:37:00 UTC

[jira] [Resolved] (SPARK-28311) Spark Thrift Server protocol version compatibility setup too late

     [ https://issues.apache.org/jira/browse/SPARK-28311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen resolved SPARK-28311.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.0

Issue resolved by pull request 25083
[https://github.com/apache/spark/pull/25083]

> Spark Thrift Server protocol version compatibility setup too late 
> ------------------------------------------------------------------
>
>                 Key: SPARK-28311
>                 URL: https://issues.apache.org/jira/browse/SPARK-28311
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.6.0, 2.3.0, 2.4.0
>            Reporter: angerszhu
>            Assignee: angerszhu
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> {code:java}
> SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res)
>     throws HiveSQLException, LoginException, IOException {
>   String userName = getUserName(req);
>   String ipAddress = getIpAddress();
>   TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION,
>       req.getClient_protocol());
>   SessionHandle sessionHandle;
>   if (cliService.getHiveConf().getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) &&
>       (userName != null)) {
>     String delegationTokenStr = getDelegationToken(userName);
>     sessionHandle = cliService.openSessionWithImpersonation(protocol, userName,
>         req.getPassword(), ipAddress, req.getConfiguration(), delegationTokenStr);
>   } else {
>     sessionHandle = cliService.openSession(protocol, userName, req.getPassword(),
>         ipAddress, req.getConfiguration());
>   }
>   res.setServerProtocolVersion(protocol);
>   return sessionHandle;
> }
> {code}
> When we use V7 to connect V8 , getMinVersion will get  adapted protocol version. but  #setServerProtocolVersion() is too late, isf it have error when openSession, it will return origin V8 protocol version, it's not reasonable 
> {code:java}
>  res.setServerProtocolVersion(protocol);{code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org