@Override
  public void updateCompactorState(CompactionInfo ci, long compactionTxnId) throws MetaException {
    boolean runInTxn = compactionTxnId > 0;
    jdbcResource.execute(
        "UPDATE \"COMPACTION_QUEUE\" SET \"CQ_HIGHEST_WRITE_ID\" = :highestWriteId, " +
            "\"CQ_RUN_AS\" = :runAs, \"CQ_TXN_ID\" = :txnId, \"CQ_TYPE\" = :type WHERE \"CQ_ID\" = :id",
        new MapSqlParameterSource()
            .addValue("highestWriteId", runInTxn ? ci.highestWriteId : null, Types.BIGINT)
            .addValue("runAs", ci.runAs)
            .addValue("txnId", runInTxn ? compactionTxnId : null, Types.BIGINT)
            .addValue("type", Character.toString(thriftCompactionType2DbType(ci.type)))
            .addValue("id", ci.id),
        ParameterizedCommand.EXACTLY_ONE_ROW);

    if (!runInTxn) {
      return;
    }

    MapSqlParameterSource parameterSource = new MapSqlParameterSource()
        .addValue("txnId", compactionTxnId)
        .addValue("dbName", ci.dbname)
        .addValue("tableName", ci.tableName)
        .addValue("partName", ci.partName, Types.VARCHAR)
        .addValue("highestWriteId", ci.highestWriteId)
        .addValue("operationType", OperationType.COMPACT.getSqlConst());
    if (ci.partName != null) {
      parameterSource.addValue("partName", ci.partName);
    }
    jdbcResource.execute(
        /*We make an entry in TXN_COMPONENTS for the partition/table that the compactor is
         * working on in case this txn aborts and so we need to ensure that its TXNS entry is
         * not removed until Cleaner has removed all files that this txn may have written, i.e.
         * make it work the same way as any other write.  TC_WRITEID is set to the highest
         * WriteId that this compactor run considered since there compactor doesn't allocate
         * a new write id (so as not to invalidate result set caches/materialized views) but
         * we need to set it to something to that markCleaned() only cleans TXN_COMPONENTS up to
         * the level to which aborted files/data has been cleaned.*/
        "INSERT INTO \"TXN_COMPONENTS\"(\"TC_TXNID\", \"TC_DATABASE\", \"TC_TABLE\", \"TC_PARTITION\", " +
            "\"TC_WRITEID\", \"TC_OPERATION_TYPE\") " +
            "VALUES(:txnId, :dbName, :tableName, :partName, :highestWriteId, :operationType)",
        parameterSource,
        ParameterizedCommand.EXACTLY_ONE_ROW);
  }
Queries metastore DB directly to find columns in the table which have statistics information.
If {@code ci} includes partition info then per partition stats info is examined, otherwise
table level stats are examined.
@throws MetaException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java