You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "AlenkaF (via GitHub)" <gi...@apache.org> on 2024/05/08 15:32:20 UTC

[PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

AlenkaF opened a new pull request, #41593:
URL: https://github.com/apache/arrow/pull/41593

   ### Rationale for this change
   
   The documentation for Arrow Format could be improved:
   
   - all types are not listed
   - all layouts are not explained
   
   ### What changes are included in this PR?
   
   This PR includes:
   
   - motivation behind the columnar format
   - different physical layouts explained together with diagrams of example type in comparison to the physical layout
   - Arrow terminology
   - Arrow C Data interface
   
   in a separate "introduction" page with no technical details The table with all types listed together with their physical layout will be added in a separate PR to existing _Columnar.rst_ page.
   
   TODO:
   
   - union type
   - ree type
   - restructure Specification landing page and left sidebar menu
   
   ### Are these changes tested?
   
   No, this is a docs change.
   
   ### Are there any user-facing changes?
   
   No.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637336097


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows

Review Comment:
   ```suggestion
   This kind of data can be represented in memory using a row-based format or a
   column-based format. The row-based format stores data row-by-row meaning the rows
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1615785152


##########
docs/source/format/images/dense-union-diagram.svg:
##########


Review Comment:
   Done: https://github.com/apache/arrow/pull/41593/commits/7312c2c708e6ac7a53bb6008768952ce01bf0d35
   
   Not sure about the Types buffer of the Sparse Union though ..



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2358266612

   @github-actions crossbow submit preview-docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1776707096


##########
docs/source/format/images/ree-diagram.svg:
##########


Review Comment:
   https://github.com/apache/arrow/pull/41593/commits/a5175491f35b18247102ed4b3f745aae661e3278



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602352183


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type

Review Comment:
   ```suggestion
   * Universally unique identifiers (UUID) can be represented as a FixedSizeBinary type
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602359136


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+RecordBatch
+-----------
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+Schema
+------
+A collection of fields with optional metadata that determines all the data types of an object
+like a record batch or table.
+
+Table
+-----
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of chunked

Review Comment:
   ```suggestion
   A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
   ```



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+RecordBatch
+-----------
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+Schema
+------
+A collection of fields with optional metadata that determines all the data types of an object
+like a record batch or table.
+
+Table
+-----
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of chunked
+arrays. All chunked arrays have the same length, but may have different types. Different columns

Review Comment:
   ```suggestion
   Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2133071981

   @jorisvandenbossche I have addressed all of your comments.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602336913


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key

Review Comment:
   ```suggestion
   The difference between the struct and map types is that a struct holds the key
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602329769


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+

Review Comment:
   ```suggestion
   
   .. _Apache ORC: https://orc.apache.org/
   .. _Apache Parquet: https://parquet.apache.org/
   
   ```
   
   I'm bad at RST so let's check that this syntax is correct.



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)

Review Comment:
   ```suggestion
   * Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602327937


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is

Review Comment:
   ```suggestion
   workflows that meant copy and convert the data between them, which is
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637341341


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values

Review Comment:
   ```suggestion
   Support for Null Values
   ```
   
   I think title-case is the norm (?)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1607708969


##########
docs/source/format/images/var-string-view-diagram.svg:
##########


Review Comment:
   Good catch! Will correct 👍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1603050353


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,519 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts

Review Comment:
   I think before starting here with explaining the primitive layout, we should explain what we mean with a "layout"?



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,519 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems

Review Comment:
   I am not familiar enough with this exact terminology, but would remove the "systems" part (not sure why this would be specifically "system problems")



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,519 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.

Review Comment:
   Should we mention this explicitly, given that we don't actually have compression capabilities in the in-memory format itself? 
   (we do have it in the IPC spec, though)



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,519 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------

Review Comment:
   I don't have a direct suggestion of how to solve it, but because "Support for null values" header is nested under the "Primitive layouts"  header, that might give the wrong impression that this is only for primitive layouts?



##########
docs/source/format/FormatIntro.rst:
##########


Review Comment:
   Small nitpick, but I would just call this "Intro.rst" (we could later add a brief into to other parts of the spec as well, like a brief explainer of what IPC is), that will also look better in the resulting url



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,519 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts

Review Comment:
   And reading a bit further, other terms are used without them really being introduced, like "buffer" (eg, we could first have a generic explanation of an Array of a certain type having a certain physical layout, which describes the buffers)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602337052


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,

Review Comment:
   ```suggestion
   in the schema, and therefore need to be a string, and the values in the child arrays,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2121916496

   Revision: 830ac9ae527d1d599efd49bd66b2c5ca044ea414
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-ed83863144](https://github.com/ursacomputing/crossbow/branches/all?query=actions-ed83863144)
   
   |Task|Status|
   |----|------|
   |preview-docs|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-ed83863144-github-preview-docs)](https://github.com/ursacomputing/crossbow/actions/runs/9170430730/job/25212669129)|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2133077164

   Revision: 7312c2c708e6ac7a53bb6008768952ce01bf0d35
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-042f60b807](https://github.com/ursacomputing/crossbow/branches/all?query=actions-042f60b807)
   
   |Task|Status|
   |----|------|
   |preview-docs|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-042f60b807-github-preview-docs)](https://github.com/ursacomputing/crossbow/actions/runs/9252645829/job/25450662943)|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637692450


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column

Review Comment:
   > Perhaps a sub-section discussing row-by-row and column-by-column should be added before the "Arrow Columnar Format" section can focus solely on the columnar arrow format.
   
   +1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2102641894

   Revision: 3cdd97a0af2bea1914b7e9b0e7a04e47e04e0c41
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-4a1cc2326d](https://github.com/ursacomputing/crossbow/branches/all?query=actions-4a1cc2326d)
   
   |Task|Status|
   |----|------|
   |preview-docs|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-4a1cc2326d-github-preview-docs)](https://github.com/ursacomputing/crossbow/actions/runs/9017864145/job/24777209285)|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637339658


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,

Review Comment:
   ```suggestion
   In a columnar format, the data is organized column-by-column instead.
   This organization makes analytical operations like filtering, grouping,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637702896


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.

Review Comment:
   Two comments here (cc @felipecrv as I think you suggested this paragraph):
   
   - If we mention inter-process communication here, should we also mention zero-copy within-processing sharing? (i.e. what the C Data Interface provides). Also, I know we generally say about the IPC protocol that it is zero copy, but of course it's not entirely zero copy, so mentioning it twice in context of IPC is maybe a bit too much
   - I find the mention of "more efficient reading and writing of file formats" a bit out of place now, because it's not really the format itself that enables to read eg a Parquet file more efficiently? (it's that many Arrow implementation will provide this functionality as well, and that we can more easily reuse such implementations if they read into Arrow format)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.

Review Comment:
   Maybe you can add a caption here as well for those figures (like you do for the ones below)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being

Review Comment:
   ```suggestion
      `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
   ```
   
   ("bit-endianness" is the generic term about the concept, but doesn't say if its then little endian or big endian)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string

Review Comment:
   The format spec actually uses "variable-size" instead of "length", so should probably also stick to that terminology to be consistent.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view data type allows arrays to specify out-of-order offsets.

Review Comment:
   Can you expand this explanation a bit?
   
   (I think the main point is that in addition to the offsets buffer, there is now also a sizes buffer. The offsets still indicate the start of each element, but the size is not inferred from the next offset value, but now coded explicitly in a separate sizes buffer. That allows to have out-of-order offsets.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of

Review Comment:
   ```suggestion
   The limitation of data types using 32 bit offsets is that they have a maximum size of
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.

Review Comment:
   I would explicitly call out here that this is depicted that way in the diagrams



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the

Review Comment:
   ```suggestion
      The boolean data type is represented with a primitive layout where the
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot

Review Comment:
   ```suggestion
   Fixed-size list is a special case of variable-size list where each column slot
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together

Review Comment:
   The previous section for fixed-size primitive starts with
   
   > A primitive column represents an array of values where each value has the same physical size measured in bytes.
   
   so you start here in a similar way, something like "In contrast to the fixed-size layout, the variable-size layout allows to represent an array where each element can have a variable size in bytes. This layout is used for binary and string data."
   
   Then it's also clearer what "the bytes of all elements" are exactly referring to.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.

Review Comment:
   I would add here something like (to connect the array with buffer concepts): "An array consists of one or more buffers"



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in

Review Comment:
   ```suggestion
   is a nested data type (parent) that has one child (the data type of the values in
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values

Review Comment:
   It's indeed very inconsistent... I think that many newer parts of the docs actually use sentence-case
   
   (my personal preference if for sentence-case, but foremost we should be consistent)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view data type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested data type parameterized by an ordered sequence of data types.

Review Comment:
   ```suggestion
   A struct is a nested data type parameterized by an ordered sequence of fields (a data types and a name).
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view data type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested data type parameterized by an ordered sequence of data types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+The Map data type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map data types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the

Review Comment:
   ```suggestion
   in the schema, requiring keys to be strings, and the values are stored in the
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view data type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested data type parameterized by an ordered sequence of data types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+The Map data type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map data types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same data type, but not necessarily strings) and a second
+child array holding all the values. The values need to be of the same data type; however,
+the data type doesn't have to match that of the keys.
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested data type where each slot in the union has a value with a data type
+chosen from a subset of possible Arrow data types. That means that a union array represents
+a mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union data types, "dense" and "sparse".
+
+Dense Union
+^^^^^^^^^^^
+
+A Dense Union has one child array for each data type present in the mixed-type array and
+two buffers of its own:
+
+* **Types buffer:** holds data type id for each slot of the array. Data type id is
+  frequently the index of the child array; however, the relationship between data type
+  ID and the child index is a parameter of the data type.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+buffer. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when one has data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+of its own, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends. The run ends
+    array always begins with 0 and contains one more element than the length of
+    its parent array.

Review Comment:
   ```suggestion
   *  **Run ends array:** holds the index in the array where each run ends. The run ends
      array always begins with 0 and contains one more element than the length of
      its parent array.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1633235627


##########
docs/source/format/images/all-diagrams.svg:
##########


Review Comment:
   Added a note nevertheless ;)
   https://github.com/apache/arrow/pull/41593/commits/9f9bbff0c00026fe8544292bc28e358b7c2ffa47



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637336097


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows

