apache/seatunnel · warning
Both 'mappings' and 'schema_config' are present…
Error message
Both 'mappings' and 'schema_config' are present. 'schema_config' will be ignored. Please migrate to 'mappings'.
What it means
This warning is raised by HugeGraphSinkConfig.resolveMappings() when a job config supplies both the new 'mappings' option and the legacy 'schema_config' option. The connector prefers 'mappings' and silently discards 'schema_config'; the warning makes the ignored legacy block visible so users are not surprised that schema_config settings have no effect.
Solutions
- Delete the 'schema_config' block from the sink config, keeping only 'mappings'.
- If schema_config carried settings not yet expressed in mappings (labels, id strategy, properties), port them into the corresponding mapping entries first.
- Re-run the job and confirm the graph schema in HugeGraph matches expectations.
Example fix
// before
sink {
HugeGraph {
schema_config = {...}
mappings = [{type = "VERTEX", label = "person", properties = {id = "id"}}]
}
}
// after
sink {
HugeGraph {
mappings = [{type = "VERTEX", label = "person", id_strategy = "PRIMARY_KEY", properties = {id = "id"}}]
}
} Defensive patterns
Strategy: validation
Validate before calling
if (config.hasPath("mappings") && config.hasPath("schema_config")) {
throw new IllegalArgumentException("Only one of 'mappings' or 'schema_config' may be set; prefer 'mappings'");
} Prevention
- Keep only one mapping syntax in a config; delete schema_config after migrating to mappings
- Port all schema_config settings (labels, id strategy, properties) into mapping entries before removing it
- Add a CI check that flags configs containing both options
When it happens
Trigger: HugeGraph sink config contains both HugeGraphSinkOptions.MAPPINGS and HugeGraphSinkOptions.SCHEMA_CONFIG; resolveMappings() (called from of()) detects both present and logs that schema_config will be ignored.
Common situations: Partially migrated configs where the schema_config block was left in place after adding mappings; copied examples combining old and new syntax; operators unsure which option wins and leaving both 'just in case'.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- Option 'ignored_fields' is deprecated. Use 'properties'…
- Option 'selected_fields' is deprecated. Use 'properties'…
- Conflict between 'body' and dedicated Airtable options for…
- HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT
- HugeGraphConnectorErrorCode.INVALID_GRAPH_SCHEMA
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/d95b0c6974693750.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/config/HugeGraphSinkConfig.java:184
} else {
effectiveFields = new ArrayList<>(Arrays.asList(rowType.getFieldNames()));
if (ignoredFields != null && !ignoredFields.isEmpty()) {
Set<String> ignored = new HashSet<>(ignoredFields);
effectiveFields.removeIf(ignored::contains);
}
}
mappings.get(0).setProperties(effectiveFields);
}
private static List<MappingConfig> resolveMappings(
ReadonlyConfig config, HugeGraphSinkConfig sinkConfig) {
boolean hasMappings = config.getOptional(HugeGraphSinkOptions.MAPPINGS).isPresent();
boolean hasSchemaConfig =
config.getOptional(HugeGraphSinkOptions.SCHEMA_CONFIG).isPresent();
if (hasMappings) {
if (hasSchemaConfig) {
LOG.warn(
"Both 'mappings' and 'schema_config' are present. "
+ "'schema_config' will be ignored. Please migrate to 'mappings'.");
}
return config.get(HugeGraphSinkOptions.MAPPINGS);
}
if (hasSchemaConfig) {
SchemaConfig schemaConfig = config.get(HugeGraphSinkOptions.SCHEMA_CONFIG);
sinkConfig.setSchemaConfig(schemaConfig);
return Collections.singletonList(MappingConfig.fromLegacySchemaConfig(schemaConfig));
}
throw new HugeGraphConnectorException(
HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,
"Either 'mappings' or 'schema_config' must be specified. "
+ "'mappings' is the recommended option.");
}
View on GitHub (pinned to cf67b549a7)