From 7706785264f4ca2f3a1e9c571aafa80c67ece011 Mon Sep 17 00:00:00 2001 From: samcchen Date: Sun, 24 Mar 2024 21:56:33 +0800 Subject: [PATCH] =?UTF-8?q?[Feature]=20Suppor=E2=80=A0=E2=80=A0t=20clickho?= =?UTF-8?q?use=20jdbc=20datasource(#40894)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/starrocks/udf/UDFHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java-extensions/udf-extensions/src/main/java/com/starrocks/udf/UDFHelper.java b/java-extensions/udf-extensions/src/main/java/com/starrocks/udf/UDFHelper.java index 94ba193ffe5cf0..1273f8530c359c 100644 --- a/java-extensions/udf-extensions/src/main/java/com/starrocks/udf/UDFHelper.java +++ b/java-extensions/udf-extensions/src/main/java/com/starrocks/udf/UDFHelper.java @@ -58,6 +58,8 @@ public class UDFHelper { private static final ThreadLocal formatter = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + private static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + private static final TimeZone timeZone = TimeZone.getDefault(); private static void getBooleanBoxedResult(int numRows, Boolean[] boxedArr, long columnAddr) { @@ -233,7 +235,7 @@ private static void getStringLocalDateResult(int numRows, LocalDate[] column, lo String[] results = new String[numRows]; for (int i = 0; i < numRows; i++) { if (column[i] != null) { - results[i] = dateTimeFormatter.format(column[i]); + results[i] = dateFormatter.format(column[i]); } } getStringBoxedResult(numRows, results, columnAddr);