{"record":{"id":"f56c2f97f2998ffd","repo":"apache/seatunnel","slug":"not-support-convert-to-milvus-type-sqltype-is-s","errorCode":null,"errorMessage":"Not support convert to milvus type, sqlType is %s","messagePattern":"Not support convert to milvus type, sqlType is (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/utils/sink/MilvusSinkConverter.java","lineNumber":301,"sourceCode":"                return DataType.Array;\n            case MAP:\n                return DataType.JSON;\n            case FLOAT_VECTOR:\n                return DataType.FloatVector;\n            case BINARY_VECTOR:\n                return DataType.BinaryVector;\n            case FLOAT16_VECTOR:\n                return DataType.Float16Vector;\n            case BFLOAT16_VECTOR:\n                return DataType.BFloat16Vector;\n            case SPARSE_FLOAT_VECTOR:\n                return DataType.SparseFloatVector;\n            case DATE:\n                return DataType.VarChar;\n            case ROW:\n                return DataType.VarChar;\n        }\n        throw new CatalogException(\n                String.format(\"Not support convert to milvus type, sqlType is %s\", sqlType));\n    }\n\n    public JsonObject buildMilvusData(\n            CatalogTable catalogTable,\n            ReadonlyConfig config,\n            List<String> jsonFields,\n            String dynamicField,\n            SeaTunnelRow element) {\n        SeaTunnelRowType seaTunnelRowType = catalogTable.getSeaTunnelRowType();\n        PrimaryKey primaryKey = catalogTable.getTableSchema().getPrimaryKey();\n        Boolean autoId = config.get(ENABLE_AUTO_ID);\n        Boolean enableNullableField = config.get(ENABLE_NULLABLE_FIELD);\n        String partitionKeyField = getPartitionKeyField(catalogTable, config);\n\n        JsonObject data = new JsonObject();\n        Gson gson = new Gson();\n        for (int i = 0; i < seaTunnelRowType.getFieldNames().length; i++) {","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/utils/sink/MilvusSinkConverter.java#L283-L319","documentation":"MilvusSinkConverter.convertSqlTypeToDataType throws a plain CatalogException when a SeaTunnel SqlType has no mapping to a Milvus DataType. Unlike NOT_SUPPORT_TYPE, this fires during schema conversion (building FieldType definitions from CatalogTable columns), not during data serialization, and is a bare IllegalArgumentException-style failure with the offending SqlType formatted in.","triggerScenarios":"convertToFieldType encounters a CatalogTable column whose SqlType is not in the switch's mapped cases (e.g. MAP, complex or newer types), so control reaches the throw after the switch while constructing the Milvus collection schema.","commonSituations":"Sink tables whose schema includes unmappable columns (nested MAP, Decimal in some versions, TIME types), schema evolution introducing new types, or auto-creating Milvus collections from heterogeneous upstream sources.","solutions":["Identify the offending SqlType from the message and reshape the upstream schema — cast or drop that column via a transform","Map exotic columns to supported Milvus types (VARCHAR for ROW/DATE, JSON strings) before the sink","Define the Milvus collection schema manually instead of relying on auto schema conversion","Upgrade the connector if a newer version maps that SqlType"],"exampleFix":"// before: MAP column reaching schema conversion\nSchema {\n  field { name = \"attrs\" type = map<string, string> }\n}\n// after: serialize MAP to JSON string upstream\ntransform = Sql {\n  query = \"SELECT id, to_json(attrs) AS attrs_json, embedding FROM src\"\n} // declare attrs_json as string -> VarChar","handlingStrategy":"validation","validationCode":"// Validate every column maps to a Milvus DataType before auto schema creation\nfor (Column c : catalogTable.getTableSchema().getColumns()) {\n  if (Set.of(SqlType.MAP, SqlType.NULL, SqlType.TIME).contains(c.getSqlType()))\n    throw new IllegalStateException(\"Pre-convert column \" + c.getName()\n        + \" (\" + c.getSqlType() + \") to a Milvus-mappable type\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  converter.convertToFieldType(column, catalogTable);\n} catch (CatalogException e) {\n  logger.error(\"Milvus type mapping failed: {}\", e.getMessage()); // names the SqlType\n  // reshape schema or declare the collection schema manually\n}","preventionTips":["Avoid MAP/nested columns in tables feeding Milvus; serialize them to JSON strings upstream","Use explicit upstream casts to STRING/arrays for exotic types","Define the Milvus collection schema manually when auto-mapping is fragile","Review the connector's SqlType->DataType switch when upgrading source schemas"],"tags":["milvus","sink","schema","type-conversion","unsupported-type"],"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"}