{"record":{"id":"e43d2094247ce122","repo":"prestodb/presto","slug":"columnhandle-columnhandle-e43d20","errorCode":null,"errorMessage":" ColumnHandle  ColumnHandle","messagePattern":" ColumnHandle  ColumnHandle","errorType":"exception","errorClass":"ParseError","httpStatus":null,"severity":"error","filePath":"presto-native-execution/presto_cpp/presto_protocol/connector/tpch/presto_protocol_tpch.cpp","lineNumber":117,"sourceCode":"  if (p == nullptr) {\n    return;\n  }\n  String type = p->_type;\n\n  if (type == \"tpch\") {\n    j = *std::static_pointer_cast<TpchColumnHandle>(p);\n    return;\n  }\n\n  throw TypeError(type + \" no abstract type ColumnHandle \");\n}\n\nvoid from_json(const json& j, std::shared_ptr<ColumnHandle>& p) {\n  String type;\n  try {\n    type = p->getSubclassKey(j);\n  } catch (json::parse_error& e) {\n    throw ParseError(std::string(e.what()) + \" ColumnHandle  ColumnHandle\");\n  }\n\n  if (type == \"tpch\") {\n    std::shared_ptr<TpchColumnHandle> k = std::make_shared<TpchColumnHandle>();\n    j.get_to(*k);\n    p = std::static_pointer_cast<ColumnHandle>(k);\n    return;\n  }\n\n  throw TypeError(type + \" no abstract type ColumnHandle \");\n}\n} // namespace facebook::presto::protocol::tpch\nnamespace facebook::presto::protocol::tpch {\nTpchTableHandle::TpchTableHandle() noexcept {\n  _type = \"tpch\";\n}\n\nvoid to_json(json& j, const TpchTableHandle& p) {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-native-execution/presto_cpp/presto_protocol/connector/tpch/presto_protocol_tpch.cpp#L99-L135","documentation":"from_json for shared_ptr<ColumnHandle> in the tpch connector module extracts the subclass key with getSubclassKey; a nlohmann json::parse_error raised there is converted into a protocol ParseError with the message suffix ' ColumnHandle  ColumnHandle'. It signals the incoming JSON for a ColumnHandle is structurally invalid before any tpch dispatch can happen.","triggerScenarios":"Deserializing a plan/split payload where the ColumnHandle JSON is malformed — non-object input, corrupted bytes, or an unexpected schema that makes getSubclassKey's json access throw parse_error — inside facebook::presto::protocol::tpch::from_json.","commonSituations":"Truncated HTTP task-update bodies from the coordinator; JSON produced by an incompatible coordinator version; manually constructed protocol JSON in tests with wrong nesting.","solutions":["Capture and validate the raw JSON payload with a parser/linter to locate the malformed section","Check coordinator and native worker versions agree on ColumnHandle wire format","Ensure the producer always emits the '_type' discriminator inside a well-formed JSON object","Catch ParseError at the deserialization boundary and log the offending fragment for triage"],"exampleFix":"// before: malformed payload\nfrom_json(json::parse(\"{\\\"_type\\\": tpch}\"), columnHandle); // invalid JSON literal\n// after: validate before deserializing\njson j = json::parse(payload);\nif (!j.is_object() || !j.contains(\"_type\")) {\n  throw std::runtime_error(\"Invalid ColumnHandle json: \" + payload);\n}\nfrom_json(j, columnHandle);","handlingStrategy":"try-catch","validationCode":"json j = json::parse(payload);\nif (!j.is_object() || !j.contains(\"_type\") || !j[\"_type\"].is_string()) {\n  throw std::runtime_error(\"ColumnHandle json missing valid _type\");\n}","typeGuard":"bool isDeserializableColumnHandle(const json& j) {\n  return j.is_object() && j.contains(\"_type\") && j[\"_type\"].is_string();\n}","tryCatchPattern":"try {\n  facebook::presto::protocol::tpch::from_json(j, columnHandle);\n} catch (const facebook::presto::protocol::ParseError& e) {\n  LOG(ERROR) << \"tpch ColumnHandle parse failed: \" << e.what() << \" payload=\" << j.dump();\n  throw;\n}","preventionTips":["Verify payload integrity (no truncation) before parsing","Pin compatible coordinator/native protocol versions","Validate JSON shape before handing it to from_json","Catch and log ParseError with the raw payload"],"tags":["json","deserialization","presto-protocol","column-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"}