spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] MaxGekk commented on a change in pull request #27287: [SPARK-30530][SQL][FOLLOW-UP] Remove unnecessary codes and fix comments accordingly in UnivocityParser
Date Mon, 20 Jan 2020 06:41:44 GMT
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_r368388359
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/UnivocityParser.scala
 ##########
 @@ -203,7 +202,11 @@ class UnivocityParser(
     }
   }
 
-  private val doParse = if (options.columnPruning && requiredSchema.isEmpty) {
+  /**
+   * Parses a single CSV string and turns it into either one resulting row or no row (if
the
+   * the record is malformed).
+   */
+  val parse: String => Option[InternalRow] = if (options.columnPruning && requiredSchema.isEmpty)
{
 
 Review comment:
   It can be just normal method:
   ```scala
     def parse(input: String): Option[InternalRow] = {
       if (options.columnPruning && requiredSchema.isEmpty) {
         // If `columnPruning` enabled and partition attributes scanned only,
         // `schema` gets empty.
         Some(InternalRow.empty)
       } else {
         // parse if the columnPruning is disabled or requiredSchema is nonEmpty
         convert(tokenizer.parseLine(input))
       }
     }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


Mime
View raw message