{"record":{"id":"5923811c542a2c68","repo":"prestodb/presto","slug":"parse-error-connectorinserttablehandle-connecto","errorCode":null,"errorMessage":"{parse_error} ConnectorInsertTableHandle  ConnectorInsertTableHandle","messagePattern":"(.+?) ConnectorInsertTableHandle  ConnectorInsertTableHandle","errorType":"validation","errorClass":"ParseError","httpStatus":null,"severity":"error","filePath":"presto-native-execution/presto_cpp/presto_protocol/core/presto_protocol_core.cpp","lineNumber":6627,"sourceCode":"      \"TupleDomain<std::shared_ptr<ColumnHandle>>\",\n      \"currentConstraint\");\n}\n} // namespace facebook::presto::protocol\nnamespace facebook::presto::protocol {\nvoid to_json(json& j, const std::shared_ptr<ConnectorInsertTableHandle>& p) {\n  if (p == nullptr) {\n    return;\n  }\n  String type = p->_type;\n  getConnectorProtocol(type).to_json(j, p);\n}\n\nvoid from_json(const json& j, std::shared_ptr<ConnectorInsertTableHandle>& p) {\n  String type;\n  try {\n    type = p->getSubclassKey(j);\n  } catch (json::parse_error& e) {\n    throw ParseError(\n        std::string(e.what()) +\n        \" ConnectorInsertTableHandle  ConnectorInsertTableHandle\");\n  }\n\n  if (j.contains(\"customSerializedValue\")) {\n    VELOX_CHECK(\n        !type.empty() && type[0] != '$',\n        \"Internal handle type '{}' should not have customSerializedValue\",\n        type);\n    std::string binaryData = velox::encoding::Base64::decode(\n        j[\"customSerializedValue\"].get<std::string>());\n    getConnectorProtocol(type).deserialize(binaryData, p);\n    return;\n  }\n\n  getConnectorProtocol(type).from_json(j, p);\n}\n} // namespace facebook::presto::protocol","sourceCodeStart":6609,"sourceCodeEnd":6645,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-native-execution/presto_cpp/presto_protocol/core/presto_protocol_core.cpp#L6609-L6645","documentation":"This ParseError is thrown while deserializing JSON into a shared_ptr<ConnectorInsertTableHandle>. getSubclassKey(j) threw a json::parse_error, re-thrown as ParseError with 'ConnectorInsertTableHandle' appended. The insert table handle JSON is syntactically invalid, blocking identification of the connector-specific insert handle.","triggerScenarios":"from_json called during TableWriter/Insert plan deserialization where the ConnectorInsertTableHandle JSON fragment is malformed (truncation, invalid escapes, non-JSON bytes).","commonSituations":"Connector emitting a badly serialized insert handle; coordinator/native version mismatch on create/insert paths; corrupted or manually edited plan JSON.","solutions":["Re-parse the insert table handle fragment with a strict JSON parser to locate the error","Check the connector's ConnectorInsertTableHandle serialization on the coordinator","Verify coordinator and native sidecar/worker versions match","Log and validate the whole plan JSON before native deserialization"],"exampleFix":"// before\nproto::from_json(insertHandleJson, insertHandle);\n// after\njson j = json::parse(insertHandleJson); // throws with position info\nproto::from_json(j, insertHandle);","handlingStrategy":"validation","validationCode":"json j = json::parse(insertHandleJson);\nif (!j.is_object() || !j.contains(\"type\")) {\n  throw std::runtime_error(\"ConnectorInsertTableHandle JSON invalid: missing 'type'\");\n}","typeGuard":"bool isWellFormedInsertHandleJson(const json& j) {\n  return j.is_object() && j.contains(\"type\") && j[\"type\"].is_string();\n}","tryCatchPattern":"try {\n  proto::from_json(j, insertHandle);\n} catch (const ParseError& e) {\n  LOG(ERROR) << \"bad ConnectorInsertTableHandle JSON: \" << e.what();\n  throw;\n}","preventionTips":["Validate insert handle JSON before deserialization","Verify connector-side serialization of insert handles","Keep coordinator and native versions aligned","Avoid manual edits to plan JSON"],"tags":["json","deserialization","parse-error","insert-table-handle"],"backgroundTag":"json-parse-error","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"}