Skip to content

Commit 27b935b

Browse files
gepaclaude
andcommitted
Add Short and BigDecimal type mappings to SqlTypeUtils
Short and java.math.BigDecimal had no entry in the JDBC type map, so columns of those Java types were created as VARCHAR(255) by the JDBC table sink in overwrite mode. Map Short (and short) to SMALLINT and BigDecimal to NUMERIC; the PostgreSQL dialect map inherits both from the default map. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f6d2aa9 commit 27b935b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • wayang-commons/wayang-basic/src/main/java/org/apache/wayang/basic/util

wayang-commons/wayang-basic/src/main/java/org/apache/wayang/basic/util/SqlTypeUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.apache.wayang.basic.util;
2020

2121
import org.apache.wayang.basic.data.Record;
22+
import java.math.BigDecimal;
2223
import java.sql.Date;
2324
import java.sql.Timestamp;
2425
import java.time.LocalDate;
@@ -42,10 +43,13 @@ public class SqlTypeUtils {
4243
defaultMap.put(int.class, "INT");
4344
defaultMap.put(Long.class, "BIGINT");
4445
defaultMap.put(long.class, "BIGINT");
46+
defaultMap.put(Short.class, "SMALLINT");
47+
defaultMap.put(short.class, "SMALLINT");
4548
defaultMap.put(Double.class, "DOUBLE");
4649
defaultMap.put(double.class, "DOUBLE");
4750
defaultMap.put(Float.class, "FLOAT");
4851
defaultMap.put(float.class, "FLOAT");
52+
defaultMap.put(BigDecimal.class, "NUMERIC");
4953
defaultMap.put(Boolean.class, "BOOLEAN");
5054
defaultMap.put(boolean.class, "BOOLEAN");
5155
defaultMap.put(String.class, "VARCHAR(255)");

0 commit comments

Comments
 (0)