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

   ### Apache Iceberg version
   
   1.3.1 (latest release)
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   Current logic will invoke write with partition parameters when `partition` 
object is null (see below code snippet). But it does not consider the case 
where `partition` is not null but size is 0. This caused 
`locations.newDataLocation()` return location with extraneous slash (e.g. 
`s3://table_location/data//filename`). 
   
   ```
     private EncryptedOutputFile newFile() {
       if (partition == null) {
         return fileFactory.newOutputFile();
       } else {
         return fileFactory.newOutputFile(spec, partition);
       }
     }
   ```
   
   When S3FileIO is used, the extra slash will not be removed so the s3 object 
contains extra slash. When HadoopFileIO is used, it will be removed (thus this 
bug is not captured in unit test).


-- 
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