prestodb/presto · error · PrestoException

INVALID_FUNCTION_ARGUMENT

INVALID_FUNCTION_ARGUMENT

Error message

In differential_entropy UDF, invalid method: %s

What it means

Validation in DifferentialEntropyStateStrategy.getStrategy: the 'method' argument of differential_entropy does not match any known strategy name (fixed histogram MLE/Jackknife, vector ML, etc.), so no state strategy can be constructed for the call.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/differentialentropy/DifferentialEntropyStateStrategy.java:57

    static DifferentialEntropyStateStrategy getStrategy(
            DifferentialEntropyStateStrategy strategy,
            long size,
            double sample,
            double weight,
            String method,
            double min,
            double max)
    {
        if (strategy == null) {
            switch (method) {
                case DifferentialEntropyStateStrategy.FIXED_HISTOGRAM_MLE_METHOD_NAME:
                    strategy = new FixedHistogramMleStateStrategy(size, min, max);
                    break;
                case DifferentialEntropyStateStrategy.FIXED_HISTOGRAM_JACKNIFE_METHOD_NAME:
                    strategy = new FixedHistogramJacknifeStateStrategy(size, min, max);
                    break;
                default:
                    throw new PrestoException(
                            INVALID_FUNCTION_ARGUMENT,
                            format("In differential_entropy UDF, invalid method: %s", method));
            }
        }
        else {
            switch (method) {
                case DifferentialEntropyStateStrategy.FIXED_HISTOGRAM_MLE_METHOD_NAME:
                    if (!(strategy instanceof FixedHistogramMleStateStrategy)) {
                        throw new PrestoException(
                                INVALID_FUNCTION_ARGUMENT,
                                format("In differential_entropy, strategy class is not compatible with entropy method: %s %s", strategy.getClass().getSimpleName(), method));
                    }
                    break;
                case DifferentialEntropyStateStrategy.FIXED_HISTOGRAM_JACKNIFE_METHOD_NAME:
                    if (!(strategy instanceof FixedHistogramJacknifeStateStrategy)) {
                        throw new PrestoException(
                                INVALID_FUNCTION_ARGUMENT,
                                format("In differential_entropy, strategy class is not compatible with entropy method: %s %s", strategy.getClass().getSimpleName(), method));

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use one of the documented method names (e.g. 'fixed_histogram_mle', 'fixed_histogram_jackknife')
  2. Check for typos and case sensitivity in the method string argument
  3. Omit the method argument to use the default strategy
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/differentialentropy/DifferentialEntropyStateStrategy.java:57 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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