This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit ec1d442ceb56661b0e3ef2ff5bcc9163a1e2028a Author: zy-kkk <[email protected]> AuthorDate: Fri May 26 16:06:38 2023 +0800 [improve] (jdbc catalog) better handling of postresql bit(1) types with bool type (#20022) When the postgresql bit type size is 1, it reads as a java.lang.boolean via jdbc, and if we match against string, it will display true or false. But the normal display should be a number, so when I detect that the size of bit is 1, I will match it with boolean --- .../src/main/java/org/apache/doris/external/jdbc/JdbcClient.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java b/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java index 6981c5342d..cd835f4162 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java +++ b/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java @@ -584,6 +584,11 @@ public class JdbcClient { case "bool": return Type.BOOLEAN; case "bit": + if (fieldSchema.getColumnSize() == 1) { + return Type.BOOLEAN; + } else { + return ScalarType.createStringType(); + } case "point": case "line": case "lseg": --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
