tustvold commented on code in PR #5166:
URL: https://github.com/apache/arrow-rs/pull/5166#discussion_r1415529952
##########
arrow-cast/src/display.rs:
##########
@@ -748,6 +752,19 @@ impl<'a, K: ArrowDictionaryKeyType> DisplayIndexState<'a>
for &'a DictionaryArra
}
}
+impl<'a, K: RunEndIndexType> DisplayIndexState<'a> for &'a RunArray<K> {
+ type State = Box<dyn DisplayIndex + 'a>;
+
+ fn prepare(&self, options: &FormatOptions<'a>) -> Result<Self::State,
ArrowError> {
+ make_formatter(self.values().as_ref(), options)
+ }
+
+ fn write(&self, s: &Self::State, idx: usize, f: &mut dyn Write) ->
FormatResult {
+ let value_idx = self.get_physical_index(idx);
Review Comment:
It is perhaps worth noting that this has complexity `O(log(n))`, but given
this code is formatting to strings, the performance of this may not matter too
much.
--
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]