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

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

      MPartition mPartition = getMPartition(
          statsDesc.getDbName(), statsDesc.getTableName(), partVals);
      if (partition == null) {
        throw new NoSuchObjectException("Partition for which stats is gathered doesn't exist.");
      }
      MPartitionColumnStatistics mStatsObj =
          StatObjectConverter.convertToMPartitionColumnStatistics(mPartition, statsDesc, statsObj);
      writeMPartitionColumnStatistics(table, partition, mStatsObj);
    }
    committed = commitTransaction();
    return committed;
View Full Code Here

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

        String lastPartName = null;
        List<ColumnStatisticsObj> curList = null;
        ColumnStatisticsDesc csd = null;
        for (int i = 0; i <= mStats.size(); ++i) {
          boolean isLast = i == mStats.size();
          MPartitionColumnStatistics mStatsObj = isLast ? null : mStats.get(i);
          String partName = isLast ? null : (String)mStatsObj.getPartitionName();
          if (isLast || !partName.equals(lastPartName)) {
            if (i != 0) {
              result.add(new ColumnStatistics(csd, curList));
            }
            if (isLast) {
View Full Code Here

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

  private List<MPartitionColumnStatistics> getMPartitionColumnStatistics(
      Table table, List<String> partNames, List<String> colNames)
          throws NoSuchObjectException, MetaException {
    boolean committed = false;
    MPartitionColumnStatistics mStatsObj = null;
    try {
      openTransaction();
      // We are not going to verify SD for each partition. Just verify for the table.
      validateTableCols(table, colNames);
      boolean foundCol = false;
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.