FAQ
Author: hashutosh
Date: Wed Sep 3 20:52:20 2014
New Revision: 1622355

URL: http://svn.apache.org/r1622355
Log:
HIVE-7944 : current update stats for columns of a partition of a table is not correct (Pengcheng Xiong via Ashutosh Chauhan)

Modified:
     hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
     hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
     hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java
     hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java
     hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=1622355&r1=1622354&r2=1622355&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Wed Sep 3 20:52:20 2014
@@ -3721,19 +3721,6 @@ public class HiveMetaStore extends Thrif
          endFunction("write_partition_column_statistics: ", ret != false, null, tableName);
        }
      }
- public boolean update_partition_column_statistics(
- SetPartitionsStatsRequest request) throws NoSuchObjectException,
- InvalidObjectException, MetaException, TException,
- InvalidInputException {
- boolean ret = false;
- try {
- ret = getMS().updatePartitionColumnStatistics(request);
- return ret;
- } finally {
- endFunction("write_partition_column_statistics: ", ret != false, null,
- null);
- }
- }

      @Override
      public boolean delete_partition_column_statistics(String dbName, String tableName,
@@ -5058,9 +5045,13 @@ public class HiveMetaStore extends Thrif

      @Override
      public boolean set_aggr_stats_for(SetPartitionsStatsRequest request)
- throws NoSuchObjectException, InvalidObjectException, MetaException,
- InvalidInputException, TException {
- return update_partition_column_statistics(request);
+ throws NoSuchObjectException, InvalidObjectException, MetaException, InvalidInputException,
+ TException {
+ boolean ret = true;
+ for (ColumnStatistics colStats : request.getColStats()) {
+ ret = ret && update_partition_column_statistics(colStats);
+ }
+ return ret;
      }
    }


Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java?rev=1622355&r1=1622354&r2=1622355&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java Wed Sep 3 20:52:20 2014
@@ -5779,34 +5779,6 @@ public class ObjectStore implements RawS
      }
    }

- @Override
- public boolean updatePartitionColumnStatistics(SetPartitionsStatsRequest request)
- throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException {
- boolean committed = false;
- try {
- openTransaction();
- for (ColumnStatistics colStats : request.getColStats()) {
- ColumnStatisticsDesc statsDesc = colStats.getStatsDesc();
- statsDesc.setDbName(statsDesc.getDbName().toLowerCase());
- statsDesc.setTableName(statsDesc.getTableName().toLowerCase());
- List<ColumnStatisticsObj> statsObjs = colStats.getStatsObj();
- for (ColumnStatisticsObj statsObj : statsObjs) {
- statsObj.setColName(statsObj.getColName().toLowerCase());
- statsObj.setColType(statsObj.getColType().toLowerCase());
- MPartitionColumnStatistics mStatsObj = StatObjectConverter
- .convertToMPartitionColumnStatistics(null, statsDesc, statsObj);
- pm.makePersistent(mStatsObj);
- }
- }
- committed = commitTransaction();
- return committed;
- } finally {
- if (!committed) {
- rollbackTransaction();
- }
- }
- }
-
    private List<MTableColumnStatistics> getMTableColumnStatistics(
        Table table, List<String> colNames) throws MetaException {
      boolean committed = false;

Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java?rev=1622355&r1=1622354&r2=1622355&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java Wed Sep 3 20:52:20 2014
@@ -552,8 +552,5 @@ public interface RawStore extends Config

    public AggrStats get_aggr_stats_for(String dbName, String tblName,
      List<String> partNames, List<String> colNames) throws MetaException, NoSuchObjectException;
-
- boolean updatePartitionColumnStatistics(
- SetPartitionsStatsRequest request) throws NoSuchObjectException,
- MetaException, InvalidObjectException, InvalidInputException;
+
  }

Modified: hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java?rev=1622355&r1=1622354&r2=1622355&view=diff
==============================================================================
--- hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java (original)
+++ hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java Wed Sep 3 20:52:20 2014
@@ -720,10 +720,4 @@ public class DummyRawStoreControlledComm
      return null;
    }

- @Override
- public boolean updatePartitionColumnStatistics(SetPartitionsStatsRequest request)
- throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException {
- return objectStore.updatePartitionColumnStatistics(request);
- }
-
  }

Modified: hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java?rev=1622355&r1=1622354&r2=1622355&view=diff
==============================================================================
--- hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java (original)
+++ hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java Wed Sep 3 20:52:20 2014
@@ -736,12 +736,7 @@ public class DummyRawStoreForJdoConnecti
        throws MetaException {
      return null;
    }
-
- @Override
- public boolean updatePartitionColumnStatistics(SetPartitionsStatsRequest request)
- throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException {
- return false;
- }
+
  }

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedSep 3, '14 at 8:52p
activeSep 3, '14 at 8:52p
posts1
users1
websitehive.apache.org

1 user in discussion

Hashutosh: 1 post

People

Translate

site design / logo © 2021 Grokbase