shahidki31 commented on a change in pull request #32498: URL: https://github.com/apache/spark/pull/32498#discussion_r631162814
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala ########## @@ -759,6 +759,10 @@ case class Range( } override def computeStats(): Statistics = { + if (!conf.cboEnabled) { + return Statistics(sizeInBytes = LongType.defaultSize * numElements) + } + Review comment: I removed the condition. I have added the condition earlier because, if cbo is not enabled, other operators are not returning other statistics. But yes, in this case we have all the statistics readily available. Do we also need to remove histogram check as well? ########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala ########## @@ -767,14 +771,44 @@ case class Range( } else { (start + (numElements - 1) * step, start) } - val colStat = ColumnStat( + var colStat = ColumnStat( Review comment: Done ########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala ########## @@ -767,14 +771,44 @@ case class Range( } else { (start + (numElements - 1) * step, start) } - val colStat = ColumnStat( + var colStat = ColumnStat( distinctCount = Some(numElements), max = Some(maxVal), min = Some(minVal), nullCount = Some(0), avgLen = Some(LongType.defaultSize), maxLen = Some(LongType.defaultSize)) + if (conf.histogramEnabled) { + Review comment: Removed ########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala ########## @@ -767,14 +771,44 @@ case class Range( } else { (start + (numElements - 1) * step, start) } - val colStat = ColumnStat( + var colStat = ColumnStat( distinctCount = Some(numElements), max = Some(maxVal), min = Some(minVal), nullCount = Some(0), avgLen = Some(LongType.defaultSize), maxLen = Some(LongType.defaultSize)) + if (conf.histogramEnabled) { + + def getRangeValue(index: Int): Long = { Review comment: Done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org