apache/iceberg · error · UnsupportedOperationException
Cannot bind: does not accept arguments
Error message
Cannot bind: %s does not accept arguments
What it means
iceberg_version() is a zero-argument system function that returns the Iceberg runtime version string. Its bind() rejects any invocation with one or more arguments because the function accepts no inputs.
Solutions
- Call it with no arguments: SELECT iceberg.iceberg_version();
- Remove any accidental argument from generated or templated SQL.
- If you need a version of something else, use the appropriate metadata function or catalog API.
Example fix
// before SELECT iceberg.iceberg_version(table_name) FROM t; // after SELECT iceberg.iceberg_version();
Defensive patterns
Strategy: validation
Validate before calling
-- call with zero args only SELECT iceberg.iceberg_version();
Prevention
- Remember iceberg_version() is zero-argument — never parameterize it
- Sanitize generated SQL so column arguments are not appended to zero-arg functions
When it happens
Trigger: Calling iceberg.iceberg_version(x) with any argument — whether a column, literal, or accidental parameter from dynamic SQL generation.
Common situations: Copy-pasting a different function's call shape; code generators that uniformly append a column argument; confusing iceberg_version() with functions like current_timestamp().
Related errors
- Wrong number of inputs (expected value)
- Wrong number of inputs (expected width and value)
- Cannot bind: does not accept arguments
- Expected column to be date, tinyint, smallint, int, bigint…
- Expected number of buckets to be tinyint, shortint or int
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/ac7f4ff87dfbcdea.
Report an issue: GitHub.
Appendix: source
Thrown at spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/functions/IcebergVersionFunction.java:38
import org.apache.iceberg.IcebergBuild;
import org.apache.spark.sql.catalyst.InternalRow;
import org.apache.spark.sql.connector.catalog.functions.BoundFunction;
import org.apache.spark.sql.connector.catalog.functions.UnboundFunction;
import org.apache.spark.sql.types.DataType;
import org.apache.spark.sql.types.DataTypes;
import org.apache.spark.sql.types.StructType;
import org.apache.spark.unsafe.types.UTF8String;
/**
* A function for use in SQL that returns the current Iceberg version, e.g. {@code SELECT
* system.iceberg_version()} will return a String such as "0.14.0" or "0.15.0-SNAPSHOT"
*/
public class IcebergVersionFunction implements UnboundFunction {
@Override
public BoundFunction bind(StructType inputType) {
if (inputType.fields().length > 0) {
throw new UnsupportedOperationException(
String.format("Cannot bind: %s does not accept arguments", name()));
}
return new IcebergVersionFunctionImpl();
}
@Override
public String description() {
return name() + " - Returns the runtime Iceberg version";
}
@Override
public String name() {
return "iceberg_version";
}
// Implementing class cannot be private, otherwise Spark is unable to access the static invoke
// function during code-gen and calling the function failsView on GitHub (pinned to 86d9c8fc54)