Skip to content

Commit db61b41

Browse files
committed
address review comment
1 parent a12d8da commit db61b41

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ case class CollapseCodegenStages(conf: SQLConf) extends Rule[SparkPlan] {
509509
val hasTooManyOutputFields =
510510
WholeStageCodegenExec.isTooManyFields(conf, plan.schema)
511511
val hasTooManyInputFields =
512-
plan.children.find(p => WholeStageCodegenExec.isTooManyFields(conf, p.schema)).isDefined
512+
plan.children.exists(p => WholeStageCodegenExec.isTooManyFields(conf, p.schema))
513513
!willFallback && !hasTooManyOutputFields && !hasTooManyInputFields
514514
case _ => false
515515
}

sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryTableScanExec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ case class InMemoryTableScanExec(
4646
override val supportCodegen: Boolean = {
4747
// In the initial implementation, for ease of review
4848
// support only primitive data types and # of fields is less than wholeStageMaxNumFields
49-
relation.schema.fields.find(f => f.dataType match {
49+
relation.schema.fields.forall(f => f.dataType match {
5050
case BooleanType | ByteType | ShortType | IntegerType | LongType |
51-
FloatType | DoubleType => false
52-
case _ => true
53-
}).isEmpty && !WholeStageCodegenExec.isTooManyFields(conf, relation.schema)
51+
FloatType | DoubleType => true
52+
case _ => false
53+
}) && !WholeStageCodegenExec.isTooManyFields(conf, relation.schema)
5454
}
5555

5656
private val columnIndices =

0 commit comments

Comments
 (0)