[
https://issues.apache.org/jira/browse/HIVE-25402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
lvyankui updated HIVE-25402:
----------------------------
Attachment: HIVE-25402.patch
> When Hive client has multiple statements without close. queryIdOperation in
> OperationManager class will exist object that cannot be released
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HIVE-25402
> URL: https://issues.apache.org/jira/browse/HIVE-25402
> Project: Hive
> Issue Type: Bug
> Components: HiveServer2
> Affects Versions: All Versions
> Reporter: lvyankui
> Priority: Major
> Attachments: HIVE-25402.patch
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Hive client code has multiple statements without close
> connect = DriverManager.getConnection(jdbcUrl, user, password);
> PrintWriter pw = new PrintWriter("/tmp/hive.result" );
> Statement stmt = connect.createStatement();
> Statement stmt1 = connect.createStatement();
> Statement stmt2 = connect.createStatement();
> String sql = "select * from test";
> runSQL(stmt, sql, pw);
> runSQL(stmt1, sql, pw);
> runSQL(stmt2, sql, pw);
>
> OperationManager removeOperation method
> private Operation removeOperation(OperationHandle opHandle) {
> Operation operation = handleToOperation.remove(opHandle);
> if (operation == null) {
> throw new RuntimeException("Operation does not exist: " + opHandle);
> }
> String queryId = getQueryId(operation);
> *queryIdOperation.remove(queryId);*
>
> The key of queryIdOperation is queryIdOperation is queryId, queryId is
> getted from HiveConf. A new queryId will be generated when a new queryPlan is
> generated and set it into HiveConf. If Hive client code has multiple
> statements without close, when sqls execute complete, queryIdOperation can
> only release the object whose queryId is last generated,other object cannot
> be released.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)