apache/seatunnel · error · TypesenseConnectorException

QUERY_PARAM_ERROR

QUERY_PARAM_ERROR

Error message

Query parameter error: 

What it means

URLParamsConverter.parseParams parses a URL query string into a map by splitting on '&' then on '=' (max 2 parts). If any '&'-separated part does not contain exactly one '=' separator, it throws TypesenseConnectorException(QUERY_PARAM_ERROR, "Query parameter error: " + Arrays.toString(keyValue)).

Solutions

  1. Ensure every parameter is of the form key=value with no bare keys or trailing '&'.
  2. Remove empty segments (e.g. 'a=1&&b=2' or 'a=1&').
  3. Encode values so literal '=' is percent-encoded, or pass parameters as a map if the config supports it.

Example fix

// before
params = "filter_by=num_employees>100&pretty"
// after
params = "filter_by=num_employees>100&pretty=true" // every token must be key=value
Defensive patterns

Strategy: validation

Validate before calling

// validate the params string before handing it to the connector
if (params.endsWith("&") || Arrays.stream(params.split("&"))
        .anyMatch(p -> !p.contains("=") || p.isEmpty())) {
    throw new IllegalArgumentException("every param must be key=value: " + params);
}

Try / catch

try {
    Map<String, String> m = URLParamsConverter.parseParams(params);
} catch (TypesenseConnectorException e) {
    // fix the offending key=value token reported in the message
}

Prevention

When it happens

Trigger: Passing a params string containing a token without '=' — e.g. a bare flag ('debug'), a trailing '&' producing an empty part, or a URL fragment — into the Typesense URL-params configuration.

Common situations: Copy-pasted query strings with trailing '&'; boolean flags written as bare keys instead of key=value; params containing encoded '=' inside values combined with other typos.

Understand the failure class

Background: "Invalid query parameter" / "Failed to parse value of ...": fixing bad query string parameters across APIs — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/util/URLParamsConverter.java:55

                        () ->
                                new IllegalArgumentException(
                                        "Parameter string must not be null or empty."));
    }

    private static Map<String, String> parseParams(String paramsString) {
        return Arrays.stream(
                        Optional.ofNullable(paramsString)
                                .filter(s -> !s.isEmpty())
                                .orElseThrow(
                                        () ->
                                                new IllegalArgumentException(
                                                        "Parameter string must not be null or empty."))
                                .split("&"))
                .map(part -> part.split("=", 2))
                .peek(
                        keyValue -> {
                            if (keyValue.length != 2) {
                                throw new TypesenseConnectorException(
                                        TypesenseConnectorErrorCode.QUERY_PARAM_ERROR,
                                        "Query parameter error: " + Arrays.toString(keyValue));
                            }
                        })
                .collect(Collectors.toMap(keyValue -> keyValue[0], keyValue -> keyValue[1]));
    }
}

View on GitHub (pinned to cf67b549a7)