public static Integer getColumnSize()

in thriftserver/session/src/main/java/org/apache/livy/thriftserver/session/SparkUtils.java [156:181]


  public static Integer getColumnSize(org.apache.spark.sql.types.DataType type) {
    if (type instanceof ByteType) {
      return 3;
    } else if (type instanceof ShortType) {
      return 5;
    } else if (type instanceof IntegerType) {
      return 10;
    } else if (type instanceof LongType) {
      return 19;
    } else if (type instanceof FloatType) {
      return 7;
    } else if (type instanceof DoubleType) {
      return 15;
    } else if (type instanceof DecimalType) {
      return ((DecimalType)type).precision();
    } else if (type instanceof StringType || type instanceof BinaryType || type instanceof MapType
        || type instanceof ArrayType || type instanceof StructType) {
      return Integer.MAX_VALUE;
    } else if (type instanceof DateType) {
      return 10;
    } else if (type instanceof TimestampType) {
      return 29;
    } else {
      return null;
    }
  }