apache/iceberg · warning

Not exposing the current snapshot

Error message

Not exposing the current snapshot({}) summary in HMS since it exceeds {} characters

What it means

HMSTablePropertyHelper.setSnapshotSummary writes the current snapshot's summary (as JSON) into the Hive metastore table parameters, but HMS parameters have a size limit (configurable). When the JSON exceeds maxHiveTablePropertySize characters, the summary is deliberately omitted and this warning is logged instead of failing the commit.

Solutions

  1. Increase maxHiveTablePropertySize (table property write.max-hive-table-property-size / catalog config) if the HMS backend can tolerate larger parameters
  2. Accept the omission — the summary is informational; the table still functions
  3. Reduce job fan-out (fewer partitions/files per commit) to shrink summaries
  4. Check snapshot summary contents (e.g. extra write metrics) that inflate the JSON
Defensive patterns

Strategy: validation

Validate before calling

long max = Long.parseLong(properties.getOrDefault("write.max-hive-table-property-size", "2_000_000".replace("_","")));
String json = JsonUtil.mapper().writeValueAsString(snapshot.summary());
if (json.length() > max) { /* raise limit or skip */ }

Prevention

When it happens

Trigger: Committing a snapshot whose summary map serializes to JSON longer than maxHiveTablePropertySize — typically large jobs with many metrics entries (huge file counts, lots of partition summaries).

Common situations: Very large writes/overwrites producing rich snapshot summaries; low maxHiveTablePropertySize configured; HMS backends with restrictive parameter sizes (e.g. older MySQL-backed metastores).

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/644ee343be1999ca. Report an issue: GitHub.

Appendix: source

Thrown at hive-metastore/src/main/java/org/apache/iceberg/hive/HMSTablePropertyHelper.java:227

          TableProperties.CURRENT_SNAPSHOT_ID, String.valueOf(currentSnapshot.snapshotId()));
      parameters.put(
          TableProperties.CURRENT_SNAPSHOT_TIMESTAMP,
          String.valueOf(currentSnapshot.timestampMillis()));
      setSnapshotSummary(parameters, currentSnapshot, maxHiveTablePropertySize);
    }

    parameters.put(TableProperties.SNAPSHOT_COUNT, String.valueOf(metadata.snapshots().size()));
  }

  @VisibleForTesting
  static void setSnapshotSummary(
      Map<String, String> parameters, Snapshot currentSnapshot, long maxHiveTablePropertySize) {
    try {
      String summary = JsonUtil.mapper().writeValueAsString(currentSnapshot.summary());
      if (summary.length() <= maxHiveTablePropertySize) {
        parameters.put(TableProperties.CURRENT_SNAPSHOT_SUMMARY, summary);
      } else {
        LOG.warn(
            "Not exposing the current snapshot({}) summary in HMS since it exceeds {} characters",
            currentSnapshot.snapshotId(),
            maxHiveTablePropertySize);
      }
    } catch (JsonProcessingException e) {
      LOG.warn(
          "Failed to convert current snapshot({}) summary to a json string",
          currentSnapshot.snapshotId(),
          e);
    }
  }

  @VisibleForTesting
  static void setPartitionSpec(
      TableMetadata metadata, Map<String, String> parameters, long maxHiveTablePropertySize) {
    parameters.remove(TableProperties.DEFAULT_PARTITION_SPEC);
    if (exposeInHmsProperties(maxHiveTablePropertySize)
        && metadata.spec() != null

View on GitHub (pinned to 86d9c8fc54)