[ 
https://issues.apache.org/jira/browse/HIVE-25918?focusedWorklogId=718834&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-718834
 ]

ASF GitHub Bot logged work on HIVE-25918:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Feb/22 17:07
            Start Date: 01/Feb/22 17:07
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request #2991:
URL: https://github.com/apache/hive/pull/2991


   ### What changes were proposed in this pull request?
   When inserting into partitioned tables the list of affected partitions are 
provided by Dynamic partitioning when updating Statistics. Reload the Partition 
objects from HMS when `BasicStatsTask` gets them.
   
   ### Why are the changes needed?
   All write branches/entities of sql statements has its own `BasicStatsTask` 
instance which updates the stats of the partition when the statement finished 
execution. The Tasks are executed sequentially however the state of partitions 
were loaded only once from metastore by Dynamic partitioning so each 
`BasicStatsTask` updated the same staring state.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. Incorrect results are fixed.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -DskipSparkTests 
-Dtest=TestMiniLlapLocalCliDriver -Dqfile=stats_part_multi_insert.q -pl 
itests/qtest -Pitests
   ```


-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 718834)
    Remaining Estimate: 0h
            Time Spent: 10m

> Invalid stats after multi inserting into the same partition
> -----------------------------------------------------------
>
>                 Key: HIVE-25918
>                 URL: https://issues.apache.org/jira/browse/HIVE-25918
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Statistics
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code}
> create table source(p int, key int,value string);
> insert into source(p, key, value) values (101,42,'string42');
> create table stats_part(key int,value string) partitioned by (p int);
> from source
> insert into stats_part select key, value, p
> insert into stats_part select key, value, p;
> select count(*) from stats_part;
> {code}
> In this case {{StatsOptimizer}} helps serving this query because the result 
> should be {{rowNum}} of the partition {{p=101}}. The result is
> {code}
> 1
> {code}
> however it shloud be
> {code}
> 2
> {code}
> because both insert branches inserts 1-1 records.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to