albertlockett commented on code in PR #9196:
URL: https://github.com/apache/arrow-rs/pull/9196#discussion_r2700579512
##########
arrow-ipc/src/writer.rs:
##########
@@ -986,6 +986,16 @@ impl DictionaryTracker {
DictionaryComparison::Equal => unreachable!("Already checked equal
case"),
}
}
+
+ /// Resets the state of the dictionary tracker.
+ ///
+ /// This allows the dictionary tracker to be reused for a new IPC stream
while avoiding the
+ /// allocation cost of creating a new instance. This method should not be
called if
+ /// the dictionary tracker will be used to continue writing to the an
existing IPC stream.
+ pub fn reset(&mut self) {
Review Comment:
@alamb thanks for the review. Renamed to `clear` and added the comment
reminding that future fields might need to be cleared.
WRT to `error_on_replacement`, I don't think the `clear` method should
toggle this flag. This field is less like computed state, and more like a
property that ensures the `DictionaryTracker` behaves correctly within the
context in which it's used. As far as I know, the nominal use case for this
flag is that it should be set to `false` when writing IPC file format (where
dictionary replacement messages are not allowed).
--
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]