apache/iceberg · error · UnsupportedOperationException

Cannot bind: ${name()} does not accept arguments

Error message

Cannot bind: ${name()} does not accept arguments

What it means

system.iceberg_version() is a zero-argument SQL function that returns the Iceberg library version. Binding a call with any arguments throws UnsupportedOperationException stating the function accepts none.

Source

Thrown at spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/functions/IcebergVersionFunction.java:36

 */
package org.apache.iceberg.spark.functions;

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";
  }

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Call it with empty parentheses: SELECT system.iceberg_version()
  2. Remove any arguments from the call

Example fix

// before
spark.sql("SELECT system.iceberg_version('full')")
// after
spark.sql("SELECT system.iceberg_version()")
Defensive patterns

Strategy: validation

Validate before calling

-- must be called with zero arguments
SELECT system.iceberg_version();

Prevention

When it happens

Trigger: Calling system.iceberg_version('x'), system.iceberg_version(1), or with any parameter list in Spark SQL / function-builder API.

Common situations: Assuming the function takes an optional format or component argument; copy-pasted calls adding parameters.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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