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

    https://github.com/apache/spark/pull/21657#discussion_r200209800
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/UnivocityParser.scala
 ---
    @@ -197,15 +203,21 @@ class UnivocityParser(
        */
       def parse(input: String): InternalRow = doParse(input)
     
    +  private val getToken = if (options.columnPruning) {
    +    (tokens: Array[String], index: Int) => tokens(index)
    +  } else {
    +    (tokens: Array[String], index: Int) => tokens(tokenIndexArr(index))
    --- End diff --
    
    If `options.columnPruning` disabled (by default), `tokenIndexArr` is not 
totally used in most cases. If so, it'd be better to drop `lazy`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to