apache/iceberg · error · UnsupportedOperationException
${CLASS_NAME} does not support time travel
Error message
${CLASS_NAME} does not support time travel What it means
SparkRewriteTableCatalog rejects the versioned loadTable(ident, version) overload because time travel is meaningless for its procedure-scoped table cache. Any attempt throws UnsupportedOperationException naming the class.
Source
Thrown at spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/SparkRewriteTableCatalog.java:63
}
@Override
public SparkRewriteTable loadTable(Identifier ident) throws NoSuchTableException {
validateNoNamespace(ident);
String groupId = ident.name();
Table table = TABLE_CACHE.get(groupId);
if (table == null) {
throw new NoSuchTableException(ident);
}
return new SparkRewriteTable(table, groupId);
}
@Override
public SparkTable loadTable(Identifier ident, String version) throws NoSuchTableException {
throw new UnsupportedOperationException(CLASS_NAME + " does not support time travel");
}
@Override
public SparkTable loadTable(Identifier ident, long timestampMicros) throws NoSuchTableException {
throw new UnsupportedOperationException(CLASS_NAME + " does not support time travel");
}
@Override
public void invalidateTable(Identifier ident) {
throw new UnsupportedOperationException(CLASS_NAME + " does not support table invalidation");
}
@Override
public SparkTable createTable(
Identifier ident, StructType schema, Transform[] partitions, Map<String, String> properties)
throws TableAlreadyExistsException {
throw new UnsupportedOperationException(CLASS_NAME + " does not support creating tables");
}View on GitHub (pinned to 86d9c8fc54)
Solutions
- Do not combine time travel with the rewrite-table procedure catalog
- Use SparkCatalog (the normal Iceberg catalog) for time-travel reads
- Complete the rewrite procedure first, then query with time travel via the regular catalog
Example fix
// before
spark.read.option("version-as-of", 5).table("prod.db.events") // via rewrite catalog
// after
spark.sql("CALL prod.system.rewrite_data_files(table => 'db.events')") // no time travel in rewrite catalog Defensive patterns
Strategy: validation
Validate before calling
require(!queryOptions.contains("version-as-of"), "time travel not supported through rewrite catalog") Try / catch
try {
catalog.loadTable(ident, version)
} catch {
case _: UnsupportedOperationException => loadWithoutTimeTravel(ident)
} Prevention
- Never combine VERSION AS OF with rewrite procedures
- Keep time-travel reads on SparkCatalog
- Run rewrites and reads in separate sessions/bindings
When it happens
Trigger: Calling loadTable(ident, version) (or a Spark query with VERSION AS OF / FOR SYSTEM_VERSION AS OF) against a catalog bound to SparkRewriteTableCatalog.
Common situations: Running time-travel queries while a rewrite catalog binding is active; framework code resolving tables with the versioned overload during a rewrite.
Related errors
- AS OF is not supported for changelogs
- org.apache.iceberg.spark.SparkRewriteTableCatalog does not s
- does not support time travel
- Cannot select snapshot in table: ${tableType}
- Cannot scan table as of time %s: configured for incremental
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/c0ee9aaba9513ca1.
Report an issue: GitHub.