apache/iceberg · error
Invalid edge interpolation algorithm: %s
Error message
Invalid edge interpolation algorithm: %s
What it means
EdgeAlgorithm.fromName converts a string from table metadata (geospatial edge interpolation name) into the EdgeAlgorithm enum. If the name is not a valid enum constant (after upper-casing) it throws IllegalArgumentException including the offending name, chained from the valueOf failure. Null names are rejected separately with the same message.
Source
Thrown at api/src/main/java/org/apache/iceberg/types/EdgeAlgorithm.java:52
THOMAS,
/**
* Thomas, Paul D. Mathematical models for navigation systems. US Naval Oceanographic Office,
* 1965.
*/
ANDOYER,
/**
* <a href="https://link.springer.com/content/pdf/10.1007/s00190-012-0578-z.pdf">Karney, Charles
* FF. "Algorithms for geodesics." Journal of Geodesy 87 (2013): 43-55 </a>, and <a
* href="https://geographiclib.sourceforge.io/">GeographicLib</a>.
*/
KARNEY;
public static EdgeAlgorithm fromName(String algorithmName) {
Preconditions.checkNotNull(algorithmName, "Invalid edge interpolation algorithm: null");
try {
return EdgeAlgorithm.valueOf(algorithmName.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException(
String.format("Invalid edge interpolation algorithm: %s", algorithmName), e);
}
}
@Override
public String toString() {
return name().toLowerCase(Locale.ROOT);
}
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Correct the algorithm name in the metadata to one of the enum constants (e.g. SPHERICAL, VINCENTY, THOMAS, ANDOYER, KARNEY)
- Upgrade the client if the metadata uses a newer spec algorithm
- Catch IllegalArgumentException and fall back to a default algorithm if approximation is acceptable
Example fix
// before
EdgeAlgorithm a = EdgeAlgorithm.fromName("sphericalextra"); // throws
// after
EdgeAlgorithm a = EdgeAlgorithm.fromName("spherical"); Defensive patterns
Strategy: try-catch
Validate before calling
boolean known = Arrays.stream(EdgeAlgorithm.values()).anyMatch(a -> a.name().equalsIgnoreCase(name));
Type guard
Optional<EdgeAlgorithm> safeFromName(String n) { return n == null ? Optional.empty() : Arrays.stream(EdgeAlgorithm.values()).filter(a -> a.name().equalsIgnoreCase(n)).findFirst(); } Try / catch
try { alg = EdgeAlgorithm.fromName(n); } catch (IllegalArgumentException e) { alg = EdgeAlgorithm.KARNEY; log.warn("Unknown edge algorithm, using default"); } Prevention
- Only write enum-constant names into geo metadata
- Keep clients upgraded for new spec algorithms
- Normalize case before lookup
When it happens
Trigger: Reading geometry/geography column metadata whose edge-interpolation string is misspelled, in unexpected case (with non-ASCII), or written by a newer spec with a new algorithm this enum lacks.
Common situations: Hand-edited or third-party-written table metadata; newer Iceberg spec adding an edge algorithm before this client supports it.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Invalid file format: %s
- Invalid rewrite job order name: %s
- String.format("Invalid snapshot ref type: %s", snapshotRefTy
- Invalid isolation level: %s
- Unsupported delete granularity: ${granularity}
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/4f8d9643e7836706.
Report an issue: GitHub.