Review Comment:
   ```suggestion
   This kind of data can be represented in memory using a row-based format or a
   column-based format. The row based format stores data by row meaning the rows
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1776706431


##########
docs/source/format/images/bool-diagram.svg:
##########


Review Comment:
   https://github.com/apache/arrow/pull/41593/commits/f05c732d1470f5f2a447919e76f331b946f942f1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1778812116


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,512 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduces computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing. More detail
+about how implementations differ can be found on the :ref:`status` page.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This covers topics like:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data. For an example, let's consider
+we have data that can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+Tabular data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others, more efficient thanks to memory locality.
+When processing the data, the memory locations accessed by the CPU tend
+be near one another. By keeping the data contiguous in memory, it also
+enables vectorization of the computations. Most modern CPUs have
+`SIMD instructions`_ (a single instruction that operates on multiple values at
+once) enabling parallel processing and execution of operations on vector data
+using a single CPU instruction.
+
+.. _SIMD instructions: https://en.wikipedia.org/wiki/Single_instruction,_multiple_data
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the

Review Comment:
   ```suggestion
      This is also how we have represented the validity bitmaps in the
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602333742


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").

Review Comment:
   ```suggestion
   layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602358811


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+RecordBatch
+-----------
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+Schema
+------
+A collection of fields with optional metadata that determines all the data types of an object
+like a record batch or table.

Review Comment:
   ```suggestion
   like a RecordBatch or Table.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602358138


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow

Review Comment:
   ```suggestion
   
   .. _GeoArrow: https://github.com/geoarrow/geoarrow
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2116392608

   Revision: 0af1708219682c9b32f04ac3904a11e62affaeed
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-dde0f75093](https://github.com/ursacomputing/crossbow/branches/all?query=actions-dde0f75093)
   
   |Task|Status|
   |----|------|
   |preview-docs|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-dde0f75093-github-preview-docs)](https://github.com/ursacomputing/crossbow/actions/runs/9120682380/job/25078492680)|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2133072524

   @github-actions crossbow submit preview-docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2120409237

   Not sure what is it but there seems to be something going on with the left hand side panel. If I go to [the columnar format page](http://crossbow.voltrondata.com/pr_docs/41593/format/Columnar.html) the tutorial link does not appear:
   ![image](https://github.com/apache/arrow/assets/639755/994328f1-01d2-44aa-8edc-eafca8267b1f)
   If I manually go [to the Intro page](http://crossbow.voltrondata.com/pr_docs/41593/format/FormatIntro.html) it appears but there is a wrong increased level after `Arrow Columnar Format`, see the image below:
   ![image](https://github.com/apache/arrow/assets/639755/2686fc7f-c4a9-4b28-8b6e-949ca713381a)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1764916919


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.

Review Comment:
   I have reverted the change in the last paragraph of the intro section from https://github.com/apache/arrow/pull/41593/commits/e2dc4bfb5505bc042b9ee9ebb3c69e93aec5937c. The change can be seen here: https://github.com/apache/arrow/pull/41593/commits/581daf346e80dceffc5291f78cb5149e6b4d3c4e.
   
   Would you agree with the intro now @jorisvandenbossche @felipecrv ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1775085977


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested Layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data type of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed Size List
+---------------
+
+Fixed-size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List View
+---------
+
+In contrast to the list type, list view type also has a size buffer together
+with an offset buffer. The offsets continue to indicate the start of each
+element but size is now saved in a separate size buffer. This allows to have
+out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested data type parameterized by an ordered sequence of fields
+(a data types and a name).
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+The Map data type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map data types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same data type, but not necessarily strings) and a second
+child array holding all the values. The values need to be of the same data type; however,
+the data type doesn't have to match that of the keys.
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested data type where each slot in the union has a value with a data type
+chosen from a subset of possible Arrow data types. That means that a union array represents
+a mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union data types, "dense" and "sparse".
+
+Dense Union
+^^^^^^^^^^^
+
+A Dense Union has one child array for each data type present in the mixed-type array and
+two buffers of its own:
+
+* **Types buffer:** holds data type id for each slot of the array. Data type id is
+  frequently the index of the child array; however, the relationship between data type
+  ID and the child index is a parameter of the data type.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+buffer. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when one has data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+of its own, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends. The run ends
+   array always begins with 0 and contains one more element than the length of
+   its parent array.

Review Comment:
   Ah, thanks for pointing this out! I changed the content here: https://github.com/apache/arrow/pull/41593/commits/8a1abe2acbefa96e4af9a5e0a9a4dce328715b79



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1632771895


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.

Review Comment:
   Decided to add it under the schema, not as a specific "term", because it is very specific to the RecordBatch/Table (just like the schema though) and we use fields in this document that are connected to the types and their layouts (struct for example). Feel it might add some confusion. Could be wrong!
   
   https://github.com/apache/arrow/pull/41593/commits/44aeebf45499c433f37f58365baee9756d617dad



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1632786773


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.

Review Comment:
   My attempt: https://github.com/apache/arrow/pull/41593/commits/6311e73cc618ce3179a0f445cfb4ae5a07d00693
   
   @danepitkin does this sound right?
   
   > In Java implementation, for example, a Table is not a collection of Chunked Arrays but a collection of RecordBatches.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602361549


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+RecordBatch
+-----------
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+Schema
+------
+A collection of fields with optional metadata that determines all the data types of an object
+like a record batch or table.
+
+Table
+-----
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of chunked
+arrays. All chunked arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+The Arrow C Data Interface
+==========================
+
+Arrow memory layout is meant to be a universal standard for tabular data, not tied to a specific
+implementation.
+
+While there are specifications to share Arrow data between processes or over the network (e.g. the
+IPC messages), the Arrow C Data Interface is meant to actually zero-copy share the data between
+different libraries within the same process (i.e. actually share the same buffers in memory).
+
+The Arrow C Data Interface defines a set of small C structures
+
+.. code-block::
+
+   struct ArrowSchema {
+   const char* format;
+   const char* name;
+   const char* metadata;
+   int64_t flags;
+   int64_t n_children;
+   struct ArrowSchema** children;
+   struct ArrowSchema* dictionary;
+
+   // Release callback
+   void (*release)(struct ArrowSchema*);
+   // Opaque producer-specific data
+   void* private_data;
+   };
+
+   struct ArrowArray {
+   int64_t length;
+   int64_t null_count;
+   int64_t offset;
+   int64_t n_buffers;
+   int64_t n_children;
+   const void** buffers;
+   struct ArrowArray** children;
+   struct ArrowArray* dictionary;
+
+   // Release callback
+   void (*release)(struct ArrowArray*);
+   // Opaque producer-specific data
+   void* private_data;
+   };
+
+The C Data Interface passes Arrow data buffers through memory pointers. So, by construction, it allows
+you to share data from one runtime to another without copying it. Since the data is in standard Arrow
+in-memory format, its layout is well-defined and unambiguous.
+
+.. seealso::
+   The :ref:`c-data-interface` documentation.
+
+NanoArrow
+=========
+
+The Arrow libraries are growing with a lot of functionality and
+`nanoarrow <https://github.com/apache/arrow-nanoarrow>`_ was born to
+solve the problem where linking to the Arrow implementation is
+difficult or impossible.
+
+The NanoArrow library is a set of helper functions to interpret and

Review Comment:
   ```suggestion
   The nanoarrow library is a set of helper functions to interpret and
   ```



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+RecordBatch
+-----------
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+Schema
+------
+A collection of fields with optional metadata that determines all the data types of an object
+like a record batch or table.
+
+Table
+-----
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of chunked
+arrays. All chunked arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+The Arrow C Data Interface
+==========================
+
+Arrow memory layout is meant to be a universal standard for tabular data, not tied to a specific
+implementation.
+
+While there are specifications to share Arrow data between processes or over the network (e.g. the
+IPC messages), the Arrow C Data Interface is meant to actually zero-copy share the data between
+different libraries within the same process (i.e. actually share the same buffers in memory).
+
+The Arrow C Data Interface defines a set of small C structures
+
+.. code-block::
+
+   struct ArrowSchema {
+   const char* format;
+   const char* name;
+   const char* metadata;
+   int64_t flags;
+   int64_t n_children;
+   struct ArrowSchema** children;
+   struct ArrowSchema* dictionary;
+
+   // Release callback
+   void (*release)(struct ArrowSchema*);
+   // Opaque producer-specific data
+   void* private_data;
+   };
+
+   struct ArrowArray {
+   int64_t length;
+   int64_t null_count;
+   int64_t offset;
+   int64_t n_buffers;
+   int64_t n_children;
+   const void** buffers;
+   struct ArrowArray** children;
+   struct ArrowArray* dictionary;
+
+   // Release callback
+   void (*release)(struct ArrowArray*);
+   // Opaque producer-specific data
+   void* private_data;
+   };
+
+The C Data Interface passes Arrow data buffers through memory pointers. So, by construction, it allows
+you to share data from one runtime to another without copying it. Since the data is in standard Arrow
+in-memory format, its layout is well-defined and unambiguous.
+
+.. seealso::
+   The :ref:`c-data-interface` documentation.
+
+NanoArrow
+=========
+
+The Arrow libraries are growing with a lot of functionality and
+`nanoarrow <https://github.com/apache/arrow-nanoarrow>`_ was born to
+solve the problem where linking to the Arrow implementation is
+difficult or impossible.
+
+The NanoArrow library is a set of helper functions to interpret and
+generate Arrow C Data Interface and Arrow C Stream Interface structures.
+The library is in active development.
+
+The NanoArrow Python bindings are intended to support clients that wish

Review Comment:
   ```suggestion
   The nanoarrow Python bindings are intended to support clients that wish
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602329769


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+

Review Comment:
   ```suggestion
   
   .. _apache_orc: https://orc.apache.org/
   .. _apache_parquet: https://parquet.apache.org/
   
   ```
   
   I'm bad at RST so let's check that this syntax is correct.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602358585


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.

Review Comment:
   ```suggestion
      Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602333969


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string

Review Comment:
   ```suggestion
   This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2147514829

   This is a bigger PR but only documentation and would need some 👀 in case anybody has time: http://crossbow.voltrondata.com/pr_docs/41593/format/Intro.html @felipecrv @paleolimbot @danepitkin 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2159735252

   @github-actions crossbow submit preview-docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637344071


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view

Review Comment:
   ```suggestion
   List and Large List View
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2102637901

   @github-actions crossbow submit preview-docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1595447563


##########
docs/source/format/index.rst:
##########
@@ -22,17 +22,38 @@ Specifications
 
 .. toctree::
    :maxdepth: 2
