[
https://issues.apache.org/jira/browse/ARROW-10169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated ARROW-10169:
-----------------------------------
Labels: pull-request-available (was: )
> [Rust] Nulls should be rendered as "" rather than default value when pretty
> printing arrays
> -------------------------------------------------------------------------------------------
>
> Key: ARROW-10169
> URL: https://issues.apache.org/jira/browse/ARROW-10169
> Project: Apache Arrow
> Issue Type: Bug
> Reporter: Andrew Lamb
> Assignee: Andrew Lamb
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Null values should be printed as "" when pretty printing. However, as of now,
> null values in primative arrays are rendered as the type's default value .
> For example:
> {code}
> fn test_pretty_format_batches() -> Result<()> {
> // define a schema.
> let schema = Arc::new(Schema::new(vec![
> Field::new("a", DataType::Utf8, true),
> Field::new("b", DataType::Int32, true),
> ]));
> // define data.
> let batch = RecordBatch::try_new(
> schema,
> vec![
> Arc::new(array::StringArray::from(vec![Some("a"), Some("b"),
> None, Some("d")])),
> Arc::new(array::Int32Array::from(vec![Some(1), None,
> Some(10), Some(100)])),
> ],
> )?;
> println!(pretty_format_batches(&[batch])?);
> Ok(())
> }
> {code}
> Outputs:
> {code}
> +---+-----+
> | a | b |
> +---+-----+
> | a | 1 |
> | b | 0 |
> | | 10 |
> | d | 100 |
> +---+-----+
> {code}
> The second row of b should be '', not 0. The third row of a should also be
> '', which I think t is by accident
> Thanks to [~jhorstmann] horstmann for pointing this out on
> https://github.com/apache/arrow/pull/8331#issuecomment-702964608
--
This message was sent by Atlassian Jira
(v8.3.4#803005)