{"record":{"id":"3917c7383961e5b2","repo":"apache/iceberg","slug":"z-order-rewrite-strategy-not-implemented-for-this","errorCode":null,"errorMessage":"Z-ORDER Rewrite Strategy not implemented for this framework","messagePattern":"Z-ORDER Rewrite Strategy not implemented for this framework","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/actions/RewriteDataFiles.java","lineNumber":187,"sourceCode":"  /**\n   * Choose SORT as a strategy for this rewrite operation and manually specify the sortOrder to use\n   *\n   * @param sortOrder user defined sortOrder\n   * @return this for method chaining\n   */\n  default RewriteDataFiles sort(SortOrder sortOrder) {\n    throw new UnsupportedOperationException(\n        \"SORT Rewrite Strategy not implemented for this framework\");\n  }\n\n  /**\n   * Choose Z-ORDER as a strategy for this rewrite operation with a specified list of columns to use\n   *\n   * @param columns Columns to be used to generate Z-Values\n   * @return this for method chaining\n   */\n  default RewriteDataFiles zOrder(String... columns) {\n    throw new UnsupportedOperationException(\n        \"Z-ORDER Rewrite Strategy not implemented for this framework\");\n  }\n\n  /**\n   * Choose HILBERT as a strategy for this rewrite operation with a specified list of columns to use\n   *\n   * @param columns Columns to be used to generate Hilbert values\n   * @return this for method chaining\n   */\n  default RewriteDataFiles hilbert(String... columns) {\n    throw new UnsupportedOperationException(\n        \"HILBERT Rewrite Strategy not implemented for this framework\");\n  }\n\n  /**\n   * A user provided filter for determining which files will be considered by the rewrite strategy.\n   * This will be used in addition to whatever rules the rewrite strategy generates. For example\n   * this would be used for providing a restriction to only run rewrite on a specific partition.","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/actions/RewriteDataFiles.java#L169-L205","documentation":"RewriteDataFiles.zOrder(String...) selects the Z-ORDER rewrite strategy over the given columns. The interface default throws UnsupportedOperationException; invoking the stub means the framework binding has not implemented Z-ORDER space-filling-curvature rewriting.","triggerScenarios":"Calling rewriteDataFiles().zOrder(\"colA\", \"colB\") on an implementation that has not overridden the default zOrder method.","commonSituations":"Users copying Spark multi-dimensional clustering jobs to another engine, or custom RewriteDataFiles implementations that only implement BINPACK/SORT, hit the stub during strategy configuration.","solutions":["Use an implementation that supports Z-ORDER (e.g. SparkActions' RewriteDataFiles)","Switch to binpack() or sort() if supported by the current implementation","Upgrade or replace the engine integration where Z-ORDER is implemented","Implement the zOrder override in a custom action binding if Z-ORDER is required"],"exampleFix":"// before\nRewriteDataFiles.Result r = actions.rewriteDataFiles(table)\n    .zOrder(\"colA\", \"colB\")\n    .execute();\n// after\nRewriteDataFiles.Result r = SparkActions.get()\n    .rewriteDataFiles(table)\n    .zOrder(\"colA\", \"colB\")\n    .execute();","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  rewrite.zOrder(columns);\n} catch (UnsupportedOperationException e) {\n  rewrite.binpack();\n}","preventionTips":["Treat Z-ORDER as a Spark-only capability unless verified otherwise","Document which strategies each engine binding supports","Add integration tests for strategy selection on every target engine","Fall back to SORT/BINPACK when multi-dimensional clustering is unavailable"],"tags":["unsupported-operation","java","compaction","z-order"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}