1
0

when column type is decimal, should add precision and scale (#753)

This commit is contained in:
Thinking Chen
2019-07-09 07:13:22 +08:00
committed by vinoth chandar
parent 9f18a1ca80
commit 62ecb2da62

View File

@@ -285,6 +285,11 @@ public class HoodieHiveClient {
while (result.next()) {
String columnName = result.getString(4);
String columnType = result.getString(6);
if ("DECIMAL".equals(columnType)) {
int columnSize = result.getInt("COLUMN_SIZE");
int decimalDigits = result.getInt("DECIMAL_DIGITS");
columnType += String.format("(%s,%s)", columnSize, decimalDigits);
}
schema.put(columnName, columnType);
}
return schema;