pitrou commented on code in PR #36622:
URL: https://github.com/apache/arrow/pull/36622#discussion_r1262505508


##########
docs/source/cpp/env_vars.rst:
##########
@@ -26,6 +26,28 @@ Arrow C++ at runtime.  Many of these variables are inspected 
only once per
 process (for example, when the Arrow C++ DLL is loaded), so you cannot assume
 that changing their value later will have an effect.
 
+.. envvar:: ACERO_ALIGNMENT_HANDLING
+
+   Arrow C++'s Acero module performs computation on streams of data.  This
+   computation may involve a form of "type punning" that is technically
+   undefined behavior if the underlying array is not properly aligned.  On
+   most modern CPUs this is not an issue, but some older CPUs may crash or
+   suffer poor performance.  For this reason it is recommended that all
+   incoming array buffers are properly aligned.
+
+   The value of this environment variable controls what will happen when
+   Acero detects an unaligned buffer.

Review Comment:
   ```suggestion
      Acero detects an unaligned buffer:
   ```



##########
docs/source/cpp/env_vars.rst:
##########
@@ -26,6 +26,28 @@ Arrow C++ at runtime.  Many of these variables are inspected 
only once per
 process (for example, when the Arrow C++ DLL is loaded), so you cannot assume
 that changing their value later will have an effect.
 
+.. envvar:: ACERO_ALIGNMENT_HANDLING
+
+   Arrow C++'s Acero module performs computation on streams of data.  This
+   computation may involve a form of "type punning" that is technically
+   undefined behavior if the underlying array is not properly aligned.  On
+   most modern CPUs this is not an issue, but some older CPUs may crash or
+   suffer poor performance.  For this reason it is recommended that all
+   incoming array buffers are properly aligned.
+
+   The value of this environment variable controls what will happen when
+   Acero detects an unaligned buffer.
+
+   - ``warn`` a warning is emitted
+   - ``ignore`` nothing, alignment checking is disabled
+   - ``reallocate`` the buffer is reallocated to a properly aligned address
+   - ``error`` the operation will fail with an error

Review Comment:
   ```suggestion
      - ``warn``: a warning is emitted
      - ``ignore``: nothing, alignment checking is disabled
      - ``reallocate``: the buffer is reallocated to a properly aligned address
      - ``error``: the operation fails with an error
   ```



##########
docs/source/cpp/env_vars.rst:
##########
@@ -26,6 +26,28 @@ Arrow C++ at runtime.  Many of these variables are inspected 
only once per
 process (for example, when the Arrow C++ DLL is loaded), so you cannot assume
 that changing their value later will have an effect.
 
+.. envvar:: ACERO_ALIGNMENT_HANDLING
+
+   Arrow C++'s Acero module performs computation on streams of data.  This
+   computation may involve a form of "type punning" that is technically
+   undefined behavior if the underlying array is not properly aligned.  On
+   most modern CPUs this is not an issue, but some older CPUs may crash or
+   suffer poor performance.  For this reason it is recommended that all
+   incoming array buffers are properly aligned.

Review Comment:
   ```suggestion
      suffer poor performance.  For this reason it is recommended that all
      incoming array buffers are properly aligned, but some data sources
      such as :ref:`Flight <flight-rpc>` may produce unaligned 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-unsubscr...@arrow.apache.org

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

Reply via email to