{"record":{"id":"100c7412a111b700","repo":"apache/seatunnel","slug":"hugegraphconnectorerrorcode-invalid-graph-schema-100c74","errorCode":"HugeGraphConnectorErrorCode.INVALID_GRAPH_SCHEMA","errorMessage":"Mapping[%s/%s]: Source field '%s' for target property '%s' not found in input row. Available fields: %s","messagePattern":"Mapping\\[(.+?)/(.+?)\\]: Source field '(.+?)' for target property '(.+?)' not found in input row\\. Available fields: (.+?)","errorType":"error_code","errorClass":"HugeGraphConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/utils/SchemaManager.java","lineNumber":240,"sourceCode":"    private static void removeIdFields(\n            Set<String> fields, MappingConfig.SourceTargetConfig sourceTargetConfig) {\n        if (sourceTargetConfig != null && sourceTargetConfig.getIdFields() != null) {\n            fields.removeAll(sourceTargetConfig.getIdFields());\n        }\n    }\n\n    private void createMissingPropertyKeys(MappingConfig mapping, Set<String> targetPropertyNames) {\n        Map<String, String> fieldMapping = mapping.getFieldMapping();\n\n        for (String targetProp : targetPropertyNames) {\n            if (client.getPropertyKeyOrNull(targetProp) != null) {\n                continue;\n            }\n\n            String sourceField = findSourceField(targetProp, fieldMapping);\n            int fieldIndex = findFieldIndex(sourceField);\n            if (fieldIndex < 0) {\n                throw new HugeGraphConnectorException(\n                        HugeGraphConnectorErrorCode.INVALID_GRAPH_SCHEMA,\n                        String.format(\n                                \"Mapping[%s/%s]: Source field '%s' for target property '%s' \"\n                                        + \"not found in input row. Available fields: %s\",\n                                mapping.getType(),\n                                mapping.getLabel(),\n                                sourceField,\n                                targetProp,\n                                getFieldNames()));\n            }\n\n            SeaTunnelDataType<?> seaType = rowType.getFieldType(fieldIndex);\n            DataType hgType = inferHugeGraphDataType(seaType, mapping, targetProp);\n            Cardinality cardinality = inferCardinality(seaType);\n\n            LOG.info(\n                    \"Mapping[{}/{}]: Auto-creating PropertyKey '{}' with type={}, cardinality={}\",\n                    mapping.getType(),","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/utils/SchemaManager.java#L222-L258","documentation":"SchemaManager.createMissingPropertyKeys resolves each target HugeGraph property back to a source row field via the configured field_mapping. When the resolved source field is not a column of the input row (fieldIndex < 0), the connector throws INVALID_GRAPH_SCHEMA listing the available fields, because it cannot populate the required PropertyKey.","triggerScenarios":"ensureSchema runs with a mapping whose field_mapping refers to a source field name that does not exist in the incoming SeaTunnel row (typo, wrong case, column removed upstream, or target property name not present in the row when mapping is empty).","commonSituations":"Rename of an upstream column without updating field_mapping; copy-pasted mapping config from another job; catalog column filtering (e.g. Transform Drop) removing the mapped field before the sink.","solutions":["Correct field_mapping so every target property maps to an existing source field (compare against the 'Available fields' list in the message).","Add the missing column upstream or via a Transform (e.g. SQL/FieldMapper) before the HugeGraph sink.","Remove the field_mapping entry for properties you do not intend to write.","Check case sensitivity: SeaTunnel row field names must match exactly."],"exampleFix":"// before\nfield_mapping = {\n  user_name = \"name\"\n}\n// after (source row has column 'username')\nfield_mapping = {\n  username = \"name\"\n}","handlingStrategy":"validation","validationCode":"// Verify every field_mapping source field exists in the SeaTunnel row type\nSet<String> rowFields = catalogTable.getTableSchema()\n    .getFieldNames().stream().collect(Collectors.toSet());\nfor (String sourceField : fieldMapping.keySet()) {\n  if (!rowFields.contains(sourceField)) {\n    throw new IllegalArgumentException(\"Mapped source field not in row: \" + sourceField\n        + \"; available: \" + rowFields);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  sink.write(row);\n} catch (HugeGraphConnectorException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Mapping[\")) {\n    log.error(\"Field mapping references a missing column: {}\", e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Regenerate field_mapping whenever upstream columns change","SeaTunnel field names are case-sensitive — match exactly","Print the input row schema during development and diff against field_mapping","Avoid Transform Drop of columns that are still mapped in the sink"],"tags":["hugegraph","schema","field-mapping","config"],"backgroundTag":"schema-validation-failed","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"}