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

    https://github.com/apache/spark/pull/21657#discussion_r202528391
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/UnivocityParser.scala
 ---
    @@ -197,15 +202,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))
    +  }
    +
       private def convert(tokens: Array[String]): InternalRow = {
    -    if (tokens.length != schema.length) {
    +    if (tokens.length != parsedSchema.length) {
    --- End diff --
    
    If possible, could you add a test case that satisfy `tokens.length != 
parsedSchema.length`


---

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

Reply via email to