{"record":{"id":"af76dbe7897ef33f","repo":"prestodb/presto","slug":"not-supported-af76db","errorCode":"NOT_SUPPORTED","errorMessage":"array_position does not support arrays with elements that are null or contain null","messagePattern":"array_position does not support arrays with elements that are null or contain null","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ArrayPositionWithIndexFunction.java","lineNumber":253,"sourceCode":"                    if (result) {\n                        instancesFound++;\n                        if (instancesFound == instance) {\n                            return i + 1; // result is 1-based (instead of 0)\n                        }\n                    }\n                }\n                catch (Throwable t) {\n                    throw internalError(t);\n                }\n            }\n        }\n        return 0;\n    }\n\n    private static void checkNotIndeterminate(Boolean equalsResult)\n    {\n        if (equalsResult == null) {\n            throw new PrestoException(NOT_SUPPORTED, \"array_position does not support arrays with elements that are null or contain null\");\n        }\n    }\n}\n","sourceCodeStart":235,"sourceCodeEnd":257,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ArrayPositionWithIndexFunction.java#L235-L257","documentation":"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.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ArrayPositionWithIndexFunction.java:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove null elements from the array (filter with is not null) before calling array_position","Use the two-argument array_position variant if it covers the use case","Replace nulls with sentinel values before searching"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}