apache/seatunnel · error · IllegalArgumentException

Option 'field_delimiter' cannot be empty

Error message

Option 'field_delimiter' cannot be empty

What it means

GooglePubSubSinkConfig.from() requires field_delimiter to be non-empty when message format is TEXT, because TEXT messages are split into attributes using this delimiter; an empty delimiter would make parsing impossible. The check throws IllegalArgumentException during sink configuration.

Source

Thrown at seatunnel-connectors-v2/connector-google-pubsub/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/pubsub/config/GooglePubSubSinkConfig.java:55

    public static GooglePubSubSinkConfig from(ReadonlyConfig config) {
        String projectId = config.get(GooglePubSubSinkOptions.PROJECT_ID);
        String topic = config.get(GooglePubSubSinkOptions.TOPIC);
        String credentialsPath = config.get(GooglePubSubSinkOptions.CREDENTIALS_PATH);
        String emulatorHost = config.get(GooglePubSubSinkOptions.EMULATOR_HOST);
        MessageFormat format = config.get(GooglePubSubSinkOptions.FORMAT);
        String fieldDelimiter = config.get(GooglePubSubSinkOptions.FIELD_DELIMITER);

        requireNonBlank(projectId, GooglePubSubSinkOptions.PROJECT_ID.key());
        requireNonBlank(topic, GooglePubSubSinkOptions.TOPIC.key());
        requireNonBlankIfPresent(credentialsPath, GooglePubSubSinkOptions.CREDENTIALS_PATH.key());
        requireNonBlankIfPresent(emulatorHost, GooglePubSubSinkOptions.EMULATOR_HOST.key());
        if (credentialsPath != null && emulatorHost != null) {
            throw new IllegalArgumentException(
                    "Options 'credentials_path' and 'emulator_host' cannot be configured together");
        }
        if (format == MessageFormat.TEXT && fieldDelimiter.isEmpty()) {
            throw new IllegalArgumentException("Option 'field_delimiter' cannot be empty");
        }

        return GooglePubSubSinkConfig.builder()
                .projectId(projectId)
                .topic(topic)
                .credentialsPath(credentialsPath)
                .emulatorHost(emulatorHost)
                .format(format)
                .fieldDelimiter(fieldDelimiter)
                .build();
    }

    private static void requireNonBlank(String value, String option) {
        if (value == null || value.trim().isEmpty()) {
            throw new IllegalArgumentException("Option '" + option + "' cannot be blank");
        }
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set a non-empty field_delimiter (e.g. ",") in the sink config.
  2. Or switch format to JSON, which does not require a delimiter.
  3. Check that any variable used for field_delimiter resolves to a non-empty value.

Example fix

// before
format = TEXT
field_delimiter = ""
// after
format = TEXT
field_delimiter = ","
Defensive patterns

Strategy: validation

Validate before calling

// before building the sink config
if (format == MessageFormat.TEXT && (fieldDelimiter == null || fieldDelimiter.isEmpty())) {
  throw new IllegalArgumentException("TEXT format requires a non-empty field_delimiter");
}

Try / catch

try {
  GooglePubSubSinkConfig.from(config);
} catch (IllegalArgumentException e) {
  if (e.getMessage().contains("field_delimiter")) {
    log.error("Set field_delimiter (e.g. ',') or switch format to JSON");
  } else throw e;
}

Prevention

When it happens

Trigger: Configuring format = TEXT (or leaving the default that resolves to TEXT) with field_delimiter = "" — e.g. field_delimiter = "${empty}" or an unset variable resolving to empty string.

Common situations: Hocon variable interpolation resolving to empty; copy-pasting a config that blanked the delimiter; thinking the delimiter is optional for TEXT format.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/95cdbc07969dfaed. Report an issue: GitHub.