{"record":{"id":"5106ff9cf0aa8111","repo":"prestodb/presto","slug":"no-abstract-type-columnhandle-5106ff","errorCode":null,"errorMessage":" no abstract type ColumnHandle ","messagePattern":" no abstract type ColumnHandle ","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.cpp","lineNumber":1160,"sourceCode":"      \"IcebergDeleteTableHandle\",\n      \"Map<String, DeleteFile>\",\n      \"existingDeletionVectors\");\n}\n\n} // namespace facebook::presto::protocol::iceberg\nnamespace facebook::presto::protocol::iceberg {\nvoid to_json(json& j, const std::shared_ptr<ColumnHandle>& p) {\n  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","sourceCodeStart":1142,"sourceCodeEnd":1178,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.cpp#L1142-L1178","documentation":"This TypeError comes from the to_json overload for std::shared_ptr<ColumnHandle> in the iceberg protocol serializer, which only maps the tag \"hive-iceberg\" (IcebergColumnHandle). Any handle whose subclass key differs reaches the fallthrough throw reporting that ColumnHandle has no abstract-type mapping for that discriminator.","triggerScenarios":"Calling to_json on a shared_ptr<ColumnHandle> whose getSubclassKey() is not \"hive-iceberg\" — e.g. a plain HiveColumnHandle serialized through the iceberg protocol layer.","commonSituations":"Mixing Hive and Iceberg handles when reading a table whose connector changed; plan fragments cached from a different connector; handles built without setting the \"hive-iceberg\" _type.","solutions":["Ensure the handle is an IcebergColumnHandle with _type set to \"hive-iceberg\" before serializing in the iceberg layer","Fix the handle's discriminator at construction/deserialization time","Add a to_json branch in presto_protocol_iceberg.cpp if another tag must be supported"],"exampleFix":"// before\nto_json(j, handle); // handle _type == \"hive\" -> TypeError in iceberg layer\n// after\nauto iceberg = std::dynamic_pointer_cast<IcebergColumnHandle>(handle);\nif (!iceberg) {\n  throw TypeError(\"expected IcebergColumnHandle for iceberg serialization\");\n}\nto_json(j, std::static_pointer_cast<ColumnHandle>(iceberg));","handlingStrategy":"type-guard","validationCode":"std::string tag = handle->getType();\nif (tag != \"hive-iceberg\") {\n  throw TypeError(\"cannot serialize \" + tag + \" ColumnHandle via iceberg protocol\");\n}","typeGuard":"bool isIcebergColumnHandle(const std::shared_ptr<ColumnHandle>& p) {\n  return std::dynamic_pointer_cast<IcebergColumnHandle>(p) != nullptr;\n}","tryCatchPattern":"try {\n  to_json(j, columnHandle);\n} catch (const TypeError& e) {\n  LOG(ERROR) << \"Iceberg ColumnHandle serialization failed: \" << e.what();\n  throw;\n}","preventionTips":["Confirm the table's connector before selecting the protocol converter","Keep iceberg handle construction setting \"hive-iceberg\" in _type","Round-trip test iceberg handles in CI","Reject foreign handles early at the plan-entry boundary"],"tags":["json-serialization","polymorphic-dispatch","iceberg"],"backgroundTag":"unknown-polymorphic-subtype","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"}