/** * 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); }
LOG.debug("The current metastore transactional partition column statistics for {}.{}.{} " + "(write ID {}) are not valid for current query ({} {})", dbName, tableName, mpart.getPartitionName(), mpart.getWriteId(), writeIdList);
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; }
long statsWriteId = mpart.getWriteId(); if (TxnUtils.isTransactionalTable(table.getParameters())) { if (!areTxnStatsSupported) {
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; }