Github user concretevitamin commented on a diff in the pull request:
https://github.com/apache/spark/pull/1238#discussion_r14906952
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
---
@@ -92,6 +114,8 @@ abstract class LogicalPlan extends
QueryPlan[LogicalPlan] {
abstract class LeafNode extends LogicalPlan with
trees.LeafNode[LogicalPlan] {
self: Product =>
+ override lazy val statistics = Statistics(numTuples = 1L, sizeInBytes =
1L)
--- End diff --
Setting large default values here (1) doesn't seem to make intuitive sense,
and (2) can cause superfluous overflows when things are getting multiplied.
This
[commit](https://github.com/concretevitamin/spark/commit/f41ecf22d516bfeabc4168f2a1e6518169d85c29)
introduced this change, which makes 1L a special default value that gets
preserved even when a bunch of operators lack meaningful estimates -- because
the default estimates will just multiply a bunch of 1's together, producing the
special value 1L. With this preservation, we could test the absence of
meaningful estimates and correspondingly do special handling, as shown in that
commit. (One example in that commit: if RDDs don't have meaningful estimates,
the field defaults to
[SQLConf#statsDefaultSizeInBytes](https://github.com/apache/spark/pull/1238/files#diff-41ef65b9ef5b518f77e2a03559893f4dR61),
which is set to be greater than the auto join conversion threshold.
---
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.
---