public static String getUpdatedColumnSql(MPartitionColumnStatistics mStatsObj) {
    StringBuilder setStmt = new StringBuilder();
    if (mStatsObj.getAvgColLen() != null) {
      setStmt.append("\"AVG_COL_LEN\" = ? ,");
    }
    if (mStatsObj.getLongHighValue() != null) {
      setStmt.append("\"LONG_HIGH_VALUE\" = ? ,");
    }
    if (mStatsObj.getDoubleHighValue() != null) {
      setStmt.append("\"DOUBLE_HIGH_VALUE\" = ? ,");
    }
    setStmt.append("\"LAST_ANALYZED\" = ? ,");
    if (mStatsObj.getLongLowValue() != null) {
      setStmt.append("\"LONG_LOW_VALUE\" = ? ,");
    }
    if (mStatsObj.getDoubleLowValue() != null) {
      setStmt.append("\"DOUBLE_LOW_VALUE\" = ? ,");
    }
    if (mStatsObj.getDecimalLowValue() != null) {
      setStmt.append("\"BIG_DECIMAL_LOW_VALUE\" = ? ,");
    }
    if (mStatsObj.getDecimalHighValue() != null) {
      setStmt.append("\"BIG_DECIMAL_HIGH_VALUE\" = ? ,");
    }
    if (mStatsObj.getMaxColLen() != null) {
      setStmt.append("\"MAX_COL_LEN\" = ? ,");
    }
    if (mStatsObj.getNumDVs() != null) {
      setStmt.append("\"NUM_DISTINCTS\" = ? ,");
    }
    if (mStatsObj.getBitVector() != null) {
      setStmt.append("\"BIT_VECTOR\" = ? ,");
    }
    if (mStatsObj.getHistogram() != null) {
      setStmt.append("\"HISTOGRAM\" = ? ,");
    }
    if (mStatsObj.getNumFalses() != null) {
      setStmt.append("\"NUM_FALSES\" = ? ,");
    }
    if (mStatsObj.getNumTrues() != null) {
      setStmt.append(" \"NUM_TRUES\" = ? ,");
    }
    if (mStatsObj.getNumNulls() != null) {
      setStmt.append("\"NUM_NULLS\" = ? ,");
    }
    setStmt.append("\"ENGINE\" = ? ");
    return setStmt.toString();
  }
This class contains conversion logic that creates Thrift stat objects from
JDO stat objects and plain arrays from DirectSQL.
It is hidden here so that we wouldn't have to look at it in elsewhere.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java