This is an automated email from the ASF dual-hosted git repository.
vinoth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 62ecb2d when column type is decimal, should add precision and scale
(#753)
62ecb2d is described below
commit 62ecb2da62117e65117f7f6070469ac27a3ea5dd
Author: Thinking Chen <[email protected]>
AuthorDate: Tue Jul 9 07:13:22 2019 +0800
when column type is decimal, should add precision and scale (#753)
---
hoodie-hive/src/main/java/com/uber/hoodie/hive/HoodieHiveClient.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git
a/hoodie-hive/src/main/java/com/uber/hoodie/hive/HoodieHiveClient.java
b/hoodie-hive/src/main/java/com/uber/hoodie/hive/HoodieHiveClient.java
index c252007..746d600 100644
--- a/hoodie-hive/src/main/java/com/uber/hoodie/hive/HoodieHiveClient.java
+++ b/hoodie-hive/src/main/java/com/uber/hoodie/hive/HoodieHiveClient.java
@@ -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;