{"record":{"id":"2307241aee5d9c11","repo":"apache/iceberg","slug":"ignoring-provided-staging-location-as-new-manifest-230724","errorCode":null,"errorMessage":"Ignoring provided staging location as new manifests will be committed directly","messagePattern":"Ignoring provided staging location as new manifests will be committed directly","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java","lineNumber":168,"sourceCode":"  @Override\n  public RewriteManifestsSparkAction specId(int specId) {\n    Preconditions.checkArgument(table.specs().containsKey(specId), \"Invalid spec id %s\", specId);\n    this.spec = table.specs().get(specId);\n    return this;\n  }\n\n  @Override\n  public RewriteManifestsSparkAction rewriteIf(Predicate<ManifestFile> newPredicate) {\n    this.predicate = newPredicate;\n    return this;\n  }\n\n  @Override\n  public RewriteManifestsSparkAction stagingLocation(String newStagingLocation) {\n    if (shouldStageManifests) {\n      this.outputLocation = newStagingLocation;\n    } else {\n      LOG.warn(\"Ignoring provided staging location as new manifests will be committed directly\");\n    }\n    return this;\n  }\n\n  @Override\n  public RewriteManifests.Result execute() {\n    String desc = String.format(\"Rewriting manifests in %s\", table.name());\n    JobGroupInfo info = newJobGroupInfo(\"REWRITE-MANIFESTS\", desc);\n    return withJobGroupInfo(info, this::doExecute);\n  }\n\n  @Override\n  public RewriteManifestsSparkAction sortBy(List<String> partitionFields) {\n    // Collect set of available partition columns to cluster on\n    Set<String> availablePartitionNames =\n        spec.fields().stream().map(PartitionField::name).collect(Collectors.toSet());\n\n    // Identify specified partition fields that are not available in the spec","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java#L150-L186","documentation":"RewriteManifestsSparkAction only uses a custom staging location when manifests must actually be rewritten as staged files; when it determines manifests can be committed directly (shouldStageManifests is false), a user-provided stagingLocation is ignored and this warning is logged. It is informational: the call has no effect on the outcome.","triggerScenarios":"Calling stagingLocation(String) on RewriteManifestsSparkAction when shouldStageManifests is false, i.e. when the rewrite will write manifests directly rather than staging them.","commonSituations":"Users pass 'staging-location' expecting all manifest writes to go to a custom path, unaware the action decided direct commits are fine (e.g. all manifests already need rewriting with no partial groups).","solutions":["Verify whether the action will stage manifests before setting a staging location","Remove the staging-location option if the warning appears; it has no effect","If a staged location is required, ensure conditions force manifest staging (e.g. use the API path that requires staging)"],"exampleFix":"// before\nactions.rewriteManifests(table).stagingLocation(\"s3://bucket/tmp/manifests\").execute();\n// after\nRewriteManifestsSparkAction rewrite = actions.rewriteManifests(table);\nif (stagingRequired) { rewrite.stagingLocation(\"s3://bucket/tmp/manifests\"); }\nrewrite.execute();","handlingStrategy":"validation","validationCode":"if (actionWillStageManifests(table) && stagingLocation != null) { action.stagingLocation(stagingLocation); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set staging-location when the action will actually stage manifests","Treat the warning as a signal the option was a no-op","Read the action's javadoc for when staging applies"],"tags":["spark","manifests","ignored-option"],"backgroundTag":"ignored-config-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}