apache/iceberg · warning

Not exposing in HMS since it exceeds characters

Error message

Not exposing {} in HMS since it exceeds {} characters

What it means

HMSTablePropertyHelper.setField writes a JSON-encoded field (partition spec, sort order, or schema) into HMS table parameters only if it fits within maxHiveTablePropertySize characters; otherwise the field is silently omitted from HMS and this warning is logged. This prevents metastore failures from oversized parameters.

Solutions

  1. Increase write.max-hive-table-property-size if your metastore supports larger parameters
  2. Simplify the schema/sort-order/partition spec if practical
  3. Accept the omission — engines reading via HiveCatalog still get metadata from metadata files, not HMS parameters
  4. Reduce column count / nesting depth to shrink the JSON
Defensive patterns

Strategy: validation

Validate before calling

if (json.length() > maxHiveTablePropertySize) { LOG.warn("{} exceeds HMS limit ({} chars)", key, maxHiveTablePropertySize); }

Prevention

When it happens

Trigger: setPartitionSpec / setSortOrder / setSchema call setField with a JSON string longer than maxHiveTablePropertySize — typically very wide schemas, deep nesting, or huge partition specs.

Common situations: Tables with thousands of columns; deeply nested structs; very large partition transforms; metastore backends with tight parameter size limits or conservative size config.

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/33e1798eacbbd213. Report an issue: GitHub.

Appendix: source

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

  }

  private static byte[] hashOf(TableMetadata tableMetadata) {
    try (HashWriter hashWriter = new HashWriter("SHA-256", StandardCharsets.UTF_8);
        JsonGenerator generator = JsonUtil.factory().createGenerator(hashWriter)) {
      TableMetadataParser.toJson(tableMetadata, generator);
      generator.flush();
      return hashWriter.getHash();
    } catch (NoSuchAlgorithmException | IOException e) {
      throw new RuntimeException("Unable to produce hash of table metadata", e);
    }
  }

  private static void setField(
      Map<String, String> parameters, String key, String value, long maxHiveTablePropertySize) {
    if (value.length() <= maxHiveTablePropertySize) {
      parameters.put(key, value);
    } else {
      LOG.warn(
          "Not exposing {} in HMS since it exceeds {} characters", key, maxHiveTablePropertySize);
    }
  }

  private static boolean exposeInHmsProperties(long maxHiveTablePropertySize) {
    return maxHiveTablePropertySize > 0;
  }
}

View on GitHub (pinned to 86d9c8fc54)