{"record":{"id":"81900f26dda66d19","repo":"prestodb/presto","slug":"error-from-native-plan-checker-s","errorCode":null,"errorMessage":"Error from native plan checker: %s","messagePattern":"Error from native plan checker: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-native-sidecar-plugin/src/main/java/com/facebook/presto/sidecar/nativechecker/NativePlanChecker.java","lineNumber":192,"sourceCode":"        return !isSystemPartitioning && !hasBucketToPartition;\n    }\n    private boolean isInternalSystemConnector(PlanNode planNode)\n    {\n        return planNode.accept(new CheckInternalVisitor(), null);\n    }\n\n    private void runValidation(SimplePlanFragment planFragment)\n    {\n        LOG.debug(\"Starting native plan validation [fragment: %s, root: %s]\", planFragment.getId(), planFragment.getRoot().getId());\n        String requestBodyJson = planFragmentJsonCodec.toJson(planFragment);\n        long start = System.nanoTime();\n\n        try {\n            StringResponse response = httpClient.execute(getSidecarRequest(requestBodyJson), createStringResponseHandler());\n            if (response.getStatusCode() != 200) {\n                NativeSidecarFailureInfo failure = processResponseFailure(response);\n                String message = String.format(\"Error from native plan checker: %s\", firstNonNull(failure.getMessage(), \"Internal error\"));\n                throw new PrestoException(failure::getErrorCode, message, failure.toException());\n            }\n        }\n        catch (RuntimeException e) {\n            if (e instanceof PrestoException) {\n                throw e;\n            }\n            throw new PrestoException(NATIVEPLANCHECKER_CONNECTION_ERROR, \"Error getting native plan checker response\", e);\n        }\n        finally {\n            Duration duration = new Duration(System.nanoTime() - start, TimeUnit.NANOSECONDS);\n            latency.add(duration);\n            LOG.debug(\"Fragment: %s, root: %s, native plan validation latencyMs=%d\", planFragment.getId(), planFragment.getRoot().getId(), duration.toMillis());\n            LOG.debug(\"Native plan validation complete [fragment: %s, root: %s]\", planFragment.getId(), planFragment.getRoot().getId());\n        }\n    }\n\n    private Request getSidecarRequest(String requestBodyJson)\n    {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-native-sidecar-plugin/src/main/java/com/facebook/presto/sidecar/nativechecker/NativePlanChecker.java#L174-L210","documentation":"NativePlanChecker.runValidation sends a serialized plan fragment to the native sidecar for validation. When the sidecar responds with a non-200 status, the failure info extracted from the response body is converted into a PrestoException whose message is 'Error from native plan checker: <failure message or Internal error>' and whose error code comes from the sidecar response.","triggerScenarios":"validateFragment -> runValidation where the HTTP response status code != 200; processResponseFailure extracts a NativeSidecarFailureInfo from the response and its message/error code is surfaced.","commonSituations":"Native engine unable to convert a Presto plan fragment (unsupported node/operator), incompatible Velox/native worker version, malformed plan JSON, sidecar internal error during plan conversion.","solutions":["Read the embedded failure message after the colon — it names the actual native conversion/validation problem.","Check for plan nodes unsupported by the native engine and rewrite the query or disable native execution for that fragment.","Verify native worker and sidecar versions match the coordinator.","Inspect sidecar logs around the request for the full conversion failure stack."],"exampleFix":"// before: query uses a node unsupported by native engine, fails validation\n// after: exclude that fragment from native execution\nset session native_execution=false; -- or upgrade native workers to a version supporting the node","handlingStrategy":"try-catch","validationCode":"// probe native compatibility before running heavy queries\nif (!nativePlanChecker.isHealthy()) { useJavaEngineForSession(); }","typeGuard":null,"tryCatchPattern":"try { validateFragment(fragment); }\ncatch (PrestoException e) {\n    if (e.getMessage().startsWith(\"Error from native plan checker:\")) {\n        log.warn(\"Native validation failed: %s; falling back to Java engine\", e.getMessage());\n        rerunOnJavaEngine(query);\n    } else throw e;\n}","preventionTips":["Keep native worker/sidecar versions in lockstep with the coordinator","Track which plan nodes the native engine supports","Enable per-fragment fallback to Java execution","Read the suffix of the message — it names the real native failure"],"tags":["native-engine","plan-validation","sidecar","http"],"backgroundTag":"native-plan-validation-failed","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"}