+   :caption: Arrow Columnar Format
+   :hidden:
 
-   Versioning
+   FormatIntro
    Columnar

Review Comment:
   @jorisvandenbossche haven't removed the IPC to a separate file as the opposite was done [here](https://github.com/apache/arrow/pull/5202/files#diff-6569a570a17ffd52bbe0b4f58cc6da2610ede6ac9c9d0771f46a01e80202946e) and the _IPC.rst_ is now an orphaned site.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2358270927

   Revision: 581daf346e80dceffc5291f78cb5149e6b4d3c4e
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-ace5dab0c4](https://github.com/ursacomputing/crossbow/branches/all?query=actions-ace5dab0c4)
   
   |Task|Status|
   |----|------|
   |preview-docs|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-ace5dab0c4-github-preview-docs)](https://github.com/ursacomputing/crossbow/actions/runs/10921600703/job/30314066268)|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1626251937


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.

Review Comment:
   Great catch!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602357914


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries

Review Comment:
   ```suggestion
   * `GeoArrow`_ - collection of Arrow extension types for representing vector geometries
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602337052


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,

Review Comment:
   ```suggestion
   in the schema, requiring keys to be strings, and the values are stored in in the 
   child arrays,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1633221555


##########
docs/source/format/images/all-diagrams.svg:
##########


Review Comment:
   Ah, got it. No need for a note if nobody else was confused 🙂 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637341341


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values

Review Comment:
   ```suggestion
   Support for Null Values
   ```
   
   I think title-case is the norm (?) even though is not very consistent in the Arrow docs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2114654950

   > * Did an editing pass over the text. Feel free to ignore any you don't like.
   
   Thank you a bunch, this is very very helpful!
   
   > * I'm a bit late in the process here but I noticed in the diagrams that we use `-` for null. It kinda looks like a minus symbol sometimes instead of indicating a missing element. I wonder if a `_` or `?` might be more clear? I realize part of the issue here is due to limitations of Excalidraw.
   
   Not late at all, I can still make changes and I really wish for the diagrams to be as clear as possible. And you are correct, for example in the fixed size list this issue gets very visible when `-7` is used. I am not sure about `?` though, `_` feels a bit better. The specifications use the term `unspecified`. I am not sure what Matt uses in his book as I do not have it with me at the moment, but I think it is some kind of an abbreviation (`U` or `UN` maybe?)
   
   > Edit: There was some phrasing that I think could still be tweaked that I didn't add as suggestions so if you'd be okay with that I could do another pass over the text. Lemme know.
   
   That would be super great, if you have time, thank you!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2116390983

   @github-actions crossbow submit preview-docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1771705132


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:

Review Comment:
   ```suggestion
   in-memory analytical data processing. This covers topics like:
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a

Review Comment:
   ```suggestion
   Tabular data can be represented in memory using a row-based format or a
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.

Review Comment:
   ```suggestion
   The offsets buffer is always one element longer than the array.
   The last two offsets define the start and the end of the last
   binary/string element.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").

Review Comment:
   ```suggestion
   `Velox`_ (and sometimes also called "German strings").
   ```
   
   We can drop "style" now
   https://cedardb.com/blog/german_strings/



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested Layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data type of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed Size List
+---------------
+
+Fixed-size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.

Review Comment:
   This is a very nice way of explaining the layouts. By relating them to each other like this. 👏 



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.

Review Comment:
   ```suggestion
   to the data buffer, the bytes of all elements do not need to be stored
   consecutively in a single buffer. This enables out of order writing of
   variable length elements into the array.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:

Review Comment:
   ```suggestion
   Apache Arrow focuses on tabular data. For an example, let's consider
   we have data that can be organized into a table:
   ```
   
   ...or any reorganization that avoids the repetition of tabular data and its definition (i.e. data that can be organized into a table).



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size

Review Comment:
   ```suggestion
   allows representing an array where each element can have a variable size
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern

Review Comment:
   ```suggestion
   This organization makes analytical operations like filtering, grouping,
   aggregations and others, more efficient thanks to memory locality.
   When processing the data, the memory locations accessed by the CPU tend
   be near one another. By keeping the data contiguous in memory, it also
   enables vectorization of the computations. Most modern
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.

Review Comment:
   ```suggestion
   Binary and string data types share the same physical layout. The only
   difference between them is that a string-typed array is assumed to contain
   valid utf-8 string data.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters

Review Comment:
   ```suggestion
   It includes the length of the string, and then either its characters appearing
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.

Review Comment:
   ```suggestion
   The main difference to the classical binary and string layout is the views buffer.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.

Review Comment:
   ```suggestion
   consecutively in a single buffer or region of memory. To know where each element
   of the column starts and ends, the physical layout also includes integer offsets.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"

Review Comment:
   ```suggestion
   determined within the first four bytes. Selecting elements is a simple "gather"
   ```
   
   I know Arrows uses "take" but the world refers to these more commonly as "gather".
   
   https://en.wikipedia.org/wiki/Gather/scatter_(vector_addressing)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer

Review Comment:
   ```suggestion
   one of the potentially several data buffers. Because it uses an offset and length to refer
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested Layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data type of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed Size List
+---------------
+
+Fixed-size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List View
+---------
+
+In contrast to the list type, list view type also has a size buffer together
+with an offset buffer. The offsets continue to indicate the start of each
+element but size is now saved in a separate size buffer. This allows to have
+out-of-order offsets.

Review Comment:
   ```suggestion
   element but size is now saved in a separate size buffer. This allows
   out-of-order offsets as the sizes aren't derived from the consecutive
   offsets anymore.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested Layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data type of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed Size List
+---------------
+
+Fixed-size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List View
+---------
+
+In contrast to the list type, list view type also has a size buffer together
+with an offset buffer. The offsets continue to indicate the start of each
+element but size is now saved in a separate size buffer. This allows to have
+out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested data type parameterized by an ordered sequence of fields
+(a data types and a name).

Review Comment:
   ```suggestion
   (a data type and a name).
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested Layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data type of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed Size List
+---------------
+
+Fixed-size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List View
+---------
+
+In contrast to the list type, list view type also has a size buffer together
+with an offset buffer. The offsets continue to indicate the start of each
+element but size is now saved in a separate size buffer. This allows to have
+out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested data type parameterized by an ordered sequence of fields
+(a data types and a name).
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)

Review Comment:
   ```suggestion
   * Child arrays are independent and need not be adjacent to each other in
     memory. They only need to have the same length.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested Layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data type of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed Size List
+---------------
+
+Fixed-size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List View
+---------
+
+In contrast to the list type, list view type also has a size buffer together
+with an offset buffer. The offsets continue to indicate the start of each
+element but size is now saved in a separate size buffer. This allows to have
+out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested data type parameterized by an ordered sequence of fields
+(a data types and a name).
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+The Map data type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map data types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same data type, but not necessarily strings) and a second
+child array holding all the values. The values need to be of the same data type; however,
+the data type doesn't have to match that of the keys.
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested data type where each slot in the union has a value with a data type
+chosen from a subset of possible Arrow data types. That means that a union array represents
+a mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union data types, "dense" and "sparse".
+
+Dense Union
+^^^^^^^^^^^
+
+A Dense Union has one child array for each data type present in the mixed-type array and
+two buffers of its own:
+
+* **Types buffer:** holds data type id for each slot of the array. Data type id is
+  frequently the index of the child array; however, the relationship between data type
+  ID and the child index is a parameter of the data type.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+buffer. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when one has data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+of its own, but has two child arrays:

Review Comment:
   ```suggestion
   same value. These sequences are called runs. A run-end encoded array has no buffers
   of its own, but has two child arrays:
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,507 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+This kind of data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows to represent an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a maximum size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested Layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data type of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed Size List
+---------------
+
+Fixed-size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List View
+---------
+
+In contrast to the list type, list view type also has a size buffer together
+with an offset buffer. The offsets continue to indicate the start of each
+element but size is now saved in a separate size buffer. This allows to have
+out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested data type parameterized by an ordered sequence of fields
+(a data types and a name).
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+The Map data type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map data types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same data type, but not necessarily strings) and a second
+child array holding all the values. The values need to be of the same data type; however,
+the data type doesn't have to match that of the keys.
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested data type where each slot in the union has a value with a data type
+chosen from a subset of possible Arrow data types. That means that a union array represents
+a mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union data types, "dense" and "sparse".
+
+Dense Union
+^^^^^^^^^^^
+
+A Dense Union has one child array for each data type present in the mixed-type array and
+two buffers of its own:
+
+* **Types buffer:** holds data type id for each slot of the array. Data type id is
+  frequently the index of the child array; however, the relationship between data type
+  ID and the child index is a parameter of the data type.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+buffer. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when one has data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+of its own, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends. The run ends
+   array always begins with 0 and contains one more element than the length of
+   its parent array.

Review Comment:
   This is incorrect. Unlike `offsets`, run-end store the end of the run. And the number of run-ends is the same as length. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1632739596


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:

Review Comment:
   My attempt to add the info (good call!) https://github.com/apache/arrow/pull/41593/commits/bf24ecf57ba5d40cb264c2774d8ad1a5896ad6df



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1632668766


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or

Review Comment:
   Will use "The list type enables representing an array where each element is a sequence of elements of the same type".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1632751027


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.

Review Comment:
   Would this make sense:
   
   "A contiguous region of memory with a given length in bytes. Buffers are used to store data for arrays. Sometimes we use the notion of number of elements in a buffer which can only be used if we know which data type is the array that wraps this specific buffer."



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637334245


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of

Review Comment:
   ```suggestion
   Each column is called an **Array** in Arrow terminology. Arrays can be of
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602333610


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+

