You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/05/01 18:24:00 UTC
[jira] [Work logged] (HIVE-27268) Hive.getPartitionsByNames should not enforce SessionState to be available
[ https://issues.apache.org/jira/browse/HIVE-27268?focusedWorklogId=859896&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-859896 ]
ASF GitHub Bot logged work on HIVE-27268:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/May/23 18:23
Start Date: 01/May/23 18:23
Worklog Time Spent: 10m
Work Description: saihemanth-cloudera commented on code in PR #4241:
URL: https://github.com/apache/hive/pull/4241#discussion_r1181779575
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java:
##########
@@ -1773,9 +1773,14 @@ public Table getTable(final String dbName, final String tableName, String metaTa
*/
private ValidWriteIdList getValidWriteIdList(String dbName, String tableName) throws LockException {
ValidWriteIdList validWriteIdList = null;
- long txnId = SessionState.get() != null && SessionState.get().getTxnMgr() != null ? SessionState.get().getTxnMgr().getCurrentTxnId() : 0;
+ SessionState sessionState = SessionState.get();
+ HiveTxnManager txnMgr = sessionState != null? sessionState.getTxnMgr() : null;
Review Comment:
Can you hack a unit test, to set the session state as null and then fetch get_partitions_by_names()?
Issue Time Tracking
-------------------
Worklog Id: (was: 859896)
Time Spent: 50m (was: 40m)
> Hive.getPartitionsByNames should not enforce SessionState to be available
> -------------------------------------------------------------------------
>
> Key: HIVE-27268
> URL: https://issues.apache.org/jira/browse/HIVE-27268
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Affects Versions: 3.1.3
> Reporter: Henri Biestro
> Priority: Minor
> Labels: pull-request-available
> Fix For: 4.0.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> HIVE-24743, HIVE-24392 is enforcing to check for valid write Id list for "Hive.getPartitionsByName".
> This breaks basic API integration. For a user who needs to get basic partition detail, he is forced to have SessionState.
> Request in this ticket is to ensure that if SessionState.get() is null, it should return empty validWriteIdList.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)