akiyamaneko created SPARK-35205:
-----------------------------------

             Summary: Simplify 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


SImply the *getOperationType* method.
 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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to