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

  1. Call it with no arguments: SELECT iceberg.iceberg_version();
  2. Remove any accidental argument from generated or templated SQL.
  3. 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

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


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 fails

View on GitHub (pinned to 86d9c8fc54)