apache/seatunnel · warning

Option 'selected_fields' is deprecated. Use 'properties'…

Error message

Option 'selected_fields' is deprecated. Use 'properties' within each mapping instead.

What it means

This is a deprecation warning emitted by HugeGraphSinkConfig.of() while parsing job config. The 'selected_fields' option is still parsed and applied (it sets selectedFields on the sink config) for backward compatibility, but new field selection is expressed via 'properties' inside each mapping entry. The warning tells you the config will break in a future release and how to migrate.

Solutions

  1. Remove 'selected_fields' from the sink config and declare the fields you want in the 'properties' map of each mapping entry (label -> field mapping).
  2. If the behavior of the legacy option differs from what you need, explicitly map each desired SeaTunnel column to a HugeGraph property name inside mappings.
  3. Verify the resulting vertex/edge property set with a small batch job; the deprecated option is applied only when present, so removal should not change output once mappings carry 'properties'.

Example fix

// before
sink {
  HugeGraph {
    selected_fields = ["id", "name"]
  }
}
// after
sink {
  HugeGraph {
    mappings = [
      {
        type = "VERTEX"
        label = "person"
        properties = {id = "id", name = "name"}
      }
    ]
  }
}
Defensive patterns

Strategy: validation

Validate before calling

if (config.hasPath("selected_fields")) {
    throw new IllegalArgumentException("selected_fields is deprecated; declare fields in mappings[].properties instead");
}

Prevention

When it happens

Trigger: A SeaTunnel HugeGraph sink job config contains the top-level option 'selected_fields' (HugeGraphSinkOptions.SELECTED_FIELDS); HugeGraphSinkConfig.of() reads it via config.getOptional and logs the warning before assigning it.

Common situations: Configs copied from old documentation or pre-migration examples; users upgrading from versions where field selection was a flat option rather than per-mapping 'properties'; mixed configs where some mappings already use 'properties' but the legacy option lingers.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/cb26834af504e7bc. 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:138

                        .orElse(
                                legacyConfig
                                        ? true
                                        : HugeGraphSinkOptions.DELETE_VERTEX_WITH_EDGES
                                                .defaultValue()));
        sinkConfig.setAllowCascadeDeleteUnmappedEdges(
                config.getOptional(HugeGraphSinkOptions.ALLOW_CASCADE_DELETE_UNMAPPED_EDGES)
                        .orElse(
                                HugeGraphSinkOptions.ALLOW_CASCADE_DELETE_UNMAPPED_EDGES
                                        .defaultValue()));
        sinkConfig.setDataSaveMode(
                config.getOptional(HugeGraphSinkOptions.DATA_SAVE_MODE)
                        .orElse(HugeGraphSinkOptions.DATA_SAVE_MODE.defaultValue()));

        // Deprecated fields (parse but warn)
        config.getOptional(HugeGraphSinkOptions.SELECTED_FIELDS)
                .ifPresent(
                        fields -> {
                            LOG.warn(
                                    "Option 'selected_fields' is deprecated. Use 'properties' within each mapping instead.");
                            sinkConfig.setSelectedFields(fields);
                        });
        config.getOptional(HugeGraphSinkOptions.IGNORED_FIELDS)
                .ifPresent(
                        fields -> {
                            LOG.warn(
                                    "Option 'ignored_fields' is deprecated. Use 'properties' within each mapping instead.");
                            sinkConfig.setIgnoredFields(fields);
                        });

        return sinkConfig;
    }

    /**
     * Converts legacy global field selection into the mapping property list. The old writer ignored
     * {@code schema_config.properties} and wrote all fields after applying selected/ignored fields,
     * so preserving that behavior requires the input row schema.

View on GitHub (pinned to cf67b549a7)