MaxGekk commented on a change in pull request #27287: [SPARK-30530][SQL][FOLLOW-UP] Remove unnecessary codes and fix comments accordingly in UnivocityParser URL: https://github.com/apache/spark/pull/27287#discussion_r368385157
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/UnivocityParser.scala ########## @@ -232,18 +229,13 @@ class UnivocityParser( new RuntimeException("Malformed CSV record")) } - var checkedTokens = tokens var badRecordException: Option[Throwable] = None Review comment: How about: ```scala var badRecordException: Option[Throwable] = if (tokens.length != parsedSchema.length) { // If the number of tokens doesn't match the schema, we should treat it as a malformed record. Some(new RuntimeException("Malformed CSV record")) } else None ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org