Github user wangyum commented on the issue:
https://github.com/apache/spark/pull/19831
If CBO enabled, the [`outputRowCount ==
0`](https://github.com/apache/spark/pull/19831#L67), the
[`getOutputSize`](https://github.com/apache/spark/pull/19831#L60) is 1,
`sizeInBytes` is 1 and this side can broadcast:
https://github.com/apache/spark/blob/b803b66a8133f705463039325ee71ee6827ce1a7/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/EstimationUtils.scala#L65-L88
https://github.com/apache/spark/blob/e26dac5feb02033f980b1e69c9b0ff50869b6f9e/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala#L45-L64
---
If CBO disabled, the ` sizeInBytes = (p.child.stats.sizeInBytes *
outputRowSize) / childRowSize` and this side cann't broadcast:
https://github.com/apache/spark/blob/ae253e5a878a0adc2785ae050c49022687ac1d06/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/SizeInBytesOnlyStatsPlanVisitor.scala#L30-L49--- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
