prestodb/presto · error · IllegalArgumentException

Invalid property tpcds.splits-per-node

Error message

Invalid property tpcds.splits-per-node

What it means

TpcdsConnectorFactory.getSplitsPerNode() parses the tpcds.splits-per-node catalog property, defaulting when absent. A non-integer value causes parseInt to throw NumberFormatException, which is rethrown as IllegalArgumentException("Invalid property tpcds.splits-per-node"). This fails connector creation so a bad catalog config is caught at startup.

Source

Thrown at presto-tpcds/src/main/java/com/facebook/presto/tpcds/TpcdsConnectorFactory.java:128

            @Override
            public ConnectorCodecProvider getConnectorCodecProvider()
            {
                return new ThriftCodecProvider.Builder().setThriftCodecManager(new ThriftCodecManager())
                        .setConnectorSplitType(TpcdsSplit.class)
                        .setConnectorTransactionHandle(TpcdsTransactionHandle.class)
                        .setConnectorTableLayoutHandle(TpcdsTableLayoutHandle.class)
                        .setConnectorTableHandle(TpcdsTableHandle.class).build();
            }
        };
    }

    private int getSplitsPerNode(Map<String, String> properties)
    {
        try {
            return parseInt(firstNonNull(properties.get("tpcds.splits-per-node"), String.valueOf(defaultSplitsPerNode)));
        }
        catch (NumberFormatException e) {
            throw new IllegalArgumentException("Invalid property tpcds.splits-per-node");
        }
    }

    private boolean useVarcharType(Map<String, String> properties)
    {
        try {
            return parseBoolean(firstNonNull(properties.get("tpcds.use-varchar-type"), String.valueOf(false)));
        }
        catch (NumberFormatException e) {
            throw new IllegalArgumentException("Invalid property tpcds.use-varchar-type");
        }
    }

    private boolean isWithNoSexism(Map<String, String> properties)
    {
        return parseBoolean(firstNonNull(properties.get("tpcds.with-no-sexism"), String.valueOf(false)));
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Set tpcds.splits-per-node to a plain integer (e.g., tpcds.splits-per-node=4) in the catalog properties
  2. Remove the property entirely to use the default
  3. Check for hidden whitespace/quotes or unresolved template variables in the properties file

Example fix

// before
tpcds.splits-per-node=${SPLITS_PER_NODE}  # unresolved template -> IllegalArgumentException
// after
tpcds.splits-per-node=8
Defensive patterns

Strategy: validation

Validate before calling

String raw = properties.get("tpcds.splits-per-node");
if (raw != null && !raw.matches("\\d+")) {
    throw new IllegalArgumentException("tpcds.splits-per-node must be an integer, got: " + raw);
}

Prevention

When it happens

Trigger: Catalog properties contain tpcds.splits-per-node set to a non-numeric string (e.g., "ten", "1.5", or a value with stray whitespace/units).

Common situations: Hand-edited catalog properties; templating mistakes leaving placeholder text like ${SPLITS}; units accidentally appended to the number; copy-paste from docs with wrong value.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/460a61409d443b55. Report an issue: GitHub.