You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by viirya <gi...@git.apache.org> on 2018/08/01 18:01:27 UTC

[GitHub] spark pull request #21909: [SPARK-24959][SQL] Speed up count() for JSON and ...

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

    https://github.com/apache/spark/pull/21909#discussion_r206976717
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FailureSafeParser.scala ---
    @@ -56,9 +57,14 @@ class FailureSafeParser[IN](
         }
       }
     
    +  private val skipParsing = optimizeEmptySchema && schema.isEmpty
       def parse(input: IN): Iterator[InternalRow] = {
         try {
    -      rawParser.apply(input).toIterator.map(row => toResultRow(Some(row), () => null))
    +     if (skipParsing) {
    +       Iterator.single(InternalRow.empty)
    +     } else {
    +       rawParser.apply(input).toIterator.map(row => toResultRow(Some(row), () => null))
    --- End diff --
    
    If there are broken records the parser can't parse, this skipping won't detect them?


---

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