{"record":{"id":"3136c06583669c8c","repo":"apache/iceberg","slug":"encountered-unexpected-exception-while-converting","errorCode":null,"errorMessage":"Encountered unexpected exception while converting Iceberg metadata to Glue table information","messagePattern":"Encountered unexpected exception while converting Iceberg metadata to Glue table information","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"aws/src/main/java/org/apache/iceberg/aws/glue/IcebergToGlueConverter.java","lineNumber":286,"sourceCode":"        List<Column> existingColumns = existingTable.storageDescriptor().columns();\n        // First-seen-wins on duplicate names. toColumns writes current-schema columns before\n        // historical-schema columns. Preserve the current-schema comment.\n        existingColumnNameToComment =\n            existingColumns.stream()\n                .filter(column -> column.comment() != null)\n                .collect(\n                    Collectors.toMap(\n                        Column::name, Column::comment, (existing, duplicate) -> existing));\n      } else {\n        existingColumnNameToComment = Collections.emptyMap();\n      }\n\n      List<Column> columns = toColumns(metadata, existingColumnNameToComment);\n\n      tableInputBuilder.storageDescriptor(\n          storageDescriptor.location(metadata.location()).columns(columns).build());\n    } catch (RuntimeException e) {\n      LOG.warn(\n          \"Encountered unexpected exception while converting Iceberg metadata to Glue table information\",\n          e);\n    }\n  }\n\n  /**\n   * Converting from an Iceberg type to a type string that can be displayed in Glue.\n   *\n   * <p>Such conversion is only used for informational purpose, DO NOT reference this method for any\n   * actual data processing type conversion.\n   *\n   * @param type Iceberg type\n   * @return type string\n   */\n  private static String toTypeString(Type type) {\n    switch (type.typeId()) {\n      case BOOLEAN:\n        return \"boolean\";","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/glue/IcebergToGlueConverter.java#L268-L304","documentation":"A warning from IcebergToGlueConverter.setTableInputInformation: while converting Iceberg table metadata (schema, partitioning, location) into a Glue TableInput, an unexpected RuntimeException occurred. The converter swallows the exception and logs a warning, so the Glue table gets updated with whatever could be built (possibly incomplete columns/storage descriptor) instead of failing the operation.","triggerScenarios":"Metadata that the converter cannot map into Glue structures — e.g. exotic types or unsupported transformation in toColumns, extremely wide schemas exceeding Glue limits, or concurrent metadata change between read and conversion.","commonSituations":"Tables with column names/types Glue cannot represent; schemas near Glue's column-count limits; nested map/list types that hit conversion edge cases; updates that race with concurrent commits.","solutions":["Inspect the logged exception stack trace to identify the offending field or type and simplify/rename it in the Iceberg schema","Update the Iceberg AWS integration — newer versions fix conversion gaps for more types","If Glue metadata for this table is only advisory, the warning is tolerable; the Iceberg metadata in storage remains authoritative","Compare the Glue table's StorageDescriptor afterwards to see what was actually written"],"exampleFix":"// before\ncolumn(\"weird col\", Types.MapType.ofOptional(...)) // conversion throws, swallowed\n// after\n// rename/simplify problematic fields so the converter can map them\ncolumn(\"weird_col\", Types.MapType.ofOptional(1, 2, Types.StringType.get(), Types.StringType.get()));","handlingStrategy":"try-catch","validationCode":"// scan schema for Glue-unfriendly names/types before writing\nschema.columns().forEach(c -> {\n  if (!c.name().matches(\"[a-zA-Z0-9_]*\")) LOG.warn(\"Column may not map to Glue: \" + c.name());\n});","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use Glue-compatible column names (alphanumeric/underscore)","Stay within Glue column-count and size limits","Keep the Iceberg AWS module updated for conversion fixes","Remember Iceberg metadata in storage is authoritative even if Glue mapping fails"],"tags":["aws","glue","metadata-conversion"],"backgroundTag":"schema-validation-failed","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"}