amitwdh opened a new issue, #13999:
URL: https://github.com/apache/iceberg/issues/13999

   ### Apache Iceberg version
   
   1.9.0
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   **Hello Iceberg team,**
   Observing the extra forward `/ ` after the `/data/ `in the s3 after 
ingesting the data to non-partitioned iceberg table.
   Using `PartitionedFanoutWriter`.
   
`s3://t-staging-store-u/etgY-500LTFOEQFUTeq-client-w-w1-05094653/c-iceberg/500LTFOEQFUTeq/1-bundle/rate_nl_05ef3ea7-83fa-4914-aff1-d226e78dadf4/data//00001-1-7b155e67-19fb-4ff6-8471-1877016addd2-00001.parquet`
   
   Using iceberg: 1.9.0
   
   `package org.apache.iceberg.LocationProviders.java;` In default location 
provider, below code is add that extra slash but ideally it shouldn't add that 
empty directory, right.
   ```
       @Override
       public String newDataLocation(PartitionSpec spec, StructLike 
partitionData, String filename) {
         return String.format("%s/%s/%s", dataLocation, 
spec.partitionToPath(partitionData), filename);
       }
   ```
   
   `if (spec.isUnpartitioned() || partition == null)`
   I think the below condition should be replaced with the above one.
   
https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/io/BaseTaskWriter.java#L330
   ```
       private void openCurrent() {
         if (partitionKey == null) { <---------------------
           // unpartitioned
           this.currentFile = fileFactory.newOutputFile();
         } else {
           // partitioned
           this.currentFile = fileFactory.newOutputFile(partitionKey);
         }
         this.currentWriter = newWriter(currentFile, partitionKey);
         this.currentRows = 0;
       }
   ```
   Any opinions please?
   
   ### Willingness to contribute
   
   - [x] I can contribute a fix for this bug independently
   - [x] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to