Skip to content

Commit c0667d1

Browse files
committed
Make the condition better
1 parent 4132075 commit c0667d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVInferSchema.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ private[csv] object CSVTypeCast {
231231
castType: DataType,
232232
nullable: Boolean = true,
233233
options: CSVOptions = CSVOptions()): Any = {
234-
235-
if (datum == null || nullable && datum == options.nullValue) {
234+
val isNull = datum == options.nullValue || datum == null
235+
if (nullable && isNull) {
236236
null
237237
} else {
238238
castType match {

0 commit comments

Comments
 (0)