From 2b4e90be766d1cb0273106b63875193800443997 Mon Sep 17 00:00:00 2001 From: wenmo <32723967+aiwenmo@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:48:43 +0800 Subject: [PATCH] [Fix-3964] [metadata] Fix NPE when executing a query statement on the PG table --- .../org/dinky/metadata/convert/PostgreSqlTypeConvert.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dinky-metadata/dinky-metadata-postgresql/src/main/java/org/dinky/metadata/convert/PostgreSqlTypeConvert.java b/dinky-metadata/dinky-metadata-postgresql/src/main/java/org/dinky/metadata/convert/PostgreSqlTypeConvert.java index 4ed4621d07..4ea1262107 100644 --- a/dinky-metadata/dinky-metadata-postgresql/src/main/java/org/dinky/metadata/convert/PostgreSqlTypeConvert.java +++ b/dinky-metadata/dinky-metadata-postgresql/src/main/java/org/dinky/metadata/convert/PostgreSqlTypeConvert.java @@ -65,7 +65,9 @@ public PostgreSqlTypeConvert() { private static Optional convertDecimalOrNumeric( Column column, DriverConfig driverConfig) { - // 该字段的精度 + if (column.getPrecision() == null) { + return Optional.of(ColumnType.DECIMAL); + } int intValue = column.getPrecision().intValue(); if (intValue > 38) { return Optional.of(ColumnType.STRING);