apache/iceberg · warning

Encountered unexpected exception while converting Iceberg…

Error message

Encountered unexpected exception while converting Iceberg metadata to Glue table information

What it means

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.

Solutions

  1. Inspect the logged exception stack trace to identify the offending field or type and simplify/rename it in the Iceberg schema
  2. Update the Iceberg AWS integration — newer versions fix conversion gaps for more types
  3. If Glue metadata for this table is only advisory, the warning is tolerable; the Iceberg metadata in storage remains authoritative
  4. Compare the Glue table's StorageDescriptor afterwards to see what was actually written

Example fix

// before
column("weird col", Types.MapType.ofOptional(...)) // conversion throws, swallowed
// after
// rename/simplify problematic fields so the converter can map them
column("weird_col", Types.MapType.ofOptional(1, 2, Types.StringType.get(), Types.StringType.get()));
Defensive patterns

Strategy: try-catch

Validate before calling

// scan schema for Glue-unfriendly names/types before writing
schema.columns().forEach(c -> {
  if (!c.name().matches("[a-zA-Z0-9_]*")) LOG.warn("Column may not map to Glue: " + c.name());
});

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at aws/src/main/java/org/apache/iceberg/aws/glue/IcebergToGlueConverter.java:286

        List<Column> existingColumns = existingTable.storageDescriptor().columns();
        // First-seen-wins on duplicate names. toColumns writes current-schema columns before
        // historical-schema columns. Preserve the current-schema comment.
        existingColumnNameToComment =
            existingColumns.stream()
                .filter(column -> column.comment() != null)
                .collect(
                    Collectors.toMap(
                        Column::name, Column::comment, (existing, duplicate) -> existing));
      } else {
        existingColumnNameToComment = Collections.emptyMap();
      }

      List<Column> columns = toColumns(metadata, existingColumnNameToComment);

      tableInputBuilder.storageDescriptor(
          storageDescriptor.location(metadata.location()).columns(columns).build());
    } catch (RuntimeException e) {
      LOG.warn(
          "Encountered unexpected exception while converting Iceberg metadata to Glue table information",
          e);
    }
  }

  /**
   * Converting from an Iceberg type to a type string that can be displayed in Glue.
   *
   * <p>Such conversion is only used for informational purpose, DO NOT reference this method for any
   * actual data processing type conversion.
   *
   * @param type Iceberg type
   * @return type string
   */
  private static String toTypeString(Type type) {
    switch (type.typeId()) {
      case BOOLEAN:
        return "boolean";

View on GitHub (pinned to 86d9c8fc54)