{"record":{"id":"8d258c061f677620","repo":"apache/seatunnel","slug":"unknown-source-field","errorCode":"UNKNOWN_SOURCE_FIELD","errorMessage":"Field [%s] not found in source column","messagePattern":"Field \\[(.+?)\\] not found in source column","errorType":"error_code","errorClass":"SensorsDataException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/sensorsdata/format/record/RowAccessor.java","lineNumber":126,"sourceCode":"        Matcher matcher = EVENT_NAME_CONFIG_PATTERN.matcher(str);\n        if (matcher.find()) {\n            eventName = null;\n            eventColumnIndex = checkAndGetColumnIndex(matcher.group(1));\n        } else {\n            eventName = str;\n            eventColumnIndex = null;\n        }\n    }\n\n    private Integer checkAndGetColumnIndex(String columnName) {\n        if (StringUtils.isBlank(columnName)) {\n            return null;\n        }\n\n        Integer index = columnIndex.get(columnName);\n        if (index == null) {\n            String message = String.format(\"Field [%s] not found in source column\", columnName);\n            throw new SensorsDataException(SensorsDataErrorCode.UNKNOWN_SOURCE_FIELD, message);\n        }\n        return index;\n    }\n\n    private void checkTargetColumnConfigs() {\n        ArrayList<TargetColumnConfig> targetColumnConfigs =\n                new ArrayList<>(config.getPropertyFields());\n\n        if (config.getIdentityFields() != null) {\n            targetColumnConfigs.addAll(config.getIdentityFields());\n        }\n\n        List<String> unknownSourceFields =\n                targetColumnConfigs.stream()\n                        .map(TargetColumnConfig::getSource)\n                        .distinct()\n                        .filter(source -> !columnIndex.containsKey(source))\n                        .collect(toList());","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/sensorsdata/format/record/RowAccessor.java#L108-L144","documentation":"RowAccessor maps configured source fields to column indexes in the SensorsData event record. checkAndGetColumnIndex throws SensorsDataException with code UNKNOWN_SOURCE_FIELD when a requested field name has no entry in the parsed source column index map.","triggerScenarios":"A target column config (or event-name extraction field) references a field name that does not exist in the SensorsData JSON payload being read, and the accessor looks up its index.","commonSituations":"Typo in field name in the sink's field mapping config; SensorsData event schema changed (field renamed/removed); using a field only present in other event types.","solutions":["Print the available source column keys and compare with the configured field name to spot typos or casing differences","Update the field config to a name actually present in the SensorsData payload","If the field may be absent, remove it from required mappings or pre-filter events by event type","Pin/adjust to the SDK schema version matching your SensorsData data"],"exampleFix":"// before\nfield = \"distint_id\"; // typo\n// after\nfield = \"distinct_id\";","handlingStrategy":"validation","validationCode":"// before building config, verify field exists in a sample payload\nSet<String> available = samplePayload.keySet();\nif (!available.contains(configuredField)) throw new ConfigException(\"Field not in payload: \" + configuredField);","typeGuard":null,"tryCatchPattern":"try { accessor.getIndex(fieldName); } catch (SensorsDataException e) { if (SensorsDataErrorCode.UNKNOWN_SOURCE_FIELD.equals(e.getErrorCode())) { log.error(\"Unknown field {}, available: {}\", fieldName, availableColumns); } }","preventionTips":["Validate field mappings against a sample SensorsData payload before deploy","Watch for typos and casing in field names","Track SensorsData schema changes affecting your fields","Filter events by type so mappings match actual event schemas"],"tags":["sensorsdata","field-mapping","schema"],"backgroundTag":"resource-not-found","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"}