/** * Return true if the current statistics in the Metastore is valid * for the query of the given "txnId" and "queryValidWriteIdList". * * Note that a statistics entity is valid iff * the stats is written by the current query or * the conjunction of the following two are true: * ~ COLUMN_STATE_ACCURATE(CSA) state is true * ~ Isolation-level (snapshot) compliant with the query * @param part MPartition of the stats entity * @param queryValidWriteIdList valid writeId list of the query * @Precondition "part" should be retrieved from the PARTITIONS table. */ private boolean isCurrentStatsValidForTheQuery(MPartition part, String queryValidWriteIdList, boolean isCompleteStatsWriter) throws MetaException { return isCurrentStatsValidForTheQuery(conf, part.getParameters(), part.getWriteId(), queryValidWriteIdList, isCompleteStatsWriter); }
private Partition convertToPart(String catName, String dbName, String tblName, MPartition mpart) throws MetaException { if (mpart == null) { return null; } Partition p = new Partition(convertList(mpart.getValues()), dbName, tblName, mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd(), false), convertMap(mpart.getParameters())); p.setCatName(catName); p.setWriteId(mpart.getWriteId()); return p; }
Map<String, String> newParams = new HashMap<>(mPartition.getParameters()); StatsSetupConst.setColumnStatsState(newParams, colNames); boolean isTxn = TxnUtils.isTransactionalTable(table); } else { String errorMsg = verifyStatsChangeCtx( mPartition.getParameters(), newParams, writeId, validWriteIds, true); if (errorMsg != null) { throw new MetaException(errorMsg);
if (isTxn && areTxnStatsSupported) { String errorMsg = verifyStatsChangeCtx(oldp.getParameters(), newPart.getParameters(), newPart.getWriteId(), validWriteIds, false); if (errorMsg != null) { StatsSetupConst.setBasicStatsState(oldp.getParameters(), StatsSetupConst.FALSE); } else if (validWriteIds != null && newPart.getWriteId() > 0) { StatsSetupConst.setBasicStatsState(oldp.getParameters(), StatsSetupConst.FALSE); LOG.info("Removed COLUMN_STATS_ACCURATE from the parameters of the partition " + dbname + "." + name + "." + oldp.getPartitionName() + " will be made persistent.");
private Partition convertToPart(MPartition mpart) throws MetaException { if (mpart == null) { return null; } //its possible that MPartition is partially filled, do null checks to avoid NPE MTable table = mpart.getTable(); String dbName = table == null ? null : table.getDatabase() == null ? null : table.getDatabase().getName(); String tableName = table == null ? null : table.getTableName(); String catName = table == null ? null : table.getDatabase() == null ? null : table.getDatabase().getCatalogName(); Partition p = new Partition(convertList(mpart.getValues()), dbName, tableName, mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd()), convertMap(mpart.getParameters())); p.setCatName(catName); p.setWriteId(mpart.getWriteId()); return p; }
private Partition convertToPart(String dbName, String tblName, MPartition mpart) throws MetaException { if (mpart == null) { return null; } return new Partition(mpart.getValues(), dbName, tblName, mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd(), false), mpart.getParameters()); }
private Partition convertToPart(String dbName, String tblName, MPartition mpart) throws MetaException { if (mpart == null) { return null; } return new Partition(convertList(mpart.getValues()), dbName, tblName, mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd(), false), convertMap(mpart.getParameters())); }
private Partition convertToPart(String dbName, String tblName, MPartition mpart) throws MetaException { if (mpart == null) { return null; } return new Partition(convertList(mpart.getValues()), dbName, tblName, mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd(), false), convertMap(mpart.getParameters())); }
private Partition convertToPart(String catName, String dbName, String tblName, MPartition mpart) throws MetaException { if (mpart == null) { return null; } Partition p = new Partition(convertList(mpart.getValues()), dbName, tblName, mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd(), false), convertMap(mpart.getParameters())); p.setCatName(catName); return p; }
private Partition convertToPart(MPartition mpart) throws MetaException { if (mpart == null) { return null; } return new Partition(mpart.getValues(), mpart.getTable().getDatabase() .getName(), mpart.getTable().getTableName(), mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd()), mpart.getParameters()); }
private Partition convertToPart(MPartition mpart) throws MetaException { if (mpart == null) { return null; } return new Partition(mpart.getValues(), mpart.getTable().getDatabase() .getName(), mpart.getTable().getTableName(), mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd()), mpart.getParameters()); }
private Partition convertToPart(MPartition mpart) throws MetaException { if (mpart == null) { return null; } return new Partition(convertList(mpart.getValues()), mpart.getTable().getDatabase() .getName(), mpart.getTable().getTableName(), mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd()), convertMap(mpart.getParameters())); }
private Partition convertToPart(MPartition mpart) throws MetaException { if (mpart == null) { return null; } return new Partition(convertList(mpart.getValues()), mpart.getTable().getDatabase() .getName(), mpart.getTable().getTableName(), mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd()), convertMap(mpart.getParameters())); }
private Partition convertToPart(MPartition mpart) throws MetaException { if (mpart == null) { return null; } Partition p = new Partition(convertList(mpart.getValues()), mpart.getTable().getDatabase() .getName(), mpart.getTable().getTableName(), mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd()), convertMap(mpart.getParameters())); p.setCatName(mpart.getTable().getDatabase().getCatalogName()); return p; }
oldStats.get(statsObj.getColName())); Map<String, String> parameters = mPartition.getParameters(); StatsSetupConst.setColumnStatsState(parameters, colNames); mPartition.setParameters(parameters);