-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array
--> Display
formatter that supports more options and is configurable
#3638
Comments
I think I would like to pick this one up, as I have opinions on what this should look like, and I want to take the opportunity to clean up the current code |
Another thing I would like out of this API would be a more natural avenue for streaming record batch conversion (as in https://docs.rs/arrow/31.0.0/arrow/util/pretty/fn.pretty_format_batches.html requires me to buffer up multiple batches of conversion which causes pain in the influxdb_iox client, among other things) |
* Lazy array display (#3638) * Update CSV writer * Borrow * Time formatting * Update pretty * Add FixedSizeBinaryArray * Further tweaks * Clippy * More clippy * More tweaks * More clippy * Clippy * Use lexical_core * Update doctest * Review feedback * Bump CI * Review feedback
|
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
There are several places where
Array
s and recordRecordBatch
es need to be converted to Strings for display or output purposes which are inconsistent and somewhat inefficient.The core function is
array_value_to_string
https://docs.rs/arrow/31.0.0/arrow/util/display/fn.array_value_to_string.htmlOne example of inconsistency is that when pretty printing https://docs.rs/arrow/31.0.0/arrow/util/pretty/index.html and writing out CSV it is possible to change the display formatting for data / timestamps but such control is not possible in
array_value_to_string
or while pretty printing.The current state of the API makes it difficult to add customization like different representations for the
NULL
value -- see #2474 (cc @JasonLi-cn)Describe the solution you'd like
What I would like is a configurable array formatter where formatting options can be specified and that does not need to return allocated
String
s (but could write directly to a stream if necessary).Here is how I would like to use it
The type signatures would look like
Describe alternatives you've considered
Additional context
Pretty much all of the formatting implementation already exists in the
display
module after @JayjeetAtGithub 's great work to reduce discrepancies in the CSV writer #3514. I think the core partTo implement this feature, I recommend a series of smaller PRs:
display
I think this is a good first issue as the desired API is spec'd out, and formatting logic already exists -- it just needs to be unified into a new API.
The text was updated successfully, but these errors were encountered: