You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/05/27 14:43:34 UTC
[doris] 22/24: [improve] (jdbc catalog) better handling of postresql bit(1) types with bool type (#20022)
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 <zh...@qq.com>
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org