Skip to content
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

expand docs for FixedSizeListArray #4622

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

smiklos
Copy link
Contributor

@smiklos smiklos commented Aug 2, 2023

Which issue does this PR close?

Relates to #4607

Rationale for this change

Added extra docs to FixedSizeListArray to document its logical and physical layout.

What changes are included in this PR?

Just docs

Are there any user-facing changes?

Noe

Noe

@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 2, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @smiklos -- I think this is very nice 👌

Comment on lines 70 to 72
/// │ [C,NULL] │ │ 1 │ │ │ 0 │ │ NULL │ │ 2
/// └─────────────┘ │ └───┘ ├───┤ ├──────┤ │
/// | │ 0 │ │ NULL │ │ 3
Copy link
Contributor

Choose a reason for hiding this comment

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

When an array element is null, the values can be anything (valid). So I suggest using ???? to show that the contents could be something unknown:

Suggested change
/// │ [C,NULL] │ │ 1 │ │ │ 0 │ │ NULL │ │ 2
/// └─────────────┘ │ └───┘ ├───┤ ├──────┤ │
/// | │ 0 │ │ NULL │ │ 3
/// │ [C,NULL] │ │ 1 │ │ │ 0 │ │ ???? │ │ 2
/// └─────────────┘ │ └───┘ ├───┤ ├──────┤ │
/// | │ 0 │ │ ???? │ │ 3

/// Logical Values │ Validity ├───┤ ├──────┤ │
/// (nulls) │ │ 1 │ │ C │ │ 4
/// │ ├───┤ ├──────┤ │
/// │ │ 0 │ │ NULL │ │ 5
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing here:

Suggested change
/// │ │ 0 │ │ NULL │ │ 5
/// │ │ 0 │ │ ??? │ │ 5

@@ -60,6 +113,9 @@ use std::sync::Arc;
/// assert_eq!( &[3, 4, 5], list1.as_any().downcast_ref::<Int32Array>().unwrap().values());
/// assert_eq!( &[6, 7, 8], list2.as_any().downcast_ref::<Int32Array>().unwrap().values());
/// ```
///
/// [`StringArray`]: crate::array::StringArray
/// An array of [fixed size arrays](https://arrow.apache.org/docs/format/Columnar.html#fixed-size-list-layout)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this link formatting is a little off

Suggested change
/// An array of [fixed size arrays](https://arrow.apache.org/docs/format/Columnar.html#fixed-size-list-layout)
/// [fixed size arrays]: https://arrow.apache.org/docs/format/Columnar.html#fixed-size-list-layout

@smiklos
Copy link
Contributor Author

smiklos commented Aug 2, 2023

Pushed the recommended changes @alamb . Thanks for the review!

@tustvold tustvold merged commit 70094a5 into apache:master Aug 2, 2023
@tustvold
Copy link
Contributor

tustvold commented Aug 2, 2023

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants