Skip to content

ARROW-10169: [Rust] Pretty print null PrimitiveTypes as empty strings - #8332

Closed
alamb wants to merge 3 commits into
apache:masterfrom
alamb:alamb/ARROW-10169-fix-null-in-pretty-print
Closed

ARROW-10169: [Rust] Pretty print null PrimitiveTypes as empty strings#8332
alamb wants to merge 3 commits into
apache:masterfrom
alamb:alamb/ARROW-10169-fix-null-in-pretty-print

Conversation

@alamb

@alambalamb commented Oct 3, 2020

Copy link
Copy Markdown
Contributor

Null values should be printed as "" when pretty printing. Prior to this PR, , null values in primitive arrays were rendered as the type's default value as pointed out by @jhorstmann on #8331 (comment)

@alambalamb changed the title [Rust] Pretty print null PrimitiveTypes as empty stringsARROW-10169: [Rust] Pretty print null PrimitiveTypes as empty stringsOct 3, 2020
/// Get the value at the given row in an array as a string
fn array_value_to_string(column: array::ArrayRef, row: usize) -> Result<String> {
match column.data_type() {
DataType::Utf8 => Ok(column

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no reason Utf8 couldn't use the same make_string! macro so I unified the code paths

@github-actions

Copy link
Copy Markdown

@jhorstmann

Copy link
Copy Markdown
Contributor

LGTM

@jorgecarleitaojorgecarleitao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@alamb@jhorstmann@jorgecarleitao@andygrove