[improvement](jdbc)Support for automatically obtaining the precision of the trino/presto timestamp type (#21386)

This commit is contained in:
zy-kkk
2023-07-04 18:59:42 +08:00
committed by GitHub
parent aec5bac498
commit f498beed07

View File

@ -79,8 +79,11 @@ public class JdbcTrinoClient extends JdbcClient {
}
if (trinoType.startsWith("timestamp")) {
// timestamp with picoseconds precision, will lose precision
return ScalarType.createDatetimeV2Type(JDBC_DATETIME_SCALE);
int scale = fieldSchema.getDecimalDigits();
if (scale > 6) {
scale = 6;
}
return ScalarType.createDatetimeV2Type(scale);
}
if (trinoType.startsWith("array")) {