private static ColStatistics buildColStatForConstant(HiveConf conf, long numRows, ExprNodeConstantDesc encd) {

    long numNulls = 0;
    long countDistincts = 0;
    if (encd.getValue() == null) {
      // null projection
      numNulls = numRows;
    } else {
      countDistincts = 1;
    }
    String colType = encd.getTypeString();
    colType = colType.toLowerCase();
    ObjectInspector oi = encd.getWritableObjectInspector();
    double avgColSize = getAvgColLenOf(conf, oi, colType);
    ColStatistics colStats = new ColStatistics(encd.getName(), colType);
    colStats.setAvgColLen(avgColSize);
    colStats.setCountDistint(countDistincts);
    colStats.setNumNulls(numNulls);

    Optional<Number> value = getConstValue(encd);
    value.ifPresent(number -> colStats.setRange(number, number));
    return colStats;
  }
Get column statistics expression nodes
@param conf
         - hive conf
@param parentStats
         - parent statistics
@param end
         - expression nodes
@return column statistics
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java