private Object readColumnData()

in kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/incremental/wal/decode/MppdbDecodingPlugin.java [184:248]


    private Object readColumnData(final String data, final String columnType) {
        if ("null".equals(data)) {
            return null;
        }
        if (columnType.startsWith("numeric")) {
            return new BigDecimal(data);
        }
        if (columnType.startsWith("bit")) {
            return decodeString(data.substring(1));
        }
        switch (columnType) {
            case "tinyint":
            case "smallint":
            case "integer":
                return Integer.parseInt(data);
            case "bigint":
                return Long.parseLong(data);
            case "real":
                return Float.parseFloat(data);
            case "double precision":
                return Double.parseDouble(data);
            case "boolean":
                return Boolean.parseBoolean(data);
            case "time without time zone":
            case "time with time zone":
                try {
                    return timestampUtils.toTime(null, decodeString(data));
                } catch (final SQLException ex) {
                    throw new DecodingException(ex);
                }
            case "date":
                return Date.valueOf(decodeString(data));
            case "timestamp without time zone":
            case "timestamp with time zone":
            case "smalldatetime":
                try {
                    return timestampUtils.toTimestamp(null, decodeString(data));
                } catch (final SQLException ex) {
                    throw new DecodingException(ex);
                }
            case "bytea":
            case "blob":
                return decodeBytea(data);
            case "raw":
            case "reltime":
            case "int4range":
            case "int8range":
            case "numrange":
            case "tsrange":
            case "tstzrange":
            case "daterange":
                return decodePgObject(data, columnType);
            case "money":
                return decodeMoney(data);
            case "interval":
                return decodeInterval(data);
            case "character varying":
            case "text":
            case "character":
            case "nvarchar2":
            case "tsquery":
            default:
                return decodeString(data).replace("''", "'");
        }
    }