public static int getPrecisionForType(PrimitiveTypeInfo typeInfo) {
    switch (typeInfo.getPrimitiveCategory()) {
    case DECIMAL:
      return ((DecimalTypeInfo)typeInfo).precision();
    case FLOAT:
      return 7;
    case DOUBLE:
      return 15;
    case BYTE:
      return 3;
    case SHORT:
      return 5;
    case INT:
      return 10;
    case LONG:
      return 19;
    case VOID:
      return 1;
    default:
      return HiveDecimal.SYSTEM_DEFAULT_PRECISION;
    }
  }
Need to keep consistent with JdbcColumn.columnPrecision
serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/HiveDecimalUtils.java