{"record":{"id":"e0cf4afddd26c929","repo":"apache/iceberg","slug":"cannot-bind-name-does-not-accept-arguments","errorCode":null,"errorMessage":"Cannot bind: ${name()} does not accept arguments","messagePattern":"Cannot bind: (.+?) does not accept arguments","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/functions/IcebergVersionFunction.java","lineNumber":36,"sourceCode":" */\npackage org.apache.iceberg.spark.functions;\n\nimport org.apache.iceberg.IcebergBuild;\nimport org.apache.spark.sql.catalyst.InternalRow;\nimport org.apache.spark.sql.connector.catalog.functions.BoundFunction;\nimport org.apache.spark.sql.connector.catalog.functions.UnboundFunction;\nimport org.apache.spark.sql.types.DataType;\nimport org.apache.spark.sql.types.DataTypes;\nimport org.apache.spark.sql.types.StructType;\nimport org.apache.spark.unsafe.types.UTF8String;\n\n/**\n * A function for use in SQL that returns the current Iceberg version, e.g. {@code SELECT\n * system.iceberg_version()} will return a String such as \"0.14.0\" or \"0.15.0-SNAPSHOT\"\n */\npublic class IcebergVersionFunction implements UnboundFunction {\n  @Override\n  public BoundFunction bind(StructType inputType) {\n    if (inputType.fields().length > 0) {\n      throw new UnsupportedOperationException(\n          String.format(\"Cannot bind: %s does not accept arguments\", name()));\n    }\n\n    return new IcebergVersionFunctionImpl();\n  }\n\n  @Override\n  public String description() {\n    return name() + \" - Returns the runtime Iceberg version\";\n  }\n\n  @Override\n  public String name() {\n    return \"iceberg_version\";\n  }\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/functions/IcebergVersionFunction.java#L18-L54","documentation":"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.","triggerScenarios":"Calling system.iceberg_version('x'), system.iceberg_version(1), or with any parameter list in Spark SQL / function-builder API.","commonSituations":"Assuming the function takes an optional format or component argument; copy-pasted calls adding parameters.","solutions":["Call it with empty parentheses: SELECT system.iceberg_version()","Remove any arguments from the call"],"exampleFix":"// before\nspark.sql(\"SELECT system.iceberg_version('full')\")\n// after\nspark.sql(\"SELECT system.iceberg_version()\")","handlingStrategy":"validation","validationCode":"-- must be called with zero arguments\nSELECT system.iceberg_version();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Call iceberg_version with empty parentheses","Never parameterize this function in templates"],"tags":["spark","sql-functions","argument-count"],"backgroundTag":"missing-required-argument","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}