Review Comment:
   ```suggestion
   
   .. _UmbraDB: https://umbra-db.com/
   .. _DuckDB: https://duckdb.com
   .. _Velox: https://velox-lib.io/
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2113624589

   Hey @AlenkaF, this is so great to see. I think the text and diagrams will be useful. I left some suggestions for style and:
   
   - Did an editing pass over the text. Feel free to ignore any you don't like.
   - I'm a bit late in the process here but I noticed in the diagrams that we use `-` for null. It kinda looks like a minus symbol sometimes instead of indicating a missing element. I wonder if a `_` or `?` might be more clear? I realize part of the issue here is due to limitations of Excalidraw.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1603084935


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,519 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------

Review Comment:
   Hm, that is true. I would simply move it before "Primitive layouts" header - it should fit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602361348


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+RecordBatch
+-----------
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+Schema
+------
+A collection of fields with optional metadata that determines all the data types of an object
+like a record batch or table.
+
+Table
+-----
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of chunked
+arrays. All chunked arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+The Arrow C Data Interface
+==========================
+
+Arrow memory layout is meant to be a universal standard for tabular data, not tied to a specific
+implementation.
+
+While there are specifications to share Arrow data between processes or over the network (e.g. the
+IPC messages), the Arrow C Data Interface is meant to actually zero-copy share the data between
+different libraries within the same process (i.e. actually share the same buffers in memory).
+
+The Arrow C Data Interface defines a set of small C structures
+
+.. code-block::
+
+   struct ArrowSchema {
+   const char* format;
+   const char* name;
+   const char* metadata;
+   int64_t flags;
+   int64_t n_children;
+   struct ArrowSchema** children;
+   struct ArrowSchema* dictionary;
+
+   // Release callback
+   void (*release)(struct ArrowSchema*);
+   // Opaque producer-specific data
+   void* private_data;
+   };
+
+   struct ArrowArray {
+   int64_t length;
+   int64_t null_count;
+   int64_t offset;
+   int64_t n_buffers;
+   int64_t n_children;
+   const void** buffers;
+   struct ArrowArray** children;
+   struct ArrowArray* dictionary;
+
+   // Release callback
+   void (*release)(struct ArrowArray*);
+   // Opaque producer-specific data
+   void* private_data;
+   };
+
+The C Data Interface passes Arrow data buffers through memory pointers. So, by construction, it allows
+you to share data from one runtime to another without copying it. Since the data is in standard Arrow
+in-memory format, its layout is well-defined and unambiguous.
+
+.. seealso::
+   The :ref:`c-data-interface` documentation.
+
+NanoArrow

Review Comment:
   ```suggestion
   nanoarrow
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602360886


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+RecordBatch
+-----------
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+Schema
+------
+A collection of fields with optional metadata that determines all the data types of an object
+like a record batch or table.
+
+Table
+-----
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of chunked
+arrays. All chunked arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+The Arrow C Data Interface
+==========================
+
+Arrow memory layout is meant to be a universal standard for tabular data, not tied to a specific
+implementation.
+
+While there are specifications to share Arrow data between processes or over the network (e.g. the
+IPC messages), the Arrow C Data Interface is meant to actually zero-copy share the data between
+different libraries within the same process (i.e. actually share the same buffers in memory).
+
+The Arrow C Data Interface defines a set of small C structures
+
+.. code-block::
+
+   struct ArrowSchema {

Review Comment:
   I think we should fix the indentation in these blocks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602360474


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology
+=============================
+
+Buffer
+------
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+Array
+-----
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+Chunked Array
+-------------
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+RecordBatch
+-----------
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+Schema
+------
+A collection of fields with optional metadata that determines all the data types of an object
+like a record batch or table.
+
+Table
+-----
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of chunked
+arrays. All chunked arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+The Arrow C Data Interface
+==========================
+
+Arrow memory layout is meant to be a universal standard for tabular data, not tied to a specific
+implementation.
+
+While there are specifications to share Arrow data between processes or over the network (e.g. the
+IPC messages), the Arrow C Data Interface is meant to actually zero-copy share the data between
+different libraries within the same process (i.e. actually share the same buffers in memory).
+
+The Arrow C Data Interface defines a set of small C structures

Review Comment:
   ```suggestion
   The Arrow C Data Interface defines a set of small C structures:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602355813


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types

Review Comment:
   In https://github.com/apache/arrow/issues/14752 we were trying to get away from using the term "logical type" where it's not technically correct. Columnar.rst still needs to be updated but I think avoiding propagating the term here would be good.
   ```suggestion
   Extension types can be defined by annotating any of the built-in Arrow data types
   ```
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2358268386

   Sorry for taking a bit of time to get back to this PR. It is in a good shape now and would try to get it into the next, 18.0.0, release. Pinging all for last round of review ;)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1603138246


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,519 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts

Review Comment:
   We could move "Overview of Arrow Terminology" right after "Arrow Columnar Format" intro, remove the headings and add content about the physical layout.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602333610


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+

Review Comment:
   ```suggestion
   
   .. _DuckDB: https://duckdb.com
   .. _Velox: https://velox-lib.io/
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1607735422


##########
docs/source/format/images/struct-diagram.svg:
##########


Review Comment:
    For the case of a struct type, there is some info in the struct content:
   
   > The field (key) is saved in the schema and the values of a specific field (key) are saved in the child array.
   
   Maybe it would be good to add more content in the "Overview of Arrow Terminology" section where `Schema` is mentioned.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2121912565

   @raulcd thanks for checking the sidebar! It should be corrected with https://github.com/apache/arrow/pull/41593/commits/2a990b42f85df862af6d6246e18cfc03ea3f4cbb


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1611132611


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string

Review Comment:
   ```suggestion
   This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.

Review Comment:
   I am not entirely sure it will be helpful to split this up, but, for the purpose of understanding the following sections explaining the different layouts, all a user needs to understand for now are those three items (and maybe "type"). While "Chunked Array", "RecordBatch", "Schema" and "Table" might just be a distraction for now (and in addition, ChunkedArray and Table are also implementation specific terms). Certainly the distinction between RecordBatch and Table (the diagram) I would not put here up front in the intro.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually

Review Comment:
   ```suggestion
            list data type presented in a Table and the data actually
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifiers (UUID) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow data types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`

Review Comment:
   This list can be updated now with json and uuid (although it maybe also raises the question if we just want to refer to other doc page, to avoid having to keep both in sync)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifiers (UUID) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow data types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* `GeoArrow`_: A collection of Arrow extension types for representing vector geometries
+
+.. _GeoArrow: https://github.com/geoarrow/geoarrow
+
+The Arrow C Data Interface
+==========================
+
+Arrow memory layout is meant to be a universal standard for tabular data, not tied to a specific
+implementation.
+
+While there are specifications to share Arrow data between processes or over the network (e.g. the
+IPC messages), the Arrow C Data Interface is meant to actually zero-copy share the data between
+different libraries within the same process (i.e. actually share the same buffers in memory).
+
+The Arrow C Data Interface defines a set of small C structures:
+
+.. code-block::
+
+   struct ArrowSchema {
+    const char* format;
+    const char* name;
+    const char* metadata;
+    int64_t flags;
+    int64_t n_children;
+    struct ArrowSchema** children;
+    struct ArrowSchema* dictionary;
+
+    // Release callback
+    void (*release)(struct ArrowSchema*);
+    // Opaque producer-specific data
+    void* private_data;
+   };
+
+   struct ArrowArray {
+    int64_t length;
+    int64_t null_count;
+    int64_t offset;
+    int64_t n_buffers;
+    int64_t n_children;
+    const void** buffers;
+    struct ArrowArray** children;
+    struct ArrowArray* dictionary;
+
+    // Release callback
+    void (*release)(struct ArrowArray*);
+    // Opaque producer-specific data
+    void* private_data;
+   };
+
+The C Data Interface passes Arrow data buffers through memory pointers. So, by construction, it allows
+you to share data from one runtime to another without copying it. Since the data is in standard Arrow
+in-memory format, its layout is well-defined and unambiguous.
+
+.. seealso::
+   The :ref:`c-data-interface` documentation.
+
+nanoarrow

Review Comment:
   Similarly, I think mentioning nanoarrow was great for our live tutorial, but for this generic intro on the official docs of the full Arrow project, it seems a bit strange to call out one specific implementation?



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string types is the views buffer.

Review Comment:
   ```suggestion
   The main differences to classical binary and string layout is the views buffer.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written

Review Comment:
   ```suggestion
   inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
   potentially several data buffers. It also supports binary and strings to be written
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.

Review Comment:
   Easier said that done, but I would maybe also try to formulate this more as an explanatory introduction, instead of listing a few terms (what is the context for those terms?)



##########
docs/source/format/images/sparse-union-diagram.svg:
##########


Review Comment:
   The validity bitmap of the child array 1 is wrong here, I think (it is the sane as for child array 0)



##########
docs/source/format/images/dense-union-diagram.svg:
##########


Review Comment:
   I think for better understanding the difference between dense and sparse union, it might be valuable to use the same "logical" column with the same values, so you can actually 1:1 compare the physical layout for both of the same array.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifiers (UUID) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow data types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* `GeoArrow`_: A collection of Arrow extension types for representing vector geometries
+
+.. _GeoArrow: https://github.com/geoarrow/geoarrow
+
+The Arrow C Data Interface
+==========================
+
+Arrow memory layout is meant to be a universal standard for tabular data, not tied to a specific
+implementation.
+
+While there are specifications to share Arrow data between processes or over the network (e.g. the
+IPC messages), the Arrow C Data Interface is meant to actually zero-copy share the data between
+different libraries within the same process (i.e. actually share the same buffers in memory).
+
+The Arrow C Data Interface defines a set of small C structures:
+
+.. code-block::
+
+   struct ArrowSchema {
+    const char* format;

Review Comment:
   For the tutorial during the conference, I included the struct to explain things. But for the intro here I am not sure we should include it without much more explanation of the details of those structs.
   
   For the purpose of this intro page, I would maybe also not call out the C Data Interface specifically, but we could maybe list and briefly explain the additional specifications on top of the columnar format, which could be (for this intro) the C Data Interface to share data zero-copy within the same process and IPC as serialization format for between processes



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,510 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually

Review Comment:
   Same in other places



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1775922093


##########
docs/source/format/images/ree-diagram.svg:
##########


Review Comment:
   run ends should be `[3, 4, 5]` since run-lengths are 3, 1, and 1.



##########
docs/source/format/images/bool-diagram.svg:
##########


Review Comment:
   Is the values bitmap buffer correct here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1628894289


##########
docs/source/format/Intro.rst:
##########
@@ -242,7 +206,7 @@ are int64.
 
 .. figure:: ./images/var-list-diagram.svg
    :alt: Diagram is showing the difference between the variable size
-         list data type presented in a Table and the dataactually
+         list data type presented in a Table and the data actually

Review Comment:
   This change needs to be done for other alt texts as well



##########
docs/source/format/images/sparse-union-diagram.svg:
##########


Review Comment:
   I think in the new version, you indicated a null in the types buffer (with an underscore), but at that level (parent array), there is no validity bitmap, so there cannot be any null. A null in the logical array is AFAIK always a null of a specific type, i.e. a null in one of child arrays. So the types buffer still needs to point to one of the childs



##########
docs/source/format/Intro.rst:
##########
@@ -57,58 +57,22 @@ are adjacent in the computer memory:
 
 In a columnar format, on the other hand, the data is organised by column
 instead of by row making analytical operations like filtering, grouping,
-aggregations and others much more efficient. CPU can maintain memory locality
+aggregations and others more efficient because the CPU can maintain memory locality
 and require less memory jumps to process the data. By keeping the data contiguous
 in memory it also enables vectorization of the computations. Most modern
 CPUs have single instructions, multiple data (SIMD) enabling parallel
-processing and execution of instructions on vector data in single CPU
-instructions.
+processing and execution of operations on vector data using a single CPU
+instruction.
 
 .. figure:: ./images/columnar-diagram_3.svg
    :alt: Tabular data being structured column by column in computer memory.
 
-Overview of Arrow Terminology
-=============================
-
-**Physical layout**
-A specification for how to arrange values of an array in memory.
-
-**Buffer**
-A contiguous region of memory with a given length. Buffers are used to store data for arrays.
-
-**Array**
-A contiguous, one-dimensional sequence of values with known length where all values have the
-same type. An array consists of zero or more buffers.
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies among
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.

Review Comment:
   ```suggestion
   The column is called an **array** in Arrow terminology. Arrays can be of
   different types and the way their values are stored in memory varies among
   types. The specification of how these values are arranged in memory is what we
   call a **physical memory layout**. One contiguous region of memory that stores
   data for arrays is called a **buffer**.
   ```
   
   I would use bold instead of monospace to highlight those new terms, because code might incorrectly suggest this is an actual class or something (while in a specific implementation it is, but not in context of the spec)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column

Review Comment:
   ```suggestion
   Data in a table can be represented in memory using a row based format or a column
   ```
   
   (depending on how you describe it above)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies among
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1
+means that the value is not-null ("valid"), whereas a value of 0 indicates that the value
+is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are, for example, signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.

Review Comment:
   ```suggestion
   The main differences to the classical binary and string layout is the views buffer.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies among
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+

Review Comment:
   At some point, we should also refer to the actual columnar specification. So maybe we could say something here that the next sections give an introduction to Arrow Columnar Format explaining the different phyisical layouts, but that the full specification can be found at \<ref>



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or

Review Comment:
   Or maybe something like "The list type enables representing an array where each element is a collection of elements of the same type" ? (otherwise you could interpret the "collections" as the actual array, which is a bit confusing I think)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies among
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1
+means that the value is not-null ("valid"), whereas a value of 0 indicates that the value
+is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are, for example, signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values

Review Comment:
   ```suggestion
   sequence of values in each column slot. The layout is similar to variable-size binary or
   string layout as it has offsets buffer to define where the sequence of values
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.

Review Comment:
   I know the title of this page and section says "Columnar Format", I think it would be good to explicitly call out that Arrow is a specification using this columnar layout.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies among
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1
+means that the value is not-null ("valid"), whereas a value of 0 indicates that the value
+is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are, for example, signed and unsigned

Review Comment:
   ```suggestion
   has the same physical size measured in bytes. Data types that use the
   fixed size primitive layout are, for example, signed and unsigned
   ```
   
   (share the "same" might be incorrectly interpreted as _exactly_ the same, while the bitwidth can still vary?)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+

Review Comment:
   I would try to add some introductory sentence here before showing the image (because now the first text here after the image also starts with "Data can be be represented .. ", but which / what kind of data"?)
   
   Something like "Apache Arrow focuses on tabular data. Consider the following table:" (although still is maybe not enough content to warrant a line .. ;))



##########
docs/source/format/images/dense-union-diagram.svg:
##########


Review Comment:
   I think the validity buffer for child 0 is wrong? The child array has only 3 elements, but the two `1`s in the bitmap are too far apart (more than 3)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies among
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1
+means that the value is not-null ("valid"), whereas a value of 0 indicates that the value
+is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are, for example, signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively

Review Comment:
   ```suggestion
   The bytes of all elements in a binary or string column are stored together consecutively
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -57,58 +57,22 @@ are adjacent in the computer memory:
 
 In a columnar format, on the other hand, the data is organised by column
 instead of by row making analytical operations like filtering, grouping,
-aggregations and others much more efficient. CPU can maintain memory locality
+aggregations and others more efficient because the CPU can maintain memory locality
 and require less memory jumps to process the data. By keeping the data contiguous
 in memory it also enables vectorization of the computations. Most modern
 CPUs have single instructions, multiple data (SIMD) enabling parallel
-processing and execution of instructions on vector data in single CPU
-instructions.
+processing and execution of operations on vector data using a single CPU
+instruction.
 
 .. figure:: ./images/columnar-diagram_3.svg
    :alt: Tabular data being structured column by column in computer memory.
 
-Overview of Arrow Terminology
-=============================
-
-**Physical layout**
-A specification for how to arrange values of an array in memory.
-
-**Buffer**
-A contiguous region of memory with a given length. Buffers are used to store data for arrays.
-
-**Array**
-A contiguous, one-dimensional sequence of values with known length where all values have the
-same type. An array consists of zero or more buffers.
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies among
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.

Review Comment:
   Can maybe also use "data type" (instead of just "type") to follow the rename from logical type to data type



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies among
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1
+means that the value is not-null ("valid"), whereas a value of 0 indicates that the value
+is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are, for example, signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.

Review Comment:
   ```suggestion
   potentially several data buffers. Because it uses an offset and length to refer to the data buffer, the bytes of all elements do not need to be stored together consecutively in one buffer, and thus it supports the bytes to be written
   out of order.
   ```
   
   Trying to clarify the big difference of not having one contiguous + consecutive data buffer.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or

Review Comment:
   Could also use "sequence" instead of "collection" as is used in the Fixed-size list section below (or update it there to use "collection")



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1633192028


##########
docs/source/format/images/dense-union-diagram.svg:
##########


Review Comment:
   Done: https://github.com/apache/arrow/pull/41593/commits/2524fda0cba6e330ac4ea7d31b360712b254c37d



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2160000321

   Fresh link to the html version: http://crossbow.voltrondata.com/pr_docs/41593/format/Intro.html


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637343924


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list

Review Comment:
   ```suggestion
   Fixed Size List
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637333370


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel

Review Comment:
   ```suggestion
   CPUs have
   [SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
   (a single instruction that operates on multiple values at once) enabling parallel
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1776671945


##########
docs/source/format/images/bool-diagram.svg:
##########


Review Comment:
   Ha, checking the example with nanoarrow or numpy shows I was wrong:
   
   ```python
   >>> column_bool = pa.array([True, True, False, None, False, True], type=pa.bool_())
   >>> column_bool
   <pyarrow.lib.BooleanArray object at 0x7c13f973f580>
   [
     true,
     true,
     false,
     null,
     false,
     true
   ]
   
   >>> na.array(column_bool).inspect()
   <ArrowArray bool>
   - length: 6
   - offset: 0
   - null_count: 1
   - buffers[2]:
     - validity <bool[1 b] 11101100>
     - data <bool[1 b] 11000100>
   - dictionary: NULL
   - children[0]:
   
   >>> np.unpackbits(np.frombuffer(column_bool.buffers()[1], dtype="uint8"), bitorder="little")
   array([1, 1, 0, 0, 0, 1, 0, 0], dtype=uint8)
   ```
   
   Will correct values bitmap buffer to `1 1 0 0 0 1 0 0`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2377521766

   Thank you all for reviewing this PR, not a small chunk of content!
   Will keep it open for comments till Monday and then merge if there is nothing new.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2108165559

   Revision: 4d2bf8ad6103d094ebdfc8ac3546a2692c08ff23
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-cc7da250f4](https://github.com/ursacomputing/crossbow/branches/all?query=actions-cc7da250f4)
   
   |Task|Status|
   |----|------|
   |preview-docs|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-cc7da250f4-github-preview-docs)](https://github.com/ursacomputing/crossbow/actions/runs/9066545689/job/24909677142)|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1601587996


##########
docs/source/format/index.rst:
##########
@@ -22,17 +22,38 @@ Specifications
 
 .. toctree::
    :maxdepth: 2
+   :caption: Arrow Columnar Format
+   :hidden:
 
-   Versioning
+   FormatIntro
    Columnar

Review Comment:
   After talking to @jorisvandenbossche we decided to open an issue for moving the IPC spec content out of the Arrow Columnar format page: https://github.com/apache/arrow/issues/41671



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2112417432

   Update: I have removed the change in _docs/source/format/index.rst_ (captions for the Specifications section) and will move it to a separate PR, see https://github.com/apache/arrow/pull/41593/commits/97e4217ab68040167d31516a752fba6acd226177.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2102633875

   cc @amoeba this could use a look already. I think all I wanted to add is here. Will need to do a general look through one more time before marking it ready for review though.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1603141100


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,519 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.

Review Comment:
   I agree. It would be better to remove this part.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1633091515


##########
docs/source/format/images/all-diagrams.svg:
##########


Review Comment:
   You probably mean the right-to-left ordering?
   
   We decided to keep it as it is written in the validity buffer (using bit-endianness). I agree it is a bit hard to connect validity bitmaps with the values buffers this way but I think we should keep it as it is defined in the format meaning reading validity bitmaps from right-to-left.
   
   Would it help if there was a clearer note about the ordering?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2159737139

   Revision: 9f9bbff0c00026fe8544292bc28e358b7c2ffa47
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-cee8fb4563](https://github.com/ursacomputing/crossbow/branches/all?query=actions-cee8fb4563)
   
   |Task|Status|
   |----|------|
   |preview-docs|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-cee8fb4563-github-preview-docs)](https://github.com/ursacomputing/crossbow/actions/runs/9459365226/job/26056337908)|


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1626030051


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between

Review Comment:
   ```suggestion
   different types and the way their values are stored in memory varies among
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality

Review Comment:
   ```suggestion
   aggregations and others more efficient because the CPU can maintain memory locality
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.

Review Comment:
   ```suggestion
   null or not: a value of 1
   means that the value is not-null ("valid"), whereas a value of 0 indicates that the value
   is null.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.

Review Comment:
   I am not sure what "invalid result" means here...perhaps "assumed to contain utf-8 encoded strings"?



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.

Review Comment:
   ```suggestion
      this case no buffers are allocated.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned

Review Comment:
   ```suggestion
   same fixed size primitive layout are, for example, signed and unsigned
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of

Review Comment:
   ```suggestion
   inline (for small strings) or only the first 4 bytes of the string and an offset into one of
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or

Review Comment:
   ```suggestion
   The list type enables collections containing elements of the same type
   to be efficiently represented in the Arrow columnar format. The layout is similar to binary or
   ```
   
   (Maybe? I was slightly confused by the first sentence here but I am also not sure that my suggestion is better 🙂 )



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of

Review Comment:
   ```suggestion
   The Map type represents nested data where each value is a variable number of
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.

Review Comment:
   ```suggestion
   string type as it has an offsets buffer to define where the sequence of values
   for each element starts and ends, with all the values being stored consecutively
   in a values child array.
   ```
   
   (Also not sure my edit makes this better...it is hard to explain this! 🙂 )



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).

Review Comment:
   ```suggestion
   The map, on the other hand, has one child array holding all the different keys (that
   thus all need to be of the same type, but not necessarily strings) and a second
   child array holding all the values. The values need to be of the same type; however,
   the type doesn't have to match that of the keys.
   ```
   
   (Maybe?)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.

Review Comment:
   ```suggestion
   processing and execution of operations on vector data using a single CPU
   instruction.
   ```
   
   (Maybe...I'm not an expert!)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.

Review Comment:
   ```suggestion
   * **Types buffer:** holds type id for each slot of the array. Type id is frequently
     the index of the child array; however, the relationship between type ID and 
     the child index is a parameter of the data type.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in

Review Comment:
   ```suggestion
   This validity bitmap is optional: if there are no missing values in
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.

Review Comment:
   ```suggestion
   buffer. In this case, the child arrays are each equal in length to the length of the union.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.

Review Comment:
   ```suggestion
   Dictionary encoding can be effective when one has data with many repeated values.
   ```
   
   (It seems that most of this text avoids the second person "you", but the use of "you" is fine as long as it is consistent)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.

Review Comment:
   ```suggestion
   A specification for how to represent values of an array in memory.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.

Review Comment:
   Is it worth disambiguating the length in elements vs. length in bytes? In this document sometimes you refer to the number of elements in a buffer (e.g., the offset buffer must have a length of...).



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.

Review Comment:
   ```suggestion
   The number of elements of the offset buffer is one more than the length of the
   array as the last two elements define the start and the end of the last
   element in the binary/string column.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.

Review Comment:
   I believe at least one implementation (JS and maybe Java) has something called a `Table` that is more like a list of record batches that might be worth mentioning.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.

Review Comment:
   ```suggestion
   An ordered collection of fields that communicates all the data types of an object
   like a RecordBatch or Table. Schemas can contain optional key/value metadata.
   ```
   
   (Is it also worth defining a `Field`?)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays

Review Comment:
   ```suggestion
   A contiguous, two-dimensional data structure which consists of an ordered collection of arrays
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:

Review Comment:
   ```suggestion
   same value. These sequences are called runs. A Run-end encoded array has no buffers
   of its own but has two child arrays:
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and

Review Comment:
   ```suggestion
   A Dense Union has one child array for each type present in the mixed-type array and
   two buffers of its own:
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.

Review Comment:
   ```suggestion
   Arrow defines two distinct union types, "dense" and "sparse".
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+Examples of an extension type are :ref:`uuid_extension` or
+:ref:`fixed_shape_tensor_extension` extension type.
+
+Extension types can be defined by annotating any of the built-in Arrow data types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific
+domain areas.
+
+Example:
+
+* `GeoArrow`_: A collection of Arrow extension types for representing vector geometries
+
+.. _GeoArrow: https://github.com/geoarrow/geoarrow
+
+Sharing Arrow data
+==================
+
+Arrow memory layout is meant to be a universal standard for representing tabular data in memory,
+not tied to a specific implementation. Next step is the specification for sharing the data
+in Arrow format that is well-defined and unambiguous between applications.

Review Comment:
   ```suggestion
   not tied to a specific implementation. The Arrow standard defines two protocols for
   well-defined and unambiguous communication of Arrow data between applications:
   ```
   
   (Maybe?)



##########
docs/source/format/images/all-diagrams.svg:
##########


Review Comment:
   I am not sure all the validity buffers in this diagram and the ones that follow are correct?



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.

Review Comment:
   ```suggestion
   *  **Run ends array:** holds the index in the array where each run ends. The run ends
       array always begins with 0 and contains one more element than the length of
       its parent array.
   ```
   
   (I think?)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:

Review Comment:
   It may be helpful to describe here how null values are encoded (from reading this I would assume that there is no validity buffer and that nulls are strictly represented in the values array).



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.

Review Comment:
   ```suggestion
   custom semantics, this is enabled by defining extension types.
   ```
   
   (Unless there's a difference that I'm not aware of?)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.
+
+**Array**
+A contiguous, one-dimensional sequence of values with known length where all values have the
+same type. An array consists of zero or more buffers.
+
+**Chunked Array**
+A discontiguous, one-dimensional sequence of values with known length where all values have
+the same type. Consists of zero or more arrays, the “chunks”.
+
+.. note::
+   Chunked Array is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+**RecordBatch**
+A contiguous, two-dimensional data structure which consist of ordered collection of arrays
+of the same length.
+
+**Schema**
+A collection of fields with optional metadata that determines all the data types of an object
+like a RecordBatch or Table.
+
+**Table**
+A discontiguous, two-dimensional chunk of data consisting of an ordered collection of Chunked
+Arrays. All Chunked Arrays have the same length, but may have different types. Different columns
+may be chunked differently.
+
+.. note::
+   Table is a concept specific to certain implementations such as Arrow C++ and PyArrow.
+
+.. image:: ../cpp/tables-versus-record-batches.svg
+   :alt: A graphical representation of an Arrow Table and a
+         Record Batch, with structure as described in text above.
+
+.. seealso::
+   The :ref:`glossary` for more terms.
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+Examples of an extension type are :ref:`uuid_extension` or
+:ref:`fixed_shape_tensor_extension` extension type.
+
+Extension types can be defined by annotating any of the built-in Arrow data types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific
+domain areas.
+
+Example:
+
+* `GeoArrow`_: A collection of Arrow extension types for representing vector geometries
+
+.. _GeoArrow: https://github.com/geoarrow/geoarrow

Review Comment:
   ```suggestion
   .. _GeoArrow: https://geoarrow.org
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637344071


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested data types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested data type structure.
+
+Nested data types depend on one or more other child data types. For instance, List
+is a nested data type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list data type enables representing an array where each element is a sequence
+of elements of the same data type. The layout is similar to variable-size binary
+or string layout as it has an offsets buffer to define where the sequence of values
+for each element starts and ends, with all the values being stored consecutively
+in a values child array.
+
+The offsets in the list data type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the data actually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view

Review Comment:
   ```suggestion
   List View
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637342088


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts

Review Comment:
   ```suggestion
   Primitive Layouts
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string

Review Comment:
   ```suggestion
   Variable Length Binary and String
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637336097


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows

Review Comment:
   ```suggestion
   This kind of data can be represented in memory using a row-based format or a
   column-based format. The row-based format stores data row-by-row, meaning the rows
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.

Review Comment:
   ```suggestion
      :alt: Tabular data being structured row-by-row in computer memory.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2121912687

   @github-actions crossbow submit preview-docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1606749264


##########
docs/source/format/images/var-string-view-diagram.svg:
##########


Review Comment:
   Shouldn't the offset for `Another long string` be 21 instead of 31?



##########
docs/source/format/images/struct-diagram.svg:
##########


Review Comment:
   maybe not on this PR but should we expand the explanation to explain where the info like `name` and `id` (schema) is stored?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1595433221


##########
docs/source/format/index.rst:
##########
@@ -22,17 +22,38 @@ Specifications
 
 .. toctree::
    :maxdepth: 2
+   :caption: Arrow Columnar Format
+   :hidden:
 
-   Versioning
+   FormatIntro
    Columnar
+   Versioning
+   Changing
    CanonicalExtensions
    Other
+
+.. toctree::
+   :maxdepth: 2
+   :caption: C definitions
+   :hidden:
+
    CDataInterface
    CStreamInterface
    CDeviceDataInterface

Review Comment:
   @jorisvandenbossche have kept C Stream Interface in a separate file as the structure is nicer IMHO.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2108161337

   @github-actions crossbow submit preview-docs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-39569: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #41593:
URL: https://github.com/apache/arrow/pull/41593#issuecomment-2108436363

   Not sure why the captions in the left sidebar menu are not visible in the **crossbow preview build**:
   
   <img width="1111" alt="Screenshot 2024-05-13 at 19 47 01" src="https://github.com/apache/arrow/assets/16418547/ce320ada-6f71-4dbc-a056-e58b855f4d36">
   
   ---
   
   but are visible for me **locally**:
   
   <img width="1097" alt="Screenshot 2024-05-13 at 19 46 44" src="https://github.com/apache/arrow/assets/16418547/d393181e-3d05-4018-97a0-b3e3b9d2b99b">
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1633192439


##########
docs/source/format/images/sparse-union-diagram.svg:
##########


Review Comment:
   Done: https://github.com/apache/arrow/pull/41593/commits/2524fda0cba6e330ac4ea7d31b360712b254c37d



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637342497


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view

Review Comment:
   ```suggestion
   Variable-Length Binary and String View
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string

Review Comment:
   ```suggestion
   Variable-Length Binary and String
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1637343753


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,485 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+As the format gets more adoption, it becomes easier for data processing
+systems to exchange tabular data. Among other things, an agreed upon
+in-memory format, enables the implementations of zero-copy IPC protocols
+(inter-process communication without copying data in memory) and
+more efficient reading and writing of file formats like CSV, `Apache ORC`_,
+and `Apache Parquet`_.
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data so let's consider we have data
+which are tabular so they can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+This kind of data can be represented in memory using a row based format or a
+column based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organized by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others more efficient because the CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `bit-endianness <https://en.wikipedia.org/wiki/Bit_numbering>`_ being
+   used.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends the physical layout also includes integer offsets.
+The number of elements of the offset buffer is one more than the length of the
+array as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string data types share the same physical layout. The one difference
+between them is that the string data type is utf-8 binary and assumes to contain
+utf-8 encoded strings.
+
+The difference between binary/string and large binary/string is in the offset
+data type. In the first case that is int32 and in the second it is int64.
+
+The limitation of data types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted
+from TU Munich's `UmbraDB`_ and is similar to the string layout used in `DuckDB`_ and
+`Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to the classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and an offset into
+one of potentially several data buffers. Because it uses an offset and length to refer
+to the data buffer, the bytes of all elements do not need to be stored together
+consecutively in one buffer, and thus it supports the bytes to be written out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts

Review Comment:
   ```suggestion
   Nested Layouts
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602327554


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation

Review Comment:
   ```suggestion
   Each system or language requires their own format definitions, implementation
   ```



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our

Review Comment:
   ```suggestion
   often have to move data from one system or language to accommodate our
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602327104


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.

Review Comment:
   ```suggestion
   avoid reinventing the wheel in each of those systems and languages.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1602357914


##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries

Review Comment:
   ```suggestion
   * `GeoArrow`_: A collection of Arrow extension types for representing vector geometries
   ```



##########
docs/source/format/FormatIntro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel on each of those systems and languages.
+
+Each system / language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system/language to accommodate our
+workflows that meant copy&convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving systems problems
+related to in-memory analytical data processing. This includes such
+topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, Apache ORC, and Apache Parquet)
+* In-memory analytics and query processing
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+Compression is another element where columnar format representation can
+take high advantage. Data similarity allows for better compression
+techniques and algorithms. Having the same data types locality allows
+to have better compression ratios.
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+Support for null values
+-----------------------
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is adapted from TU Munich's UmbraDB and is similar to the string
+layout used in DuckDB and Velox (and sometimes also called "German style strings").
+
+The main differences to classical binary and string types is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between a struct and a map type is that a struct holds the key
+in the schema, therefore need to be a string, and the values in the child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Extension Types
+===============
+
+In case the system or application needs to extend standard Arrow data types with
+custom semantics this is enabled by defining extension types or user-defined types.
+
+For example:
+
+* Universally unique identifier (uuid) can be represented as a FixedSizeBinary type
+* Trading time can be represented as a Timestamp with metadata indicating the market
+  trading calendar
+
+Extension types can be defined by annotating any of the built-in Arrow logical types
+(the “storage type”) with a custom type name and optional serialized representation
+(``'ARROW:extension:name'`` and ``'ARROW:extension:metadata'`` keys in the Field
+metadata structure).
+
+.. seealso::
+   The :ref:`format_metadata_extension_types` documentation.
+
+Canonical Extension Types
+-------------------------
+
+It is beneficial to share the definitions of well-known extension types so as to
+improve interoperability between different systems integrating Arrow columnar data.
+For this reason canonical extension types are defined in Arrow itself.
+
+Examples:
+
+* Fixed and variable shape tensor
+
+  - :ref:`fixed_shape_tensor_extension`
+  - :ref:`variable_shape_tensor_extension`
+
+.. seealso::
+   The :ref:`format_canonical_extensions` documentation.
+
+Community Extension Types
+-------------------------
+These are Arrow extension types that have been established as standards within specific domain areas.
+
+Example:
+
+* GeoArrow - collection of Arrow extension types for representing vector geometries
+  https://github.com/geoarrow/geoarrow
+
+Overview of Arrow terminology

