{"record":{"id":"61c3075773ceb284","repo":"prestodb/presto","slug":"columnhandle-columnhandle-61c307","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/iceberg/presto_protocol_iceberg.cpp","lineNumber":1168,"sourceCode":"  if (p == nullptr) {\n    return;\n  }\n  String type = p->_type;\n\n  if (type == \"hive-iceberg\") {\n    j = *std::static_pointer_cast<IcebergColumnHandle>(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 == \"hive-iceberg\") {\n    std::shared_ptr<IcebergColumnHandle> k =\n        std::make_shared<IcebergColumnHandle>();\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::iceberg\nnamespace facebook::presto::protocol::iceberg {\nIcebergTableHandle::IcebergTableHandle() noexcept {\n  _type = \"hive-iceberg\";\n}\n","sourceCodeStart":1150,"sourceCodeEnd":1186,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.cpp#L1150-L1186","documentation":"This ParseError is thrown by from_json for std::shared_ptr<ColumnHandle> in the iceberg protocol serializer when getSubclassKey(j) throws an nlohmann::json::parse_error — the JSON could not be parsed or the discriminator field could not be read. The appended \" ColumnHandle  ColumnHandle\" marks the failure as occurring in the ColumnHandle polymorphic deserialization path.","triggerScenarios":"Passing malformed or non-object JSON into the iceberg layer's ColumnHandle from_json so the type-key extraction throws a parse error.","commonSituations":"Corrupt serialized query plans; protocol JSON missing the discriminator field due to producer/version mismatch; truncated payloads in transport.","solutions":["Validate JSON well-formedness and presence of the discriminator before calling from_json","Fix the producer to always emit the \"hive-iceberg\" type key for iceberg column handles","Handle ParseError at plan ingestion and return a structured failure"],"exampleFix":"// before\nfrom_json(j, columnHandle); // j malformed -> ParseError\n// after\nif (!j.is_object() || !j.contains(\"@type\")) {\n  throw ParseError(\"iceberg ColumnHandle json missing @type\");\n}\nfrom_json(j, columnHandle);","handlingStrategy":"validation","validationCode":"if (!j.is_object() || !j.contains(\"@type\")) {\n  throw ParseError(\"iceberg ColumnHandle json missing discriminator\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  from_json(j, columnHandle);\n} catch (const ParseError& e) {\n  LOG(ERROR) << \"Malformed iceberg ColumnHandle json: \" << e.what();\n  throw;\n}","preventionTips":["Validate plan JSON before deserialization","Ensure producers emit the \"hive-iceberg\" type key","Handle ParseError at ingestion with structured reporting","Test against truncated/corrupt payloads"],"tags":["json-parse","deserialization","iceberg"],"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-12T02:17:10.037Z"}