0 YEARS -3 MONS 0 DAYS 0 HOURS 0 MINS 0.000000000 SECS
Describe the solution you'd like
It would be nice if the displayed version was closer to the original input and did not print out fields with 0 values explicitly. For the example above, it would be great to look more like
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Today if an interval like
-3 MONTH
is parsed into anIntervalArray
and then displayed using https://docs.rs/arrow/latest/arrow/util/display/fn.array_value_to_string.html the output is correct but overly verbose:Describe the solution you'd like
It would be nice if the displayed version was closer to the original input and did not print out fields with 0 values explicitly. For the example above, it would be great to look more like
Describe alternatives you've considered
@goldmedal implemented some version of this code as part of a DataFusion PR here https://github.com/apache/datafusion/pull/10956/commits/9ae676ccdb0866ba302bace4fdb226a5b2ec3b0e that might be a reasonable implementation to start from:
Any real representation should avoid allocating
vec![]
and strings (viaformat!
)And
Additional context