Review Comment:
   ```suggestion
   Overview of Arrow Terminology
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1631367000


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format

Review Comment:
   Maybe this should be called just "Introduction"
   ![image](https://github.com/apache/arrow/assets/207795/cd24034e-bde6-4994-8b8a-7d318cd24da3)



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+

Review Comment:
   I put "tabular" in my suggestions above.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing

Review Comment:
   ```md
   The Apache Arrow specification can be implemented in any programming
   language but official implementations for many languages are available.
   An implementation consists of format definitions using the constructs
   offered by the language and common in-memory data processing algorithms
   (e.g. slicing and concatenating tables). Users can extend and use the
   utilities provided by the Apache Arrow implementation in their programming
   language of choice. Some implementations are further ahead and feature a
   vast set of algorithms for in-memory analytical data processing. These
   algorithms can be used directly, via dataframe APIs, or even through
   relational query languages like SQL.
   
   As the format gets more adoption, it becomes easier for data processing
   systems to exchange tabular data. Among other things, an agreed upon
   in-memory format, enables the implementations of zero-copy IPC protocols
   (inter-process communication without copying data in memory) and
   more efficient reading and writing of file formats like CSV, `Apache ORC`_,
   and `Apache Parquet`_.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column

Review Comment:
   This reads like "data in an arrow table". Perhaps a sub-section discussing row-by-row and column-by-column should be added before the "Arrow Columnar Format" section can focus solely on the columnar arrow format.



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,458 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.

