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: [email protected]
For additional commands, e-mail: [email protected]