You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "akiyamaneko (Jira)" <ji...@apache.org> on 2021/04/23 10:33:00 UTC

[jira] [Updated] (SPARK-35205) Refractor org.apache.hive.service.cli.OperationType.getOperationType by using a hashMap.

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

akiyamaneko updated SPARK-35205:
--------------------------------
    Summary: Refractor org.apache.hive.service.cli.OperationType.getOperationType by using a hashMap.  (was: Simplify org.apache.hive.service.cli.OperationType.getOperationType by using a hashMap.)

> Refractor org.apache.hive.service.cli.OperationType.getOperationType by using a hashMap.
> ----------------------------------------------------------------------------------------
>
>                 Key: SPARK-35205
>                 URL: https://issues.apache.org/jira/browse/SPARK-35205
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.1
>            Reporter: akiyamaneko
>            Priority: Minor
>
> SImply the *getOperationType* method in `org.apache.hive.service.cli.OperationType`.
>  Introduce a *HashMap* to cache the existed enumeration types, so as to avoid a linear search in a for loop.
>  `*OperationType.getOperationType*` can be called in OperationHandler.constructor:
>  
> {code:java}
>  
> public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) {
>   super(tOperationHandle.getOperationId());
>   this.opType = OperationType.getOperationType(tOperationHandle.getOperationType());
>   this.hasResultSet = tOperationHandle.isHasResultSet();
>   this.protocol = protocol;
> }
>  
> {code}
> `*OperationHandle* ` is widely used, It's better to improve the execution efficiency of `OperationType.getOperationType`



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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