[fix](multi-catalog) verify the precision of datetime types for each data source (#19544)

Fix threes bugs of timestampv2 precision:
1. Hive catalog doesn't set the precision of timestampv2, and can't get the precision from hive metastore, so set the largest precision for timestampv2;
2. Jdbc catalog use datetimev1 to parse timestamp, and convert to timestampv2, so the precision is lost.
3. TVF doesn't use the precision from meta data of file format.
This commit is contained in:
Ashin Gau
2023-05-17 20:50:15 +08:00
committed by GitHub
parent 73be97f8d8
commit 30c4f25cb3
20 changed files with 2309 additions and 2334 deletions

View File

@ -140,6 +140,8 @@ public class ScalarType extends Type {
return createDecimalV3Type(precision, scale);
case DECIMALV2:
return createDecimalType(precision, scale);
case DATETIMEV2:
return createDatetimeV2Type(scale);
default:
return createType(type);
}