[improvement](jdbc)Support for automatically obtaining the precision of the hana timestamp type (#21380)
This commit is contained in:
@ -58,9 +58,14 @@ public class JdbcSapHanaClient extends JdbcClient {
|
||||
return Type.FLOAT;
|
||||
case "DOUBLE":
|
||||
return Type.DOUBLE;
|
||||
case "TIMESTAMP":
|
||||
// TIMESTAMP with 100 nanoseconds precision, will lose precision
|
||||
return ScalarType.createDatetimeV2Type(6);
|
||||
case "TIMESTAMP": {
|
||||
// postgres can support microsecond
|
||||
int scale = fieldSchema.getDecimalDigits();
|
||||
if (scale > 6) {
|
||||
scale = 6;
|
||||
}
|
||||
return ScalarType.createDatetimeV2Type(scale);
|
||||
}
|
||||
case "SECONDDATE":
|
||||
// SECONDDATE with second precision
|
||||
return ScalarType.createDatetimeV2Type(0);
|
||||
|
||||
Reference in New Issue
Block a user