Review Comment:
   Suggestions. Feel free to tweak and improve. I tried to break the paragraph in shorter phrases and:
   
   1. be specific about "tabular" (as there are many formats for non-tabular data interchange)
   2. replaced "reinventing the wheel" with "implementation cost"
   
   ```suggestion
   Apache Arrow was born from the need for a set of standards around
   tabular data representation and interchange between systems.
   The adoption of these standards reduce computing costs of data
   serialization/deserialization and implementation costs across
   systems implemented in different programming languages.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1775096908


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,454 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+*****************************************
+Introduction to the Arrow Columnar Format
+*****************************************
+
+Apache Arrow was born with the idea to define a set of standards for
+data representation and interchange between languages and systems to
+avoid costs of data serialization/deserialization and in order to
+avoid reinventing the wheel in each of those systems and languages.
+
+Each system or language requires their own format definitions, implementation
+of common algorithms, etcetera. In our heterogeneous environments we
+often have to move data from one system or language to accommodate our
+workflows that meant copy and convert the data between them, which is
+quite costly.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This includes such topics as:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+Data can be represented in memory using a row based format or a column
+based format. The row based format stores data by row meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+In a columnar format, on the other hand, the data is organised by column
+instead of by row making analytical operations like filtering, grouping,
+aggregations and others much more efficient. CPU can maintain memory locality
+and require less memory jumps to process the data. By keeping the data contiguous
+in memory it also enables vectorization of the computations. Most modern
+CPUs have single instructions, multiple data (SIMD) enabling parallel
+processing and execution of instructions on vector data in single CPU
+instructions.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+The column is called an ``Array`` in Arrow terminology. Arrays can be of
+different types and the way their values are stored in memory varies between
+types. The specification of how these values are arranged in memory is what we
+call a ``physical memory layout``. One contiguous region of memory that stores
+data for arrays is called a ``Buffer``.
+
+
+Support for null values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not. You can think of it as vector of 0 and 1 values, where a 1
+means that the value is not-null ("valid"), while a 0 indicates the value
+is null.
+
+This validity bitmap is optional, i.e. if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+Primitive layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that share the
+same fixed size primitive layout are for example signed and unsigned
+integer types, floating point numbers, boolean, decimal and temporal
+types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   Boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null type where all values are null. In
+   this case no memory buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+The bytes of a binary or string column are stored together consecutively
+in a single buffer or region of memory. To know where each element of the
+column starts and ends the physical layout also includes integer offsets.
+The length of the offset buffer is one more than the length of the values
+buffer as the last two elements define the start and the end of the last
+element in the binary/string column.
+
+Binary and string types share the same physical layout. The one difference
+between them is that the string type is utf-8 binary and will produce an
+invalid result if the bytes are not valid utf-8.
+
+The difference between binary/string and large binary/string is in the offset
+type. In the first case that is int32 and in the second it is int64.
+
+The limitation of types using 32 bit offsets is that they have a max size of
+2GB per array. One can still use the non-large variants for bigger data, but
+then multiple chunks are needed.
+
+.. figure:: ./images/var-string-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string data types.
+
+Variable length binary and string view
+--------------------------------------
+
+This layout is an alternative for the variable length binary layout and is adapted from TU Munich's `UmbraDB`_ and is similar to the string
+layout used in `DuckDB`_ and `Velox`_ (and sometimes also called "German style strings").
+
+.. _UmbraDB: https://umbra-db.com/
+.. _DuckDB: https://duckdb.com
+.. _Velox: https://velox-lib.io/
+The main differences to classical binary and string layout is the views buffer.
+It includes the length of the string, and then either contains the characters
+inline (for small strings) or only the first 4 bytes of the string and point to a location in one of
+potentially several data buffers. It also supports binary and strings to be written
+out of order.
+
+These properties are important for efficient string processing. The prefix
+enables a profitable fast path for string comparisons, which are frequently
+determined within the first four bytes. Selecting elements is a simple "take"
+operation on the fixed-width views buffer and does not need to rewrite the
+values buffers.
+
+.. figure:: ./images/var-string-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable length
+         string view data type presented in a Table and the dataactually
+         stored in computer memory.
+
+   Physical layout diagram for variable length string view data type.
+
+Nested layouts
+==============
+
+Nested types introduce the concept of parent and child arrays. They express
+relationships between physical value arrays in a nested type structure.
+
+Nested types depend on one or more other child data types. For instance, List
+is a nested type (parent) that has one child (the data types of the values in
+the list).
+
+List
+----
+
+The list type enables values of the same type being stacked together in a
+sequence of values in each column slot. The layout is similar to binary or
+string type as it has offsets buffer to define where the sequence of values
+starts and ends with all the values of the column being stored consecutively
+in a values child array.
+
+The offsets in the list type are int32 while in the large list the offsets
+are int64.
+
+.. figure:: ./images/var-list-diagram.svg
+   :alt: Diagram is showing the difference between the variable size
+         list data type presented in a Table and the data actually
+         stored in computer memory.
+
+   Physical layout diagram for variable size list data type.
+
+Fixed size list
+---------------
+
+Fixed size list is a special case of variable-size list where each column slot
+contains a fixed size sequence meaning all lists are the same size and so the
+offset buffer is no longer needed.
+
+.. figure:: ./images/fixed-list-diagram.svg
+   :alt: Diagram is showing the difference between the fixed size list data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for fixed size list data type.
+
+List and large list view
+------------------------
+
+List view type allows arrays to specify out-of-order offsets.
+
+.. figure:: ./images/var-list-view-diagram.svg
+   :alt: Diagram is showing the difference between the variable size list view
+         data type presented in a Table and the dataactually stored in
+         computer memory.
+
+   Physical layout diagram for variable size list view data type.
+
+Struct
+------
+
+A struct is a nested type parameterized by an ordered sequence of types.
+
+* There is one child array for each field
+* Child arrays are independent and need not be adjacent to each other in
+  memory (only need to have the same length)
+
+One can think of an individual struct field as a key-value pair where the
+key is the field name and the child array its values. The field (key) is
+saved in the schema and the values of a specific field (key) are saved in
+the child array.
+
+.. figure:: ./images/struct-diagram.svg
+   :alt: Diagram is showing the difference between the struct data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for struct data type.
+
+Map
+---
+
+Map type represents nested data where each value is a variable number of
+key-value pairs. Its physical representation is the same as a list of ``{key, value}``
+structs.
+
+The difference between the struct and map types is that a struct holds the key
+in the schema, requiring keys to be strings, and the values are stored in in the
+child arrays,
+one for each field. There can be multiple keys and therefore multiple child arrays.
+The map, on the other hand, has one child array holding all the different keys (that
+thus all need to be of the same type but not necessarily strings) and a second
+child array holding all the values, those values need to be of the same type (which
+doesn't have to match the one on the keys).
+
+Also, the map stores the struct in a list and needs an offset as the list is
+variable shape.
+
+.. figure:: ./images/map-diagram.svg
+   :alt: Diagram is showing the difference between the map data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for map data type.
+
+Union
+-----
+
+The union is a nested type where each slot in the union has a value with a type chosen
+from a subset of possible Arrow data types. That means that a union array represents a
+mixed-type array. Unlike other data types, unions do not have their own validity bitmap
+and the nullness is determined by the child arrays.
+
+Arrow defines two distinct union types, “dense” and “sparse”.
+
+Dense Union
+^^^^^^^^^^^
+
+Dense Union has one child array for each type present in the mixed-type array and
+
+* **Types buffer:** holds type id for each slot of the array. Type id corresponds
+  to the number of the child array.
+* **Offsets buffer:** holds relative offset into the respective child array for each
+  array slot.
+
+.. figure:: ./images/dense-union-diagram.svg
+   :alt: Diagram is showing the difference between the dense union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dense union data type.
+
+Sparse union
+^^^^^^^^^^^^
+
+A sparse union has the same structure as a dense union, with the omission of the offsets
+array. In this case, the child arrays are each equal in length to the length of the union.
+
+
+.. figure:: ./images/sparse-union-diagram.svg
+   :alt: Diagram is showing the difference between the sparse union data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for sparse union data type.
+
+Dictionary Encoded Layout
+=========================
+
+Dictionary encoding can be effective when you have data with many repeated values.
+The values are represented by integers referencing a dictionary usually consisting of
+unique values.
+
+.. figure:: ./images/dictionary-diagram.svg
+   :alt: Diagram is showing the difference between the dictionary data type
+         presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for dictionary data type.
+
+Run-End Encoded Layout
+======================
+
+Run-end encoding is well-suited for representing data containing sequences of the
+same value. These sequences are called runs. Run-end encoded array has no buffers
+by itself, but has two child arrays:
+
+*  **Run ends array:** holds the index in the array where each run ends.
+*  **Values array:** the actual values without repetitions.
+
+.. figure:: ./images/ree-diagram.svg
+   :alt: Diagram is showing the difference between the run-end encoded data
+         type presented in a Table and the dataactually stored in computer
+         memory.
+
+   Physical layout diagram for run-end encoded data type.
+
+.. link to All types overview https://github.com/apache/arrow/issues/14752
+
+Overview of Arrow Terminology
+=============================
+
+**Physical layout**
+A specification for how to arrange values of an array in memory.
+
+**Buffer**
+A contiguous region of memory with a given length. Buffers are used to store data for arrays.

Review Comment:
   https://github.com/apache/arrow/pull/41593/commits/2c9cc95a54808e75be365afd3c75f95872d2469a



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-41673: [Format][Docs] Add arrow format introductory page [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #41593:
URL: https://github.com/apache/arrow/pull/41593#discussion_r1775897665


##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data

Review Comment:
   ```suggestion
   The adoption of these standards reduces computing costs of data
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This covers topics like:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data. For an example, let's consider
+we have data that can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+Tabular data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others, more efficient thanks to memory locality.
+When processing the data, the memory locations accessed by the CPU tend
+be near one another. By keeping the data contiguous in memory, it also
+enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.
+
+Apache Arrow is solving this exact problem. It is the specification that
+uses the columnar layout.
+
+.. figure:: ./images/columnar-diagram_3.svg
+   :alt: Tabular data being structured column by column in computer memory.
+
+   The same tabular data being saved in memory column by column.
+
+Each column is called an **Array** in Arrow terminology. Arrays can be of
+different data types and the way their values are stored in memory varies among
+the data types. The specification of how these values are arranged in memory is
+what we call a **physical memory layout**. One contiguous region of memory that
+stores data for arrays is called a **Buffer**. An array consists of one or more
+buffers.
+
+Next sections give an introduction to Arrow Columnar Format explaining the
+different physical layouts. The full specification of the format can be found
+at :ref:`format_columnar`.
+
+Support for Null Values
+=======================
+
+Arrow supports missing values or "nulls" for all data types: any value
+in an array may be semantically null, whether primitive or nested data type.
+
+In Arrow, a dedicated buffer, known as the validity (or "null") bitmap,
+is used alongside the data indicating whether each value in the array is
+null or not: a value of 1 means that the value is not-null ("valid"), whereas
+a value of 0 indicates that the value is null.
+
+This validity bitmap is optional: if there are no missing values in
+the array the buffer does not need to be allocated (as in the example
+column 1 in the diagram below).
+
+.. note::
+
+   We read validity bitmaps right-to-left within a group of 8 bits due to
+   `least-significant bit numbering <https://en.wikipedia.org/wiki/Bit_numbering>`_
+   being used.
+
+   This is also the how we represented the validity bitmaps in the
+   diagrams included in this document.
+
+Primitive Layouts
+=================
+
+Fixed Size Primitive Layout
+---------------------------
+
+A primitive column represents an array of values where each value
+has the same physical size measured in bytes. Data types that use the
+fixed size primitive layout are, for example, signed and unsigned
+integer data types, floating point numbers, boolean, decimal and temporal
+data types.
+
+.. figure:: ./images/primitive-diagram.svg
+   :alt: Diagram is showing the difference between the primitive data
+         type presented in a Table and the data actually stored in
+         computer memory.
+
+   Physical layout diagram for primitive data types.
+
+.. note::
+   The boolean data type is represented with a primitive layout where the
+   values are encoded in bits instead of bytes. That means the physical
+   layout includes a values bitmap buffer and possibly a validity bitmap
+   buffer.
+
+   .. figure:: ./images/bool-diagram.svg
+      :alt: Diagram is showing the difference between the boolean data
+            type presented in a Table and the data actually stored in
+            computer memory.
+
+      Physical layout diagram for boolean data type.
+
+.. note::
+   Arrow also has a concept of Null data type where all values are null. In
+   this case no buffers are allocated.
+
+Variable length binary and string
+---------------------------------
+
+In contrast to the fixed size primitive layout, the variable length layout
+allows representing an array where each element can have a variable size
+in bytes. This layout is used for binary and string data.
+
+The bytes of all elements in a binary or string column are stored together
+consecutively in a single buffer or region of memory. To know where each element
+of the column starts and ends, the physical layout also includes integer offsets.
+The offsets buffer is always one element longer than the array.
+The last two offsets define the start and the end of the last
+binary/string element.
+
+Binary and string data types share the same physical layout. The only
+difference between them is that a string-typed array is assumed to contain
+valid utf-8 string data.

