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

    https://github.com/apache/spark/pull/21657#discussion_r200204856
  
    --- 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 --
    
    The `lazy` for `tokenIndexArr` means that internal laziness flag will be 
check per each token. I would remove `lazy` for `tokenIndexArr`


---

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

Reply via email to