{"record":{"id":"dc7c794606a7ba0c","repo":"prestodb/presto","slug":"no-abstract-type-columnhandle-dc7c79","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/tpcds/presto_protocol_tpcds.cpp","lineNumber":110,"sourceCode":"      p.totalRows,\n      \"TpcdsPartitioningHandle\",\n      \"int64_t\",\n      \"totalRows\");\n}\n} // namespace facebook::presto::protocol::tpcds\nnamespace facebook::presto::protocol::tpcds {\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 == \"tpcds\") {\n    j = *std::static_pointer_cast<TpcdsColumnHandle>(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 == \"tpcds\") {\n    std::shared_ptr<TpcdsColumnHandle> k =\n        std::make_shared<TpcdsColumnHandle>();\n    j.get_to(*k);\n    p = std::static_pointer_cast<ColumnHandle>(k);\n    return;\n  }\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-native-execution/presto_cpp/presto_protocol/connector/tpcds/presto_protocol_tpcds.cpp#L92-L128","documentation":"This TypeError is thrown by the to_json overload for std::shared_ptr<ColumnHandle> in the tpcds protocol serializer, which only serializes TpcdsColumnHandle handles tagged \"tpcds\". Any other discriminator falls through to the throw stating the abstract ColumnHandle type has no mapping for the given type string.","triggerScenarios":"Calling to_json on a shared_ptr<ColumnHandle> whose getSubclassKey() is not \"tpcds\" — e.g. a HiveColumnHandle or ArrowColumnHandle routed through presto_protocol_tpcds.cpp's serializer.","commonSituations":"TPC-DS benchmark plans accidentally mixing production connector handles; test fixtures reusing handles from other connectors; subclass key never set on hand-constructed handles.","solutions":["Ensure the handle is a TpcdsColumnHandle with _type == \"tpcds\" before serializing in the tpcds layer","Populate the subclass key correctly at handle construction","Add the corresponding to_json branch in presto_protocol_tpcds.cpp if a new tag must serialize"],"exampleFix":"// before\nto_json(j, handle); // handle _type == \"hive\" -> TypeError in tpcds layer\n// after\nauto tpcds = std::dynamic_pointer_cast<TpcdsColumnHandle>(handle);\nif (!tpcds) {\n  throw TypeError(\"expected TpcdsColumnHandle for tpcds serialization\");\n}\nto_json(j, std::static_pointer_cast<ColumnHandle>(tpcds));","handlingStrategy":"type-guard","validationCode":"std::string tag = handle->getType();\nif (tag != \"tpcds\") {\n  throw TypeError(\"cannot serialize \" + tag + \" ColumnHandle via tpcds protocol\");\n}","typeGuard":"bool isTpcdsColumnHandle(const std::shared_ptr<ColumnHandle>& p) {\n  return std::dynamic_pointer_cast<TpcdsColumnHandle>(p) != nullptr;\n}","tryCatchPattern":"try {\n  to_json(j, columnHandle);\n} catch (const TypeError& e) {\n  LOG(ERROR) << \"Tpcds ColumnHandle serialization failed: \" << e.what();\n  throw;\n}","preventionTips":["Keep TPC-DS benchmark plans free of production connector handles","Set _type=\"tpcds\" in the TpcdsColumnHandle constructor","Round-trip test tpcds handles in CI","Validate handle type before entering the connector protocol layer"],"tags":["json-serialization","polymorphic-dispatch","tpcds"],"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"}