{"record":{"id":"e00ddffcda2ffdb2","repo":"apache/seatunnel","slug":"unsupported-yashandb-vector-value-type-classnam","errorCode":null,"errorMessage":"Unsupported YashanDB vector value type: ${className}","messagePattern":"Unsupported YashanDB vector value type: (.+?)","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbJdbcRowConverter.java","lineNumber":185,"sourceCode":"                return;\n            }\n            Object[] array = (Object[]) value;\n            setArray(statement, (ArrayType<?, ?>) seaTunnelDataType, statementIndex, array);\n            return;\n        }\n        if (isFloatVectorType(sqlType)) {\n            if (value == null) {\n                statement.setNull(statementIndex, java.sql.Types.VARCHAR);\n            } else if (value instanceof ByteBuffer) {\n                statement.setObject(\n                        statementIndex,\n                        Vector.ofFloat32Values(toFloat32VectorValues(value, sqlType)));\n            } else if (value instanceof Object[]) {\n                statement.setObject(\n                        statementIndex,\n                        Vector.ofFloat32Values(toFloat32VectorValues(value, sqlType)));\n            } else {\n                throw new SQLException(\n                        \"Unsupported YashanDB vector value type: \" + value.getClass().getName());\n            }\n            return;\n        }\n        super.setValueToStatementByDataType(\n                value, statement, seaTunnelDataType, statementIndex, sourceType);\n    }\n\n    private static boolean isFloatVectorType(SqlType sqlType) {\n        return SqlType.FLOAT_VECTOR.equals(sqlType)\n                || SqlType.FLOAT16_VECTOR.equals(sqlType)\n                || SqlType.BFLOAT16_VECTOR.equals(sqlType);\n    }\n\n    private static ByteBuffer convertToVectorBuffer(Object vectorValue) {\n        if (vectorValue == null) {\n            return null;\n        }","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbJdbcRowConverter.java#L167-L203","documentation":"When binding a SeaTunnel VECTOR-typed value to a PreparedStatement, YashanDbJdbcRowConverter only knows how to serialize float arrays, primitive arrays, and Object[] into YashanDB Vector values. A value of any other Java type cannot be converted, so an SQLException naming the value's class is thrown.","triggerScenarios":"setValueToStatementByDataType() is called for a VECTOR column whose SeaTunnelRow field is not a float[], Float[], primitive array, or Object[] — e.g. a String, byte[], List<Float>, or null-wrapped object produced upstream.","commonSituations":"Embedding vectors produced by an ML pipeline where the field arrives as List<Float> or JSON-decoded arrays rather than SeaTunnel array types; mis-declared sink schema where a text/bytea field is mapped as VECTOR.","solutions":["Convert the upstream value to a float[] (or Object[] of floats) before the sink, e.g. via a transform or by fixing the source mapping","Verify the source column is genuinely a vector type and mapped to SeaTunnel ARRAY<FLOAT> / VECTOR, not string/bytes","Cast explicitly: if the value is a List<Float>, stream-map to float[] before writing","Update the connector to add serialization for the offending value class"],"exampleFix":"// before\nfloat[] vec = (String) value; // fails\n// after\nfloat[] vec = ((List<Float>) value).stream().map(Float::floatValue)\n        .collect(Collectors.toList()).stream()\n        .mapToInt(Float::intValue)... // better: convert to float[] explicitly before writing","handlingStrategy":"type-guard","validationCode":"Object v = row.getField(vectorFieldIndex);\nif (!(v instanceof float[] || v instanceof Float[] || v instanceof Object[])) throw new IllegalArgumentException(\"vector field must be float array\");","typeGuard":"static boolean isVectorValue(Object v) {\n    return v instanceof float[] || v instanceof Float[] || v instanceof Object[];\n}","tryCatchPattern":"try {\n    converter.setToStatement(stmt, idx, dataType, value, sourceType);\n} catch (SQLException e) {\n    if (e.getMessage().startsWith(\"Unsupported YashanDB vector value type\")) {\n        value = toFloatArray(value); // normalize and retry\n    } else throw e;\n}","preventionTips":["Normalize embeddings to float[] before the sink (transform step)","Map vector columns as ARRAY<FLOAT>/VECTOR in source schema, not string/bytes","Add a schema check job that validates field Java types per column before writing"],"tags":["jdbc","yashandb","vector","type-conversion"],"backgroundTag":"type-mismatch","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}