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

   ### Rationale for this change
   
   We use static variables for compute function option types. For example:
   
https://github.com/apache/arrow/blob/068416bd411d6a8e2949f8ebcb2f80e2c302ef6b/cpp/src/arrow/compute/api_vector.cc#L127-L170
   
   These option types are used for compute function options. For example: 
https://github.com/apache/arrow/blob/068416bd411d6a8e2949f8ebcb2f80e2c302ef6b/cpp/src/arrow/compute/api_vector.cc#L237
   
   If we use `static inline const` for compute function options, these compute 
function options may be initialized BEFORE compute function option types.
   
   We use `static inline const` only for `rank`, `rank_quantile` and 
`rank_normal`:
   
   
https://github.com/apache/arrow/blob/068416bd411d6a8e2949f8ebcb2f80e2c302ef6b/cpp/src/arrow/compute/kernels/vector_rank.cc#L382-L386
   
   
https://github.com/apache/arrow/blob/068416bd411d6a8e2949f8ebcb2f80e2c302ef6b/cpp/src/arrow/compute/kernels/vector_rank.cc#L399-L403
   
   
https://github.com/apache/arrow/blob/068416bd411d6a8e2949f8ebcb2f80e2c302ef6b/cpp/src/arrow/compute/kernels/vector_rank.cc#L416-L420
   
   We can avoid this initialization order problem by deferring default compute 
function options initialization.
   
   ### What changes are included in this PR?
   
   * Use `static function` instead of `static inline const` for default compute 
function options
   * Add tests for default compute function options for `rank`, `rank_quantile` 
and `rank_normal`
   
   ### Are these changes tested?
   
   Yes.
   
   ### Are there any user-facing changes?
   
   Yes.


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