Review Comment:
   ```suggestion
   valid UTF-8 string data.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.

Review Comment:
   ```suggestion
   vast set of algorithms for in-memory analytical data processing. More detail
   about how implementations differ can be found on the :ref:`status` page.
   ```



##########
docs/source/format/Intro.rst:
##########
@@ -0,0 +1,511 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+************
+Introduction
+************
+
+Apache Arrow was born from the need for a set of standards around
+tabular data representation and interchange between systems.
+The adoption of these standards reduce computing costs of data
+serialization/deserialization and implementation costs across
+systems implemented in different programming languages.
+
+The Apache Arrow specification can be implemented in any programming
+language but official implementations for many languages are available.
+An implementation consists of format definitions using the constructs
+offered by the language and common in-memory data processing algorithms
+(e.g. slicing and concatenating). Users can extend and use the utilities
+provided by the Apache Arrow implementation in their programming
+language of choice. Some implementations are further ahead and feature a
+vast set of algorithms for in-memory analytical data processing.
+
+Apart from this initial vision, Arrow has grown to also develop a
+multi-language collection of libraries for solving problems related to
+in-memory analytical data processing. This covers topics like:
+
+* Zero-copy shared memory and RPC-based data movement
+* Reading and writing file formats (like CSV, `Apache ORC`_, and `Apache Parquet`_)
+* In-memory analytics and query processing
+
+.. _Apache ORC: https://orc.apache.org/
+.. _Apache Parquet: https://parquet.apache.org/
+
+Arrow Columnar Format
+=====================
+
+Apache Arrow focuses on tabular data. For an example, let's consider
+we have data that can be organized into a table:
+
+.. figure:: ./images/columnar-diagram_1.svg
+   :scale: 70%
+   :alt: Diagram with tabular data of 4 rows and columns.
+
+   Diagram of a tabular data structure.
+
+Tabular data can be represented in memory using a row-based format or a
+column-based format. The row-based format stores data row-by-row, meaning the rows
+are adjacent in the computer memory:
+
+.. figure:: ./images/columnar-diagram_2.svg
+   :alt: Tabular data being structured row by row in computer memory.
+
+   Tabular data being saved in memory row by row.
+
+In a columnar format, the data is organized column-by-column instead.
+This organization makes analytical operations like filtering, grouping,
+aggregations and others, more efficient thanks to memory locality.
+When processing the data, the memory locations accessed by the CPU tend
+be near one another. By keeping the data contiguous in memory, it also
+enables vectorization of the computations. Most modern
+CPUs have
+[SIMD instructions](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)
+(a single instruction that operates on multiple values at once) enabling parallel
+processing and execution of operations on vector data using a single CPU
+instruction.

Review Comment:
   Fixes this link:
   
   ```suggestion
   enables vectorization of the computations. Most modern CPUs have
   `SIMD instructions`_ (a single instruction that operates on multiple values at
   once) enabling parallel processing and execution of operations on vector data
   using a single CPU instruction.
   
   .. _SIMD instructions: https://en.wikipedia.org/wiki/Single_instruction,_multiple_data
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org