Skip to content

expand docs for FixedSizeListArray#4622

Merged
tustvold merged 2 commits into
apache:masterfrom
smiklos:document-fixed-size-array
Aug 2, 2023
Merged

expand docs for FixedSizeListArray#4622
tustvold merged 2 commits into
apache:masterfrom
smiklos:document-fixed-size-array

Conversation

@smiklos

@smiklos smiklos commented Aug 2, 2023

Copy link
Copy Markdown
Contributor

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

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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

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

Copy link
Copy Markdown
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

smiklos commented Aug 2, 2023

Copy link
Copy Markdown
Contributor Author

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

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

tustvold commented Aug 2, 2023

Copy link
Copy Markdown
Contributor

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