{"record":{"id":"33e1798eacbbd213","repo":"apache/iceberg","slug":"not-exposing-in-hms-since-it-exceeds-charact","errorCode":null,"errorMessage":"Not exposing {} in HMS since it exceeds {} characters","messagePattern":"Not exposing (.+?) in HMS since it exceeds (.+?) characters","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"hive-metastore/src/main/java/org/apache/iceberg/hive/HMSTablePropertyHelper.java","lineNumber":314,"sourceCode":"  }\n\n  private static byte[] hashOf(TableMetadata tableMetadata) {\n    try (HashWriter hashWriter = new HashWriter(\"SHA-256\", StandardCharsets.UTF_8);\n        JsonGenerator generator = JsonUtil.factory().createGenerator(hashWriter)) {\n      TableMetadataParser.toJson(tableMetadata, generator);\n      generator.flush();\n      return hashWriter.getHash();\n    } catch (NoSuchAlgorithmException | IOException e) {\n      throw new RuntimeException(\"Unable to produce hash of table metadata\", e);\n    }\n  }\n\n  private static void setField(\n      Map<String, String> parameters, String key, String value, long maxHiveTablePropertySize) {\n    if (value.length() <= maxHiveTablePropertySize) {\n      parameters.put(key, value);\n    } else {\n      LOG.warn(\n          \"Not exposing {} in HMS since it exceeds {} characters\", key, maxHiveTablePropertySize);\n    }\n  }\n\n  private static boolean exposeInHmsProperties(long maxHiveTablePropertySize) {\n    return maxHiveTablePropertySize > 0;\n  }\n}\n","sourceCodeStart":296,"sourceCodeEnd":323,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/hive-metastore/src/main/java/org/apache/iceberg/hive/HMSTablePropertyHelper.java#L296-L323","documentation":"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.","triggerScenarios":"setPartitionSpec / setSortOrder / setSchema call setField with a JSON string longer than maxHiveTablePropertySize — typically very wide schemas, deep nesting, or huge partition specs.","commonSituations":"Tables with thousands of columns; deeply nested structs; very large partition transforms; metastore backends with tight parameter size limits or conservative size config.","solutions":["Increase write.max-hive-table-property-size if your metastore supports larger parameters","Simplify the schema/sort-order/partition spec if practical","Accept the omission — engines reading via HiveCatalog still get metadata from metadata files, not HMS parameters","Reduce column count / nesting depth to shrink the JSON"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (json.length() > maxHiveTablePropertySize) { LOG.warn(\"{} exceeds HMS limit ({} chars)\", key, maxHiveTablePropertySize); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Raise write.max-hive-table-property-size within HMS limits","Keep schemas/specs compact for HMS-exposed tables","Watch for the warning after wide schema changes","Remember missing HMS parameters are non-fatal"],"tags":["hive-metastore","size-limit","schema","partition-spec"],"backgroundTag":"value-out-of-range","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}