{"record":{"id":"bc04e1df87258e24","repo":"apache/seatunnel","slug":"unsupported-sql-type-type-name-using-str","errorCode":null,"errorMessage":"Unsupported SQL type: {}, type name: {}, using STRING_TYPE as fallback","messagePattern":"Unsupported SQL type: (.+?), type name: (.+?), using STRING_TYPE as fallback","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/source/DatabendSourceReader.java","lineNumber":295,"sourceCode":"                return new DecimalType(precision > 0 ? precision : 38, scale >= 0 ? scale : 18);\n\n            case Types.DATE:\n                return LocalTimeType.LOCAL_DATE_TYPE;\n\n            case Types.TIME:\n                return LocalTimeType.LOCAL_TIME_TYPE;\n\n            case Types.TIMESTAMP:\n                return LocalTimeType.LOCAL_DATE_TIME_TYPE;\n\n            case Types.BINARY:\n            case Types.VARBINARY:\n            case Types.LONGVARBINARY:\n            case Types.BLOB:\n                return PrimitiveByteArrayType.INSTANCE;\n\n            default:\n                log.warn(\n                        \"Unsupported SQL type: {}, type name: {}, using STRING_TYPE as fallback\",\n                        sqlType,\n                        typeName);\n                return BasicType.STRING_TYPE;\n        }\n    }\n\n    @Override\n    public void close() throws IOException {\n        try {\n            if (resultSet != null) {\n                resultSet.close();\n            }\n            if (statement != null) {\n                statement.close();\n            }\n            if (connection != null) {\n                connection.close();","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/source/DatabendSourceReader.java#L277-L313","documentation":"This is a warning logged by DatabendSourceReader.convertDatabendTypeToSeaTunnelType when it encounters a JDBC SQL type it does not recognize while inferring the SeaTunnel row type from a ResultSet. The library intentionally degrades gracefully: instead of failing the read, it maps the column to SeaTunnel STRING_TYPE and logs this warning. The resulting rows will carry the raw value as a string, which may lose type fidelity.","triggerScenarios":"A Databend column maps to a java.sql.Types constant not covered by the switch (anything outside BIT/BOOLEAN, numeric, CHAR/VARCHAR/LONGVARCHAR, DATE/TIME/TIMESTAMP, BINARY/VARBINARY/LONGVARBINARY/BLOB). This happens during source start when inferRowTypeFromResultSet reads ResultSetMetaData.","commonSituations":"New or exotic Databend column types (e.g. GEOMETRY, VARIANT, unusual alias types) surfaced by a newer Databend server or a driver that reports a TINYINT/other type the converter misses; schema evolution after the connector was written.","solutions":["Check the logged sqlType and typeName to identify the offending column.","Update the connector (or Databend JDBC driver) to a version that maps the type explicitly.","Cast the column in your SQL query to a supported type, e.g. CAST(col AS VARCHAR) or CAST(col AS BINARY).","If the value is fine as a string, ignore the warning; STRING fallback preserves data as text."],"exampleFix":"// before\nSELECT geom FROM events\n// after\nSELECT CAST(geom AS VARCHAR) AS geom FROM events","handlingStrategy":"validation","validationCode":"int t = resultSetMetaData.getColumnType(i);\nboolean supported = t == Types.BOOLEAN || t == Types.TINYINT || t == Types.SMALLINT\n    || t == Types.INTEGER || t == Types.BIGINT || t == Types.FLOAT || t == Types.DOUBLE\n    || t == Types.DECIMAL || t == Types.CHAR || t == Types.VARCHAR || t == Types.LONGVARCHAR\n    || t == Types.DATE || t == Types.TIME || t == Types.TIMESTAMP\n    || t == Types.BINARY || t == Types.VARBINARY || t == Types.LONGVARBINARY || t == Types.BLOB;\nif (!supported) { /* cast column or adjust schema */ }","typeGuard":"// Java: narrow by SQL type before relying on the column type\nif (value instanceof String) { /* safe to use STRING-typed fallback value */ }","tryCatchPattern":null,"preventionTips":["Cast exotic columns (VARIANT, GEOMETRY) to VARCHAR/BINARY in the source SQL.","Keep the Databend JDBC driver and connector versions current.","Review the row type inferred at startup against the warning logs before running production jobs.","Test schemas with new Databend types in a dev environment first."],"tags":["jdbc","type-mapping","fallback","databend"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}