{"record":{"id":"76f10f6c1441dbd3","repo":"apache/seatunnel","slug":"unsupported-duckdb-type-falling-back-to-strin","errorCode":null,"errorMessage":"Unsupported DuckDB type: {}, falling back to STRING","messagePattern":"Unsupported DuckDB type: (.+?), falling back to STRING","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/duckdb/DuckDBTypeConverter.java","lineNumber":186,"sourceCode":"                break;\n            case DUCKDB_TIMESTAMP_WITH_TZ:\n                builder.dataType(LocalTimeType.OFFSET_DATE_TIME_TYPE);\n                break;\n            case DUCKDB_INTERVAL:\n                builder.dataType(BasicType.STRING_TYPE);\n                builder.columnLength(50L);\n                break;\n            case DUCKDB_ARRAY:\n            case DUCKDB_STRUCT:\n            case DUCKDB_MAP:\n                log.warn(\n                        \"Complex type {} mapped to STRING, consider using JSON serialization\",\n                        duckDBType);\n                builder.dataType(BasicType.STRING_TYPE);\n                builder.columnLength(lengthValue > 0 ? lengthValue : 65535);\n                break;\n            default:\n                log.warn(\"Unsupported DuckDB type: {}, falling back to STRING\", duckDBType);\n                builder.dataType(BasicType.STRING_TYPE);\n                builder.columnLength(lengthValue > 0 ? lengthValue : 255);\n        }\n        return builder.build();\n    }\n\n    private void handleDecimalType(\n            PhysicalColumn.PhysicalColumnBuilder builder, BasicTypeDefine typeDefine) {\n        long precision =\n                typeDefine.getPrecision() != null ? typeDefine.getPrecision() : DEFAULT_PRECISION;\n        int scale = typeDefine.getScale() != null ? typeDefine.getScale() : DEFAULT_SCALE;\n\n        if (precision > MAX_PRECISION) {\n            log.warn(\n                    \"DECIMAL precision {} exceeds maximum {}, truncating to {}\",\n                    precision,\n                    MAX_PRECISION,\n                    MAX_PRECISION);","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/duckdb/DuckDBTypeConverter.java#L168-L204","documentation":"A fallback warning from DuckDBTypeConverter.convert: the incoming DuckDB type did not match any case in the converter's switch, so the column is mapped to BasicType.STRING_TYPE with length 255 (or the given length if positive). This keeps the pipeline running but may silently misrepresent the real type, and values that don't fit 255 chars can be truncated or rejected by the target.","triggerScenarios":"Schema conversion encounters a DuckDB type not enumerated in the dialect's supported list — typically new DuckDB types (e.g. newer UNION/BIT variants) or unusual metadata returned by the JDBC driver's getTypeInfo.","commonSituations":"Upgrading DuckDB to a version with new types while using an older SeaTunnel connector jar; reading exotic column types in catalog discovery; typos/odd type names in source definitions.","solutions":["Check the connector's DuckDB dialect for the supported type list and upgrade the SeaTunnel connector to a version covering the type.","Explicitly cast the column to a supported type in your source SQL.","If STRING is acceptable, raise the target column length in the sink schema to avoid truncation.","File/verify an issue with Apache SeaTunnel to add the missing type mapping."],"exampleFix":"// before\nSELECT u FROM events; -- u is UNION type, falls back to STRING(255)\n// after\nSELECT CAST(u AS VARCHAR) AS u FROM events; -- explicit, choose your own length","handlingStrategy":"validation","validationCode":"// Before sync, list types and compare against supported DuckDB dialect types\nDatabaseMetaData md = conn.getMetaData();\nResultSet rs = md.getTypeInfo();\nwhile (rs.next()) { /* check each column type is in the supported set */ }","typeGuard":"boolean isSupportedDuckDbType(String t) {\n  return DUCKDB_SUPPORTED_TYPES.contains(t.trim().toUpperCase());\n}","tryCatchPattern":null,"preventionTips":["Keep the connector jar and DuckDB driver versions aligned with the DuckDB server version.","Cast unknown/exotic types explicitly in the source SQL.","Review sync logs for 'falling back to STRING' warnings and widen target column lengths.","Report missing mappings upstream to SeaTunnel rather than accepting silent STRING fallback."],"tags":["jdbc","duckdb","type-conversion","fallback"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}