Skip to content

Commit f6a01ff

Browse files
committed
Add testcase for column pruning enable case
1 parent 1078e8a commit f6a01ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/UnivocityParser.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@ class UnivocityParser(
188188
}
189189
}
190190

191-
// parse if the columnPruning is disabled or requiredSchema is nonEmpty
192-
private val doParse = if (!options.columnPruning || requiredSchema.nonEmpty) {
193-
(input: String) => convert(tokenizer.parseLine(input))
194-
} else {
191+
private val doParse = if (options.columnPruning && requiredSchema.isEmpty) {
195192
// If `columnPruning` enabled and partition attributes scanned only,
196193
// `schema` gets empty.
197194
(_: String) => InternalRow.empty
195+
} else {
196+
// parse if the columnPruning is disabled or requiredSchema is nonEmpty
197+
(input: String) => convert(tokenizer.parseLine(input))
198198
}
199199

200200
/**

0 commit comments

Comments
 (0)