apache/iceberg · error · UnsupportedOperationException

Retrieving a view's uuid is not supported

Error message

Retrieving a view's uuid is not supported

What it means

View.uuid() is a default interface method that throws UnsupportedOperationException. Implementations that carry view metadata (BaseView) return the view's UUID; minimal implementations do not and surface this error instead.

Source

Thrown at api/src/main/java/org/apache/iceberg/view/View.java:122

    throw new UnsupportedOperationException("Replacing a view's version is not supported");
  }

  /**
   * Create a new {@link UpdateLocation} to set the view's location.
   *
   * @return a new {@link UpdateLocation}
   */
  default UpdateLocation updateLocation() {
    throw new UnsupportedOperationException("Updating a view's location is not supported");
  }

  /**
   * Returns the view's UUID
   *
   * @return the view's UUID
   */
  default UUID uuid() {
    throw new UnsupportedOperationException("Retrieving a view's uuid is not supported");
  }

  /**
   * Returns the view representation for the given SQL dialect
   *
   * @return the view representation for the given SQL dialect, or null if no representation could
   *     be resolved
   */
  default SQLViewRepresentation sqlFor(String dialect) {
    throw new UnsupportedOperationException(
        "Resolving a sql with a given dialect is not supported");
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Use a metadata-backed View implementation (e.g. BaseView) that overrides uuid().
  2. Obtain the UUID from the underlying ViewMetadata directly instead of the interface.
  3. Use another stable identifier (the view's name/location) when UUID is unavailable.

Example fix

// before
UUID id = view.uuid();

// after
UUID id = (view instanceof BaseView)
    ? view.uuid()
    : null; // fall back to catalog-supplied identifier
Defensive patterns

Strategy: try-catch

Validate before calling

boolean hasUuid = view instanceof BaseView;

Type guard

static boolean hasUuid(View v) { return v instanceof BaseView; }

Try / catch

try { return view.uuid(); } catch (UnsupportedOperationException e) { return null; }

Prevention

When it happens

Trigger: Calling view.uuid() after completeCreateView or loadView on a View implementation that does not override uuid().

Common situations: Extracting a stable view identifier for lineage/audit code against a custom or stub View; catalogs returning lightweight View adapters.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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