prestodb/presto · error · ParseError
ConnectorTableHandle ConnectorTableHandle
Error message
ConnectorTableHandle ConnectorTableHandle
What it means
from_json for std::shared_ptr<ConnectorTableHandle> extracts the subclass discriminator via getSubclassKey(j); a json::parse_error during that step is wrapped and rethrown as ParseError(std::string(e.what()) + " ConnectorTableHandle ConnectorTableHandle"). It is thrown before any subtype dispatch, meaning the JSON itself could not be parsed/read rather than the handle type being unknown.
Source
Thrown at presto-native-execution/presto_cpp/presto_protocol/core/presto_protocol_core.cpp:1183
from_json_key(j, "type", p.type, "AllOrNoneValueSet", "Type", "type");
from_json_key(j, "all", p.all, "AllOrNoneValueSet", "bool", "all");
}
} // namespace facebook::presto::protocol
namespace facebook::presto::protocol {
void to_json(json& j, const std::shared_ptr<ConnectorTableHandle>& p) {
if (p == nullptr) {
return;
}
String type = p->_type;
getConnectorProtocol(type).to_json(j, p);
}
void from_json(const json& j, std::shared_ptr<ConnectorTableHandle>& p) {
String type;
try {
type = p->getSubclassKey(j);
} catch (json::parse_error& e) {
throw ParseError(
std::string(e.what()) + " ConnectorTableHandle ConnectorTableHandle");
}
if (j.contains("customSerializedValue")) {
VELOX_CHECK(
!type.empty() && type[0] != '$',
"Internal handle type '{}' should not have customSerializedValue",
type);
std::string binaryData = velox::encoding::Base64::decode(
j["customSerializedValue"].get<std::string>());
getConnectorProtocol(type).deserialize(binaryData, p);
return;
}
getConnectorProtocol(type).from_json(j, p);
}
} // namespace facebook::presto::protocol
// dependency TpchTransactionHandleView on GitHub (pinned to 55bb57d202)
Solutions
- Inspect the prepended nlohmann parse_error text for the exact cause and byte offset.
- Log the raw JSON body before from_json to verify it is a complete JSON object with '@type'.
- Validate HTTP status/content-type and reject error bodies before deserializing handles.
- Align coordinator/native versions if the handle serialization format changed.
Example fix
// before: j.get_to / from_json directly on response body
// from_json(j, tableHandle); // ParseError: syntax error while parsing...
// after: validate first
// if (!j.is_object() || !j.contains("@type")) throw std::invalid_argument("not a ConnectorTableHandle payload");
// from_json(j, tableHandle); Defensive patterns
Strategy: validation
Validate before calling
// Validate table handle payload before deserialization
bool isValidConnectorTableHandlePayload(const nlohmann::json& j) {
return j.is_object() && j.contains("@type") && j["@type"].is_string();
}
// nlohmann::json j = nlohmann::json::parse(body, nullptr, false);
// if (j.is_discarded() || !isValidConnectorTableHandlePayload(j)) throw std::invalid_argument("bad table handle json"); Try / catch
try {
from_json(j, tableHandle);
} catch (const facebook::presto::protocol::ParseError& e) {
LOG(ERROR) << "ConnectorTableHandle payload unparseable: " << e.what();
// re-request or rebuild the handle payload
} Prevention
- Reject non-object/error-response bodies before handle deserialization.
- Guard large handle payloads against transport truncation (check content-length).
- Use json::parse with allow_exceptions=false as a pre-filter.
- Version-align coordinator and native workers.
When it happens
Trigger: Calling from_json(json, std::shared_ptr<ConnectorTableHandle>&) with malformed JSON, a non-object document, or one missing the '@type' discriminator — e.g. a table handle payload corrupted in transit or an error response fed to the handle deserializer.
Common situations: Corrupted exchange messages between coordinator and native worker; deserializing an error/HTML body as a table handle; truncation of large handle payloads over HTTP; protocol change altering the discriminator key.
Related errors
- PlanNode PlanNode
- {parse_error} ConnectorTransactionHandle ConnectorTransacti
- {parse_error} ExecutionWriterTarget ExecutionWriterTarget
- {parse_error} ConnectorSplit
- no abstract type PlanNode
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/50ccd03237634ca4.
Report an issue: GitHub.