{"record":{"id":"773ed01df547b80b","repo":"prestodb/presto","slug":"parse-error-columnhandle-columnhandle","errorCode":null,"errorMessage":"{parse_error} ColumnHandle  ColumnHandle","messagePattern":"(.+?) ColumnHandle  ColumnHandle","errorType":"validation","errorClass":"ParseError","httpStatus":null,"severity":"error","filePath":"presto-native-execution/presto_cpp/presto_protocol/core/presto_protocol_core.cpp","lineNumber":6399,"sourceCode":"      \"List<VariableReferenceExpression>\",\n      \"lookupVariables\");\n}\n} // namespace facebook::presto::protocol\nnamespace facebook::presto::protocol {\nvoid to_json(json& j, const std::shared_ptr<ColumnHandle>& 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<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 (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  getConnectorProtocol(type).from_json(j, p);\n}\n} // namespace facebook::presto::protocol\nnamespace facebook::presto::protocol {\nvoid to_json(json& j, const std::shared_ptr<ConnectorTableLayoutHandle>& p) {\n  if (p == nullptr) {","sourceCodeStart":6381,"sourceCodeEnd":6417,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-native-execution/presto_cpp/presto_protocol/core/presto_protocol_core.cpp#L6381-L6417","documentation":"This ParseError is thrown while deserializing JSON into a shared_ptr<ColumnHandle>. getSubclassKey(j) raised a json::parse_error, which is re-thrown as ParseError with 'ColumnHandle' appended. It indicates the JSON for a column handle (e.g. a Hive column handle) is syntactically invalid, so the concrete subclass cannot even be identified.","triggerScenarios":"from_json invoked on a plan/split JSON whose ColumnHandle entry is malformed — bad escapes, non-UTF8 bytes, truncated string — before subclass dispatch happens.","commonSituations":"Connector on the coordinator serializing a column handle incorrectly; protocol incompatibility between Java coordinator and native worker; corrupted cached split payloads.","solutions":["Log and re-parse the offending JSON fragment with a plain JSON parser to locate the syntax error","Upgrade/align coordinator and native worker versions so both speak the same handle serialization","Fix the connector's ColumnHandle JSON serialization on the Java side","Validate the full plan/split JSON end-to-end before dispatching to native execution"],"exampleFix":"// before: blindly deserializing the split\nproto::from_json(splitJson, columnHandle);\n// after\njson j = json::parse(splitJson); // surfaces byte/line of the syntax error\nproto::from_json(j, columnHandle);","handlingStrategy":"validation","validationCode":"json j = json::parse(splitJson); // throws with byte offset if malformed\nif (!j.is_object() || !j.contains(\"type\")) {\n  throw std::runtime_error(\"ColumnHandle JSON missing 'type' or not an object\");\n}","typeGuard":"bool isWellFormedColumnHandleJson(const json& j) {\n  return j.is_object() && j.contains(\"type\") && j[\"type\"].is_string();\n}","tryCatchPattern":"try {\n  proto::from_json(j, columnHandle);\n} catch (const ParseError& e) {\n  LOG(ERROR) << \"bad ColumnHandle JSON: \" << e.what();\n  throw;\n}","preventionTips":["Validate JSON syntax before deserialization","Ensure connectors serialize handles with a proper JSON encoder (escaped strings)","Align protocol versions across coordinator and workers","Keep payloads intact end-to-end (no truncation/charset mangling)"],"tags":["json","deserialization","parse-error","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"}