This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 50ace05207 GH-38883: [Docs] Fix struct example to show hiding a
child's entry (#38898)
50ace05207 is described below
commit 50ace0520748349dccc84f89e04bef0c289a4dba
Author: Stas Stepanov <[email protected]>
AuthorDate: Mon Dec 18 06:02:07 2023 +0300
GH-38883: [Docs] Fix struct example to show hiding a child's entry (#38898)
### Rationale for this change
See the issue.
### What changes are included in this PR?
The struct example now demonstrates what it's supposed to.
### Are these changes tested?
Renders well
### Are there any user-facing changes?
Just docs.
* Closes: #38883
Authored-by: Stas Stepanov <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
docs/source/format/Columnar.rst | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/docs/source/format/Columnar.rst b/docs/source/format/Columnar.rst
index a6632fa2cf..56cb27626a 100644
--- a/docs/source/format/Columnar.rst
+++ b/docs/source/format/Columnar.rst
@@ -664,7 +664,9 @@ type.
**Example Layout: ``Struct<VarBinary, Int32>``**
-The layout for ``[{'joe', 1}, {null, 2}, null, {'mark', 4}]`` would be: ::
+The layout for ``[{'joe', 1}, {null, 2}, null, {'mark', 4}]``, having
+child arrays ``['joe', null, 'alice', 'mark']`` and ``[1, 2, null, 4]``
+would be: ::
* Length: 4, Null count: 1
* Validity bitmap buffer:
@@ -675,24 +677,24 @@ The layout for ``[{'joe', 1}, {null, 2}, null, {'mark',
4}]`` would be: ::
* Children arrays:
* field-0 array (`VarBinary`):
- * Length: 4, Null count: 2
+ * Length: 4, Null count: 1
* Validity bitmap buffer:
| Byte 0 (validity bitmap) | Bytes 1-63 |
|--------------------------|-----------------------|
- | 00001001 | 0 (padding) |
+ | 00001101 | 0 (padding) |
* Offsets buffer:
| Bytes 0-19 | Bytes 20-63 |
|----------------|-----------------------|
- | 0, 3, 3, 3, 7 | unspecified (padding) |
+ | 0, 3, 3, 8, 12 | unspecified (padding) |
* Value buffer:
- | Bytes 0-6 | Bytes 7-63 |
+ | Bytes 0-11 | Bytes 12-63 |
|----------------|-----------------------|
- | joemark | unspecified (padding) |
+ | joealicemark | unspecified (padding) |
* field-1 array (int32 array):
* Length: 4, Null count: 1
@@ -722,10 +724,10 @@ Therefore, to know whether a particular child entry is
valid, one must
take the logical AND of the corresponding bits in the two validity bitmaps
(the struct array's and the child array's).
-This is illustrated in the example above, the child arrays have valid entries
-for the null struct but they are "hidden" by the struct array's validity
-bitmap. However, when treated independently, corresponding entries of the
-children array will be non-null.
+This is illustrated in the example above, one of the child arrays has a
+valid entry ``'alice'`` for the null struct but it is "hidden" by the
+struct array's validity bitmap. However, when treated independently,
+corresponding entries of the children array will be non-null.
Union Layout
------------