Examples of MPartitionColumnStatistics


Examples of org.apache.hadoop.hive.metastore.model.MPartitionColumnStatistics

    if (partition == null) {
      throw new NoSuchObjectException("Partition for which stats is gathered doesn't exist.");
    }

    MPartitionColumnStatistics mColStats = new MPartitionColumnStatistics();
    mColStats.setPartition(partition);
    mColStats.setDbName(statsDesc.getDbName());
    mColStats.setTableName(statsDesc.getTableName());
    mColStats.setPartitionName(statsDesc.getPartName());
    mColStats.setLastAnalyzed(statsDesc.getLastAnalyzed());
    mColStats.setColName(statsObj.getColName());
    mColStats.setColType(statsObj.getColType());

    if (statsObj.getStatsData().isSetBooleanStats()) {
      BooleanColumnStatsData boolStats = statsObj.getStatsData().getBooleanStats();
      mColStats.setBooleanStats(boolStats.getNumTrues(), boolStats.getNumFalses(),
          boolStats.getNumNulls());
    } else if (statsObj.getStatsData().isSetLongStats()) {
      LongColumnStatsData longStats = statsObj.getStatsData().getLongStats();
      mColStats.setLongStats(longStats.getNumNulls(), longStats.getNumDVs(),
          longStats.getLowValue(), longStats.getHighValue());
    } else if (statsObj.getStatsData().isSetDoubleStats()) {
      DoubleColumnStatsData doubleStats = statsObj.getStatsData().getDoubleStats();
      mColStats.setDoubleStats(doubleStats.getNumNulls(), doubleStats.getNumDVs(),
          doubleStats.getLowValue(), doubleStats.getHighValue());
    } else if (statsObj.getStatsData().isSetStringStats()) {
      StringColumnStatsData stringStats = statsObj.getStatsData().getStringStats();
      mColStats.setStringStats(stringStats.getNumNulls(), stringStats.getNumDVs(),
        stringStats.getMaxColLen(), stringStats.getAvgColLen());
    } else if (statsObj.getStatsData().isSetBinaryStats()) {
      BinaryColumnStatsData binaryStats = statsObj.getStatsData().getBinaryStats();
      mColStats.setBinaryStats(binaryStats.getNumNulls(), binaryStats.getMaxColLen(),
        binaryStats.getAvgColLen());
    }
    return mColStats;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.model.MPartitionColumnStatistics

      throw new
        NoSuchObjectException("Column " + colName +
        " for which stats gathering is requested doesn't exist.");
    }

    MPartitionColumnStatistics oldStatsObj = getMPartitionColumnStatistics(dbName, tableName,
                                                               partName, partVal, colName);
    if (oldStatsObj != null) {
      oldStatsObj.setAvgColLen(mStatsObj.getAvgColLen());
      oldStatsObj.setLongHighValue(mStatsObj.getLongHighValue());
      oldStatsObj.setDoubleHighValue(mStatsObj.getDoubleHighValue());
      oldStatsObj.setLastAnalyzed(mStatsObj.getLastAnalyzed());
      oldStatsObj.setLongLowValue(mStatsObj.getLongLowValue());
      oldStatsObj.setDoubleLowValue(mStatsObj.getDoubleLowValue());
      oldStatsObj.setMaxColLen(mStatsObj.getMaxColLen());
      oldStatsObj.setNumDVs(mStatsObj.getNumDVs());
      oldStatsObj.setNumFalses(mStatsObj.getNumFalses());
      oldStatsObj.setNumTrues(mStatsObj.getNumTrues());
      oldStatsObj.setNumNulls(mStatsObj.getNumNulls());
    } else {
      pm.makePersistent(mStatsObj);
    }
}
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.model.MPartitionColumnStatistics

    openTransaction();
    List<ColumnStatisticsObj> statsObjs = colStats.getStatsObj();
    ColumnStatisticsDesc statsDesc = colStats.getStatsDesc();

    for (ColumnStatisticsObj statsObj:statsObjs) {
        MPartitionColumnStatistics mStatsObj =
            convertToMPartitionColumnStatistics(statsDesc, statsObj, partVals);
        writeMPartitionColumnStatistics(mStatsObj, partVals);
    }
    committed = commitTransaction();
    return committed;
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.model.MPartitionColumnStatistics

  public ColumnStatistics getPartitionColumnStatistics(String dbName, String tableName,
    String partName, List<String> partVal, String colName)
    throws MetaException, NoSuchObjectException, InvalidInputException
  {
    ColumnStatistics statsObj;
    MPartitionColumnStatistics mStatsObj =
          getMPartitionColumnStatistics(dbName, tableName, partName, partVal, colName);

    if (mStatsObj == null) {
      throw new NoSuchObjectException("Statistics for dbName=" + dbName + " tableName=" + tableName
          + " partName= " + partName + " columnName=" + colName + " doesn't exist.");
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.model.MPartitionColumnStatistics

  private MPartitionColumnStatistics getMPartitionColumnStatistics(String dbName, String tableName,
    String partName, List<String> partVal, String colName) throws NoSuchObjectException,
    InvalidInputException, MetaException
  {
    boolean committed = false;
    MPartitionColumnStatistics mStatsObj = null;

    if (dbName == null) {
      dbName = MetaStoreUtils.DEFAULT_DATABASE_NAME;
    }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.model.MPartitionColumnStatistics

    }

    try {
      openTransaction();
      MTable mTable = getMTable(dbName, tableName);
      MPartitionColumnStatistics mStatsObj;
      List<MPartitionColumnStatistics> mStatsObjColl;

      if (mTable == null) {
        throw new
          NoSuchObjectException("Table " + tableName +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.