public static Integer getDecimalDigits()

in thriftserver/session/src/main/java/org/apache/livy/thriftserver/session/SparkUtils.java [188:203]


  public static Integer getDecimalDigits(org.apache.spark.sql.types.DataType type) {
    if (type instanceof BooleanType || type instanceof ByteType || type instanceof ShortType
        || type instanceof IntegerType || type instanceof LongType) {
      return 0;
    } else if (type instanceof FloatType) {
      return 7;
    } else if (type instanceof DoubleType) {
      return 15;
    } else if (type instanceof DecimalType) {
      return ((DecimalType)type).scale();
    } else if (type instanceof TimestampType) {
      return 9;
    } else {
      return null;
    }
  }