Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19811#discussion_r157417517
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
 ---
    @@ -163,11 +204,51 @@ class CodegenContext {
        *                 the list of default imports available.
        *                 Also, generic type arguments are accepted but ignored.
        * @param variableName Name of the field.
    -   * @param initCode The statement(s) to put into the init() method to 
initialize this field.
    +   * @param initFunc Function includes statement(s) to put into the init() 
method to initialize
    +   *                 this field. The argument is the name of the mutable 
state variable.
        *                 If left blank, the field will be default-initialized.
    +   * @param forceInline whether the declaration and initialization code 
may be inlined rather than
    +   *                    compacted. Please set `true` into forceInline, if 
you want to access the
    +   *                    status fast (e.g. frequently accessed) or if you 
want to use the original
    +   *                    variable name
    +   * @param useFreshName If this is false and forceInline is true, the 
name is not changed
    +   * @return the name of the mutable state variable, which is the original 
name or fresh name if
    +   *         the variable is inlined to the outer class, or an array 
access if the variable is to
    +   *         be stored in an array of variables of the same type.
    +   *         A variable will be inlined into the outer class when one of 
the following conditions
    +   *         are satisfied:
    +   *         1. forceInline is true
    +   *         2. its type is primitive type and the total number of the 
inlined mutable variables
    +   *            is less than 
`CodeGenerator.OUTER_CLASS_VARIABLES_THRESHOLD`
    +   *         3. its type is multi-dimensional array
    +   *         A primitive type variable will be inlined into outer class 
when the total number of
    +   *         When a variable is compacted into an array, the max size of 
the array for compaction
    --- End diff --
    
    Actually this line `A primitive type variable will be inlined into outer 
class when the total number of` looks redundant.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to