prestodb/presto · error · ParseError

ColumnHandle ColumnHandle

Error message

 ColumnHandle  ColumnHandle

What it means

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.

Source

Thrown at presto-native-execution/presto_cpp/presto_protocol/connector/iceberg/presto_protocol_iceberg.cpp:1168

  if (p == nullptr) {
    return;
  }
  String type = p->_type;

  if (type == "hive-iceberg") {
    j = *std::static_pointer_cast<IcebergColumnHandle>(p);
    return;
  }

  throw TypeError(type + " no abstract type ColumnHandle ");
}

void from_json(const json& j, std::shared_ptr<ColumnHandle>& p) {
  String type;
  try {
    type = p->getSubclassKey(j);
  } catch (json::parse_error& e) {
    throw ParseError(std::string(e.what()) + " ColumnHandle  ColumnHandle");
  }

  if (type == "hive-iceberg") {
    std::shared_ptr<IcebergColumnHandle> k =
        std::make_shared<IcebergColumnHandle>();
    j.get_to(*k);
    p = std::static_pointer_cast<ColumnHandle>(k);
    return;
  }

  throw TypeError(type + " no abstract type ColumnHandle ");
}
} // namespace facebook::presto::protocol::iceberg
namespace facebook::presto::protocol::iceberg {
IcebergTableHandle::IcebergTableHandle() noexcept {
  _type = "hive-iceberg";
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Validate JSON well-formedness and presence of the discriminator before calling from_json
  2. Fix the producer to always emit the "hive-iceberg" type key for iceberg column handles
  3. Handle ParseError at plan ingestion and return a structured failure

Example fix

// before
from_json(j, columnHandle); // j malformed -> ParseError
// after
if (!j.is_object() || !j.contains("@type")) {
  throw ParseError("iceberg ColumnHandle json missing @type");
}
from_json(j, columnHandle);
Defensive patterns

Strategy: validation

Validate before calling

if (!j.is_object() || !j.contains("@type")) {
  throw ParseError("iceberg ColumnHandle json missing discriminator");
}

Try / catch

try {
  from_json(j, columnHandle);
} catch (const ParseError& e) {
  LOG(ERROR) << "Malformed iceberg ColumnHandle json: " << e.what();
  throw;
}

Prevention

When it happens

Trigger: Passing malformed or non-object JSON into the iceberg layer's ColumnHandle from_json so the type-key extraction throws a parse error.

Common situations: Corrupt serialized query plans; protocol JSON missing the discriminator field due to producer/version mismatch; truncated payloads in transport.

Understand the failure class

Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/61c3075773ceb284. Report an issue: GitHub.