prestodb/presto · error · PrestoException
Error from native plan checker: %s
Error message
Error from native plan checker: %s
What it means
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.
Source
Thrown at presto-native-sidecar-plugin/src/main/java/com/facebook/presto/sidecar/nativechecker/NativePlanChecker.java:192
return !isSystemPartitioning && !hasBucketToPartition;
}
private boolean isInternalSystemConnector(PlanNode planNode)
{
return planNode.accept(new CheckInternalVisitor(), null);
}
private void runValidation(SimplePlanFragment planFragment)
{
LOG.debug("Starting native plan validation [fragment: %s, root: %s]", planFragment.getId(), planFragment.getRoot().getId());
String requestBodyJson = planFragmentJsonCodec.toJson(planFragment);
long start = System.nanoTime();
try {
StringResponse response = httpClient.execute(getSidecarRequest(requestBodyJson), createStringResponseHandler());
if (response.getStatusCode() != 200) {
NativeSidecarFailureInfo failure = processResponseFailure(response);
String message = String.format("Error from native plan checker: %s", firstNonNull(failure.getMessage(), "Internal error"));
throw new PrestoException(failure::getErrorCode, message, failure.toException());
}
}
catch (RuntimeException e) {
if (e instanceof PrestoException) {
throw e;
}
throw new PrestoException(NATIVEPLANCHECKER_CONNECTION_ERROR, "Error getting native plan checker response", e);
}
finally {
Duration duration = new Duration(System.nanoTime() - start, TimeUnit.NANOSECONDS);
latency.add(duration);
LOG.debug("Fragment: %s, root: %s, native plan validation latencyMs=%d", planFragment.getId(), planFragment.getRoot().getId(), duration.toMillis());
LOG.debug("Native plan validation complete [fragment: %s, root: %s]", planFragment.getId(), planFragment.getRoot().getId());
}
}
private Request getSidecarRequest(String requestBodyJson)
{View on GitHub (pinned to 55bb57d202)
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.
Example fix
// before: query uses a node unsupported by native engine, fails validation // after: exclude that fragment from native execution set session native_execution=false; -- or upgrade native workers to a version supporting the node
Defensive patterns
Strategy: try-catch
Validate before calling
// probe native compatibility before running heavy queries
if (!nativePlanChecker.isHealthy()) { useJavaEngineForSession(); } Try / catch
try { validateFragment(fragment); }
catch (PrestoException e) {
if (e.getMessage().startsWith("Error from native plan checker:")) {
log.warn("Native validation failed: %s; falling back to Java engine", e.getMessage());
rerunOnJavaEngine(query);
} else throw e;
} Prevention
- 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
When it happens
Trigger: validateFragment -> runValidation where the HTTP response status code != 200; processResponseFailure extracts a NativeSidecarFailureInfo from the response and its message/error code is surfaced.
Common situations: 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.
Related errors
- NATIVEPLANCHECKER_UNKNOWN_CONVERSION_FAILURE
- INVALID_ARGUMENTS
- NATIVEPLANCHECKER_CONNECTION_ERROR
- GENERIC_INTERNAL_ERROR
- Response does not contain a JSON value
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/81900f26dda66d19.
Report an issue: GitHub.