openinx commented on a change in pull request #4264:
URL: https://github.com/apache/iceberg/pull/4264#discussion_r821313407
##########
File path: core/src/main/java/org/apache/iceberg/io/PartitioningWriter.java
##########
@@ -46,7 +46,7 @@
* @param spec a partition spec
* @param partition a partition or null if the spec is unpartitioned
*/
- void write(T row, PartitionSpec spec, StructLike partition);
+ PathOffset write(T row, PartitionSpec spec, StructLike partition);
Review comment:
As the `PartitioningWriter` will have multiple partition writers in its
internal implementation, so we can not just introduce the two methods in this
interface:
```java
/**
* Returns the file path that are currently opened.
*
* @return the current file path.
*/
CharSequence location();
/**
* Returns the row offset that are currently writing, starting from 0.
*
* @return the current row offset.
*/
long rowOffset();
```
Because those `location()` and `rowOffset()` are binded to specific writers.
In theory, different writers should have different `location()` and
`rowOffset()`. So here we add a return value `PathOffset` here to get the
latest wrote path & offset for the wrote row.
--
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]