From dec4d98eb6664d55616a3eb7d69af774bad66d3a Mon Sep 17 00:00:00 2001 From: samcchen Date: Thu, 21 Mar 2024 20:22:00 +0800 Subject: [PATCH] [Feature] Support clickhouse jdbc datasource(#40894) Signed-off-by: samcchen --- be/src/exec/jdbc_scanner.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/be/src/exec/jdbc_scanner.cpp b/be/src/exec/jdbc_scanner.cpp index 945ad228d346a5..37ae717a723ee3 100644 --- a/be/src/exec/jdbc_scanner.cpp +++ b/be/src/exec/jdbc_scanner.cpp @@ -202,7 +202,9 @@ StatusOr JDBCScanner::_precheck_data_type(const std::string& java_c "one of boolean, tinyint,smallint,int,bigint", slot_desc->col_name())); } - // What if it's boolean? + if(type == TYPE_BOOLEAN){ + return TYPE_BOOLEAN; + } return TYPE_TINYINT; } else if (java_class == "com.clickhouse.data.value.UnsignedByte") { if (type != TYPE_SMALLINT && type != TYPE_INT && type != TYPE_BIGINT) { @@ -327,7 +329,7 @@ StatusOr JDBCScanner::_precheck_data_type(const std::string& java_c "Type mismatches on column[{}], JDBC result type is LocalDate, please set the type to date", slot_desc->col_name())); } - return TYPE_VARCHAR; + return TYPE_DATE; } else if (java_class == "java.math.BigDecimal") { if (type != TYPE_DECIMAL32 && type != TYPE_DECIMAL64 && type != TYPE_DECIMAL128 && type != TYPE_VARCHAR) { return Status::NotSupported(