[ https://issues.apache.org/jira/browse/HIVE-8459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alan Gates updated HIVE-8459: ----------------------------- Description: Queries and operations on partitioned tables are generating locks on the whole table when they should only be locking the partition. For example: {code} select count(*) from concur_orc_tab_part where ds = 'today'; {code} This should only be locking the partition ds='today'. But instead: {code} mysql> select * from HIVE_LOCKS; +----------------+----------------+----------+---------+---------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ | HL_LOCK_EXT_ID | HL_LOCK_INT_ID | HL_TXNID | HL_DB | HL_TABLE | HL_PARTITION | HL_LOCK_STATE | HL_LOCK_TYPE | HL_LAST_HEARTBEAT | HL_ACQUIRED_AT | HL_USER | HL_HOST | +----------------+----------------+----------+---------+---------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ | 428 | 1 | 0 | default | concur_orc_tab_part | NULL | a | r | 1413311172000 | 1413311171000 | hive | node-1.example.com | | 428 | 2 | 0 | default | concur_orc_tab_part | ds=today | a | r | 1413311172000 | 1413311171000 | hive | node-1.example.com | +----------------+----------------+----------+---------+---------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ {code} was: Queries and operations on partitioned tables are generating locks on the whole table when they should only be locking the partition. For example: {code} insert into table concur_orc_tab_part partition (ds='today') values ('fred flintstone', 43, 1.95); {code} This should only be locking the partition ds='today'. But instead: {code} mysql> select * from HIVE_LOCKS; +----------------+----------------+----------+---------+-----------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ | HL_LOCK_EXT_ID | HL_LOCK_INT_ID | HL_TXNID | HL_DB | HL_TABLE | HL_PARTITION | HL_LOCK_STATE | HL_LOCK_TYPE | HL_LAST_HEARTBEAT | HL_ACQUIRED_AT | HL_USER | HL_HOST | +----------------+----------------+----------+---------+-----------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ | 425 | 1 | 204 | default | values__tmp__table__1 | NULL | a | r | 1413310740000 | 1413310738000 | hive | node-1.example.com | | 425 | 2 | 204 | default | concur_orc_tab_part | ds=today | a | r | 1413310740000 | 1413310738000 | hive | node-1.example.com | +----------------+----------------+----------+---------+-----------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ {code} > DbLockManager locking table in addition to partitions > ----------------------------------------------------- > > Key: HIVE-8459 > URL: https://issues.apache.org/jira/browse/HIVE-8459 > Project: Hive > Issue Type: Bug > Components: Locking > Affects Versions: 0.14.0 > Reporter: Alan Gates > Assignee: Alan Gates > Priority: Critical > > Queries and operations on partitioned tables are generating locks on the > whole table when they should only be locking the partition. For example: > {code} > select count(*) from concur_orc_tab_part where ds = 'today'; > {code} > This should only be locking the partition ds='today'. But instead: > {code} > mysql> select * from HIVE_LOCKS; > +----------------+----------------+----------+---------+---------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ > | HL_LOCK_EXT_ID | HL_LOCK_INT_ID | HL_TXNID | HL_DB | HL_TABLE > | HL_PARTITION | HL_LOCK_STATE | HL_LOCK_TYPE | HL_LAST_HEARTBEAT | > HL_ACQUIRED_AT | HL_USER | HL_HOST | > +----------------+----------------+----------+---------+---------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ > | 428 | 1 | 0 | default | concur_orc_tab_part > | NULL | a | r | 1413311172000 | > 1413311171000 | hive | node-1.example.com | > | 428 | 2 | 0 | default | concur_orc_tab_part > | ds=today | a | r | 1413311172000 | > 1413311171000 | hive | node-1.example.com | > +----------------+----------------+----------+---------+---------------------+--------------+---------------+--------------+-------------------+----------------+---------+--------------------+ > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)