[bug](datetimev2) fix wrong info when show create table (#15422)

* [bug](datetimev2) fix wrong info when show create table

* update
This commit is contained in:
Gabriel
2022-12-28 19:55:43 +08:00
committed by GitHub
parent 95e6553d90
commit 4336aaa01a
2 changed files with 2 additions and 2 deletions

View File

@ -582,7 +582,7 @@ public class ScalarType extends Type {
}
break;
case DATETIMEV2:
stringBuilder.append("datetime").append("(").append(scale).append(")");
stringBuilder.append("datetimev2").append("(").append(scale).append(")");
break;
case TIME:
stringBuilder.append("time");

View File

@ -125,7 +125,7 @@ public class ColumnTypeTest {
public void testDatetimeV2() throws AnalysisException {
TypeDef type = TypeDef.createDatetimeV2(3);
type.analyze(null);
Assert.assertEquals("datetime(3)", type.toString());
Assert.assertEquals("datetimev2(3)", type.toString());
Assert.assertEquals(PrimitiveType.DATETIMEV2, type.getType().getPrimitiveType());
Assert.assertEquals(ScalarType.DATETIME_PRECISION, ((ScalarType) type.getType()).getScalarPrecision());
Assert.assertEquals(3, ((ScalarType) type.getType()).getScalarScale());