funcbro commented on issue #14606:
URL: https://github.com/apache/iceberg/issues/14606#issuecomment-4489592405

   Finally found time to check if the mentioned solution is possible - no it is 
not.
   Example:
   
   * the original table was stored in: `/tmp/_source_bucket`
   * the backup was copied to: `/tmp/_backup_bucket`
   * the new target is: `/tmp/_target_bucket`
   
   ```
       String metadataFileLocation = 
"/tmp/_backup_bucket/simpleTable/metadata/xyz.metadata.json";
       HadoopFileIO fileIO = new 
HadoopFileIO(sparkSession.sparkContext().hadoopConfiguration());
   
       StaticTableOperations tableOps = new 
StaticTableOperations(metadataFileLocation, fileIO);
       Table table = new BaseTable(tableOps, "simpleTable");
       Result result = SparkActions.get()
               .rewriteTablePath(table)
               .rewriteLocationPrefix("/tmp/_source_bucket", 
"/tmp/_target_bucket")
               .execute();
   ```
   results in 
   ```
   java.lang.IllegalArgumentException: Path 
/tmp/_backup_bucket/simpleTable/metadata/xyz.metadata.json does not start with 
/tmp/_source_bucket/
   
        at 
org.apache.iceberg.RewriteTablePathUtil.relativize(RewriteTablePathUtil.java:686)
   ```
   
   Obviously, changing the prefix might get us through the initial metadat 
validation check, but cannot work, because the prefix does not match the one 
used in the metadata and manifests:
   ```
               .rewriteLocationPrefix("/tmp/_backup_bucket", 
"/tmp/_target_bucket")
   ```
   results in 
   ```
   java.lang.IllegalArgumentException: Path 
/tmp/_source_bucket/simpleTable/metadata/snap-{uuid}.avro does not start with 
/tmp/_source_bucket/
   
        at 
org.apache.iceberg.RewriteTablePathUtil.relativize(RewriteTablePathUtil.java:686)
   ```
   
   Any other options/ideas?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to