Github user concretevitamin commented on a diff in the pull request:
https://github.com/apache/spark/pull/1238#discussion_r14573147
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
---
@@ -26,6 +26,17 @@ import org.apache.spark.sql.catalyst.trees
abstract class LogicalPlan extends QueryPlan[LogicalPlan] {
self: Product =>
+ protected class Estimates {
+ lazy val childrenEstimations = children.map(_.estimates)
+ lazy val cardinality: Long = childrenEstimations.map(_.cardinality).sum
+ lazy val sizeInBytes: Long = childrenEstimations.map(_.sizeInBytes).sum
--- End diff --
We should definitely decide how much of the estimates framework we'd like
to implement in this PR. Existing RDDs do not have meaningful estimates in the
current version of this patch.
As for what default value to use, I think 10000 is what Hive is using (see
[here](https://cwiki.apache.org/confluence/display/Hive/LanguageManual+JoinOptimization)).
Lastly, we should also think about the default Estimates: currently it is a
sum of children's estimates, but for joins we'd like it to be a product -- yet
we have to be careful when 0 appears in a child's estimate.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---