the-other-tim-brown commented on code in PR #17916:
URL: https://github.com/apache/hudi/pull/17916#discussion_r2699371864
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/io/lance/HoodieBaseLanceWriter.java:
##########
@@ -194,27 +212,18 @@ public void close() throws IOException {
* Flush buffered records to Lance file.
*/
private void flushBatch() throws IOException {
- if (bufferedRecords.isEmpty()) {
- return;
+ if (currentBatchSize == 0) {
+ return; // Nothing to flush
}
- // Lazy initialization of writer and root
- if (writer == null) {
- initializeWriter();
- }
- if (root == null) {
- root = VectorSchemaRoot.create(getArrowSchema(), allocator);
- }
+ // Finalize the arrow writer (sets row count on VectorSchemaRoot)
+ arrowWriter.finish();
Review Comment:
It will do some operation on the fields as well, I just made it match the
implementation name but I think something like `closeBatch` or `finishBatch`
may be more telling
--
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]