[fix](Outfile) Export DateTimev2 type of doris to ORC's TimeStamp type (#25470)

Previously,doris's `DateTimev2` was exported to orc as a `String` type.
Now, export doris's `DateTimev2` to orc timestamp type.
This commit is contained in:
Tiewei Fang
2023-10-29 15:59:38 +08:00
committed by GitHub
parent 1e5ed91e4d
commit 99b45e1938
47 changed files with 350 additions and 176 deletions

View File

@ -295,10 +295,12 @@ public class OutFileClause {
}
orcType = "string";
break;
case DATETIMEV2:
orcType = "timestamp";
break;
case LARGEINT:
case DATE:
case DATETIME:
case DATETIMEV2:
case DATEV2:
case CHAR:
case VARCHAR:
@ -421,10 +423,16 @@ public class OutFileClause {
+ " but the type of column " + i + " is " + schema.second);
}
break;
case DATETIMEV2:
if (!schema.second.equals("timestamp")) {
throw new AnalysisException("project field type is " + resultType.getPrimitiveType().toString()
+ ", should use timestamp, but the definition type of column " + i + " is "
+ schema.second);
}
break;
case LARGEINT:
case DATE:
case DATETIME:
case DATETIMEV2:
case DATEV2:
case CHAR:
case VARCHAR: