scarlin-cloudera commented on a change in pull request #2841:
URL: https://github.com/apache/hive/pull/2841#discussion_r766025515
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
##########
@@ -2206,31 +2201,21 @@ public String getNewSparkSessionId() {
return getSessionId() + "_" +
Long.toString(this.sparkSessionId.getAndIncrement());
}
- /**
- * Can be called when we start compilation of a query.
- * @param queryId the unique identifier of the query
- */
- public void startScope(String queryId) {
- Map<Object, Object> existingVal = cache.put(queryId, new HashMap<>());
- Preconditions.checkState(existingVal == null);
- }
-
- /**
- * Can be called when we end compilation of a query.
- * @param queryId the unique identifier of the query
- */
- public void endScope(String queryId) {
- Map<Object, Object> existingVal = cache.remove(queryId);
- Preconditions.checkState(existingVal != null);
- }
-
/**
* Retrieves the query cache for the given query.
* @param queryId the unique identifier of the query
* @return the cache for the query
*/
public Map<Object, Object> getQueryCache(String queryId) {
- return cache.get(queryId);
+ QueryState qs = getQueryState(queryId);
+ if (qs == null) {
+ return null;
+ }
+
+ if (qs == null) {
Review comment:
Duplicated code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]