prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

array_position does not support arrays with elements that are null or contain null

What it means

NOT_SUPPORTED rejection in checkNotIndeterminate, used by array_position with an instance argument: the equality comparison for some array element returned an indeterminate (null) result, which happens when the array contains null elements; such arrays are unsupported by this variant.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ArrayPositionWithIndexFunction.java:253

                    if (result) {
                        instancesFound++;
                        if (instancesFound == instance) {
                            return i + 1; // result is 1-based (instead of 0)
                        }
                    }
                }
                catch (Throwable t) {
                    throw internalError(t);
                }
            }
        }
        return 0;
    }

    private static void checkNotIndeterminate(Boolean equalsResult)
    {
        if (equalsResult == null) {
            throw new PrestoException(NOT_SUPPORTED, "array_position does not support arrays with elements that are null or contain null");
        }
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Remove null elements from the array (filter with is not null) before calling array_position
  2. Use the two-argument array_position variant if it covers the use case
  3. Replace nulls with sentinel values before searching
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ArrayPositionWithIndexFunction.java:253 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.


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