morningman commented on code in PR #15570:
URL: https://github.com/apache/doris/pull/15570#discussion_r1060541972
##########
fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java:
##########
@@ -371,11 +395,10 @@ public Type mysqlTypeToDoris(JdbcFieldSchema fieldSchema)
{
case "BIGINT":
return Type.BIGINT;
case "DATE":
- return ScalarType.getDefaultDateType(Type.DATE);
+ return Type.DATE;
Review Comment:
Why not still using `ScalarType.getDefaultDateType`, so that we can control
the behavior by FE config?
##########
fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java:
##########
@@ -418,7 +441,72 @@ public Type mysqlTypeToDoris(JdbcFieldSchema fieldSchema) {
return ScalarType.createStringType();
default:
throw new JdbcClientException("Can not convert mysql data type
to doris data type for type ["
- + mysqlType + "]");
+ + mysqlType + "]");
+ }
+ }
+
+ public Type postgresqlTypeToDoris(JdbcFieldSchema fieldSchema) {
+ String pgType = fieldSchema.getDataTypeName();
+ switch (pgType) {
+ case "int2":
+ case "smallserial":
+ return Type.SMALLINT;
+ case "int4":
+ case "serial":
+ return Type.INT;
+ case "int8":
+ case "bigserial":
+ return Type.BIGINT;
+ case "numeric": {
+ int precision = fieldSchema.getColumnSize() + 1;
Review Comment:
Do we still need this `+1`? PG has no `unsigned` type.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]