prestodb/presto · error · ParseError

{parse_error} ColumnHandle ColumnHandle

Error message

{parse_error} ColumnHandle  ColumnHandle

What it means

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.

Source

Thrown at presto-native-execution/presto_cpp/presto_protocol/core/presto_protocol_core.cpp:6399

      "List<VariableReferenceExpression>",
      "lookupVariables");
}
} // namespace facebook::presto::protocol
namespace facebook::presto::protocol {
void to_json(json& j, const std::shared_ptr<ColumnHandle>& p) {
  if (p == nullptr) {
    return;
  }
  String type = p->_type;
  getConnectorProtocol(type).to_json(j, p);
}

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 (j.contains("customSerializedValue")) {
    VELOX_CHECK(
        !type.empty() && type[0] != '$',
        "Internal handle type '{}' should not have customSerializedValue",
        type);
    std::string binaryData = velox::encoding::Base64::decode(
        j["customSerializedValue"].get<std::string>());
    getConnectorProtocol(type).deserialize(binaryData, p);
    return;
  }
  getConnectorProtocol(type).from_json(j, p);
}
} // namespace facebook::presto::protocol
namespace facebook::presto::protocol {
void to_json(json& j, const std::shared_ptr<ConnectorTableLayoutHandle>& p) {
  if (p == nullptr) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Log and re-parse the offending JSON fragment with a plain JSON parser to locate the syntax error
  2. Upgrade/align coordinator and native worker versions so both speak the same handle serialization
  3. Fix the connector's ColumnHandle JSON serialization on the Java side
  4. Validate the full plan/split JSON end-to-end before dispatching to native execution

Example fix

// before: blindly deserializing the split
proto::from_json(splitJson, columnHandle);
// after
json j = json::parse(splitJson); // surfaces byte/line of the syntax error
proto::from_json(j, columnHandle);
Defensive patterns

Strategy: validation

Validate before calling

json j = json::parse(splitJson); // throws with byte offset if malformed
if (!j.is_object() || !j.contains("type")) {
  throw std::runtime_error("ColumnHandle JSON missing 'type' or not an object");
}

Type guard

bool isWellFormedColumnHandleJson(const json& j) {
  return j.is_object() && j.contains("type") && j["type"].is_string();
}

Try / catch

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

Prevention

When it happens

Trigger: from_json invoked on a plan/split JSON whose ColumnHandle entry is malformed — bad escapes, non-UTF8 bytes, truncated string — before subclass dispatch happens.

Common situations: Connector on the coordinator serializing a column handle incorrectly; protocol incompatibility between Java coordinator and native worker; corrupted cached split payloads.

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/773ed01df547b80b. Report an issue: GitHub.