@Test public void testPrecisionAndScale() { Pair<Integer, Integer> precisionAndScale = Decimal.getPrecisionAndScale("decimal(10 , 2) "); assertEquals((Integer) 10, precisionAndScale.getFirst()); assertEquals((Integer) 2, precisionAndScale.getSecond()); }
public static Pair<Integer, Integer> getPrecisionAndScale(String type) { type = type.trim(); String param = type.substring(8, type.length() - 1); String[] params = param.split(","); return new Pair<>(Integer.parseInt(params[0].trim()), Integer.parseInt(params[1].trim())); }
Decimal { public static Pair<Integer, Integer> getPrecisionAndScale(String type) { type = type.trim(); String param = type.substring(8, type.length() - 1); String[] params = param.split(","); return new Pair<>(Integer.parseInt(params[0].trim()), Integer.parseInt(params[1].trim())); } }
Decimal { public static Pair<Integer, Integer> getPrecisionAndScale(String type) { type = type.trim(); String param = type.substring(8, type.length() - 1); String[] params = param.split(","); return new Pair<>(Integer.parseInt(params[0].trim()), Integer.parseInt(params[1].trim())); } Decimal(String type); }
Decimal { public static Pair<Integer, Integer> getPrecisionAndScale(String type) { type = type.trim(); String param = type.substring(8, type.length() - 1); String[] params = param.split(","); return new Pair<>(Integer.parseInt(params[0].trim()), Integer.parseInt(params[1].trim())); } Decimal(String type); int getPrecision(); int getScale(); static Pair<Integer, Integer> getPrecisionAndScale(String type); BigDecimal toBigDecimal(String v); byte[] toParquetBytes(String v); }
Decimal { public static Pair<Integer, Integer> getPrecisionAndScale(String type) { type = type.trim(); String param = type.substring(8, type.length() - 1); String[] params = param.split(","); return new Pair<>(Integer.parseInt(params[0].trim()), Integer.parseInt(params[1].trim())); } Decimal(String type); int getPrecision(); int getScale(); static Pair<Integer, Integer> getPrecisionAndScale(String type); BigDecimal toBigDecimal(String v); byte[] toParquetBytes(String v);  }