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

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

                Author: ASF GitHub Bot
            Created on: 15/Feb/22 18:59
            Start Date: 15/Feb/22 18:59
    Worklog Time Spent: 10m 
      Work Description: soumyakanti3578 commented on a change in pull request 
#3020:
URL: https://github.com/apache/hive/pull/3020#discussion_r806091142



##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientWithLocalCache.java
##########
@@ -493,6 +495,32 @@ protected GetPartitionsByNamesResult 
getPartitionsByNamesInternal(GetPartitionsB
     return super.getPartitionsByNamesInternal(rqst);
   }
 
+  @Override
+  public void alter_partitions(String catName, String dbName, String tblName, 
List<Partition> newParts,
+                               EnvironmentContext environmentContext, String 
writeIdList, long writeId)
+          throws TException {
+    super.alter_partitions(catName, dbName, tblName, newParts, 
environmentContext, writeIdList, writeId);
+
+    if (!isCacheEnabledAndInitialized() || mscLocalCache == null) {
+      return;
+    }
+
+    // invalidate cached Partition entries
+    List<String> processorCapabilitiesList = getProcessorCapabilities() == 
null ?
+            null : new ArrayList<>(Arrays.asList(getProcessorCapabilities()));

Review comment:
       Is it better to call `getProcessorCapabilities()` just once?

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientWithLocalCache.java
##########
@@ -493,6 +495,32 @@ protected GetPartitionsByNamesResult 
getPartitionsByNamesInternal(GetPartitionsB
     return super.getPartitionsByNamesInternal(rqst);
   }
 
+  @Override
+  public void alter_partitions(String catName, String dbName, String tblName, 
List<Partition> newParts,
+                               EnvironmentContext environmentContext, String 
writeIdList, long writeId)
+          throws TException {
+    super.alter_partitions(catName, dbName, tblName, newParts, 
environmentContext, writeIdList, writeId);
+
+    if (!isCacheEnabledAndInitialized() || mscLocalCache == null) {
+      return;
+    }
+
+    // invalidate cached Partition entries
+    List<String> processorCapabilitiesList = getProcessorCapabilities() == 
null ?
+            null : new ArrayList<>(Arrays.asList(getProcessorCapabilities()));
+
+    TableWatermark watermark = new TableWatermark(writeIdList, 
getTable(dbName, tblName).getId());
+    dbName =prependCatalogToDbName(catName, dbName, conf);

Review comment:
       Small change, need a space after `=`.




-- 
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]


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

    Worklog Id:     (was: 727532)
    Time Spent: 3h 10m  (was: 3h)

> 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
>              Labels: pull-request-available
>          Time Spent: 3h 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