private static long getAvgColSize(final ColumnInfo columnInfo, HiveConf conf) {
    ObjectInspector oi = columnInfo.getObjectInspector();
    String colTypeLowerCase = columnInfo.getTypeName().toLowerCase();
    if (colTypeLowerCase.equals(serdeConstants.STRING_TYPE_NAME)
        || colTypeLowerCase.equals(serdeConstants.BINARY_TYPE_NAME)
        || colTypeLowerCase.startsWith(serdeConstants.VARCHAR_TYPE_NAME)
        || colTypeLowerCase.startsWith(serdeConstants.CHAR_TYPE_NAME)
        || colTypeLowerCase.startsWith(serdeConstants.LIST_TYPE_NAME)
        || colTypeLowerCase.startsWith(serdeConstants.MAP_TYPE_NAME)
        || colTypeLowerCase.startsWith(serdeConstants.STRUCT_TYPE_NAME)
        || colTypeLowerCase.startsWith(serdeConstants.UNION_TYPE_NAME)) {
      return getAvgColLenOf(conf, oi, colTypeLowerCase);
    } else {
      return getAvgColLenOfFixedLengthTypes(colTypeLowerCase);
    }
  }
Scale selectivity based on key range ratio.
@param csPK - column statistics of primary key
@param csFK - column statistics of potential foreign key
@return
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java