[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread viirya
Github user viirya commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60698475
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/object.scala
 ---
@@ -83,6 +83,16 @@ case class SerializeFromObject(
 child: LogicalPlan) extends UnaryNode with ObjectConsumer {
 
   override def output: Seq[Attribute] = serializer.map(_.toAttribute)
+
+  // We can't estimate the size of ObjectType. We implement statistics 
here to avoid
+  // directly estimate any child plan which produces domain objects as 
output.
+  override def statistics: Statistics = {
+if (child.output.find(_.dataType.isInstanceOf[ObjectType]).isDefined) {
+  Statistics(sizeInBytes = Long.MaxValue)
--- End diff --

But we still need to know row size?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213294301
  
**[Test build #56669 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56669/consoleFull)**
 for PR 12599 at commit 
[`4b5f66d`](https://github.com/apache/spark/commit/4b5f66df9b763cef45550e3c2a17793ead205bfd).


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread viirya
Github user viirya commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60697763
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/object.scala
 ---
@@ -83,6 +83,16 @@ case class SerializeFromObject(
 child: LogicalPlan) extends UnaryNode with ObjectConsumer {
 
   override def output: Seq[Attribute] = serializer.map(_.toAttribute)
+
+  // We can't estimate the size of ObjectType. We implement statistics 
here to avoid
+  // directly estimate any child plan which produces domain objects as 
output.
+  override def statistics: Statistics = {
+if (child.output.find(_.dataType.isInstanceOf[ObjectType]).isDefined) {
--- End diff --

oh. yes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread cloud-fan
Github user cloud-fan commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60697122
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/object.scala
 ---
@@ -83,6 +83,16 @@ case class SerializeFromObject(
 child: LogicalPlan) extends UnaryNode with ObjectConsumer {
 
   override def output: Seq[Attribute] = serializer.map(_.toAttribute)
+
+  // We can't estimate the size of ObjectType. We implement statistics 
here to avoid
+  // directly estimate any child plan which produces domain objects as 
output.
+  override def statistics: Statistics = {
+if (child.output.find(_.dataType.isInstanceOf[ObjectType]).isDefined) {
+  Statistics(sizeInBytes = Long.MaxValue)
--- End diff --

Not related to this PR, but why do we need to store the `sizeInBytes` not 
`numRows`? If we have the `numRows` info, we can still estimate the output size 
for this operator right?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213289068
  
**[Test build #56665 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56665/consoleFull)**
 for PR 12599 at commit 
[`9d2033f`](https://github.com/apache/spark/commit/9d2033ffbdf37ba1e1140d88415977372a91cba7).


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread cloud-fan
Github user cloud-fan commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60696638
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/object.scala
 ---
@@ -83,6 +83,16 @@ case class SerializeFromObject(
 child: LogicalPlan) extends UnaryNode with ObjectConsumer {
 
   override def output: Seq[Attribute] = serializer.map(_.toAttribute)
+
+  // We can't estimate the size of ObjectType. We implement statistics 
here to avoid
+  // directly estimate any child plan which produces domain objects as 
output.
+  override def statistics: Statistics = {
+if (child.output.find(_.dataType.isInstanceOf[ObjectType]).isDefined) {
--- End diff --

nit: we can just do `child.output.head.isInstanceOf[ObjectType]`, this is 
guarantted in:
```
trait ObjectConsumer extends UnaryNode {
   assert(child.output.length == 1)
   ...
```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213284497
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56650/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213284493
  
Merged build finished. Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213284105
  
**[Test build #56650 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56650/consoleFull)**
 for PR 12599 at commit 
[`8e0541c`](https://github.com/apache/spark/commit/8e0541c35d71608db1d2de36d8bd117079d4cd2c).
 * This patch passes all tests.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread gatorsmile
Github user gatorsmile commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213275326
  
@cloud-fan If we do not produce objects, it should work. Otherwise, we will 
hit the exception when the parent node calculates the statistics: 
https://github.com/apache/spark/blob/da8859226e09aa6ebcf6a1c5c1369dec3c216eac/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala#L307

Previously, I just simply use the child's `statistics` value as the 
`statistics` of `SerializeFromObject`. Obviously, it does not help.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213274784
  
Merged build finished. Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread AmplabJenkins
Github user AmplabJenkins commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213274786
  
Test PASSed.
Refer to this link for build results (access rights to CI server needed): 
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56647/
Test PASSed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-22 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213274657
  
**[Test build #56647 has 
finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56647/consoleFull)**
 for PR 12599 at commit 
[`84207c7`](https://github.com/apache/spark/commit/84207c7aa08ae2e6d7d97a22b64497a3e1604ac8).
 * This patch passes all tests.
 * This patch merges cleanly.
 * This patch adds no public classes.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread cloud-fan
Github user cloud-fan commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213272475
  
@viirya , yea you are right, `ObjectConsumer` may also produce objects, so 
we should implement `statistic` in `SerializeFromObject`.

@gatorsmile I may misunderstand you point. What do you mean by `The problem 
is the parent node calls the defaultSize of its child's output`? If we make 
`SerializeFromObject.statistics` work, its parent should be OK too, as 
`SerializeFromObject` will never produce objects.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread gatorsmile
Github user gatorsmile commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213269638
  
The problem is the parent node calls the defaultSize of its child's output.

```scala
val childRowSize = child.output.map(_.dataType.defaultSize).sum + 8
val outputRowSize = output.map(_.dataType.defaultSize).sum + 8
```

Thus, we should check the dataType here. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread gatorsmile
Github user gatorsmile commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213267994
  
@viirya Nope. Actually, I did that before. It does not work. The issue is 
its parent node's statistics calculation triggers the exception.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
Github user viirya commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213265799
  
@gatorsmile Looks at the `SerializeFromObject` in your plan. If we 
implement `statistics` in it, we can skip estimating size of `MapGroups` which 
produces domain objects.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread gatorsmile
Github user gatorsmile commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213265498
  
When we calculating the statistics of `Filter`, we hit the issue caused by 
the `UnaryNode`'s default statistics calculation, right?



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread gatorsmile
Github user gatorsmile commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213265063
  
```
== Optimized Logical Plan ==
Project [user#7,recommendations#48 AS prediction#77,actual#65 AS label#78]
+- Join Inner, Some((user#7 = id#64))
   :- Project [user#7,recommendations#48]
   :  +- Join Inner, Some((user#7 = id#47))
   : :- Aggregate [user#7], [user#7]
   : :  +- LocalRelation [user#7], [[0],[0],[0],[1],[1],[1],[2],[2],[2]]
   : +- Project [_1#44 AS id#47,_2#45 AS recommendations#48]
   :+- LogicalRDD [_1#44,_2#45], MapPartitionsRDD[19] at 
rddToDatasetHolder at ALS.scala:335
   +- Project [_1#61 AS id#64,_2#62 AS actual#65]
  +- Filter isnotnull(_1#61)
 +- SerializeFromObject [input[0, scala.Tuple2]._1 AS 
_1#61,newInstance(class org.apache.spark.sql.catalyst.util.GenericArrayData) AS 
_2#62]
+- MapGroups , value#55: int, newInstance(class 
scala.Tuple2), [value#55], [user#7,item#8], obj#60: scala.Tuple2
   +- AppendColumns , newInstance(class 
scala.Tuple2), [input[0, int] AS value#55]
  +- LocalRelation [user#7,item#8], 
[[0,3],[0,4],[0,5],[1,3],[1,5],[1,4],[2,3],[2,5],[2,4]]
```

How about this plan? I am still unable to catch your main points.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
Github user viirya commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213264884
  
@cloud-fan Is there guarantee that an `ObjectConsumer` can't produce domain 
object? If no, I think it is safer to implement `statistics` in 
`SerializeFromObject`, instead of `ObjectConsumer`?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
Github user viirya commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213264562
  
Yea I see.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread cloud-fan
Github user cloud-fan commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213264156
  
The object operators are really special, it breaks the contract that 
operator will always produce unsafe rows, so their usage is quite limited. 
Generally speaking, an `ObjectProducer` will always have an `ObjectConsumer` 
nearby to turn it back to unsafe rows. So if we implement `statistics` for 
`ObjectConsumer`, there should be nowhere else that will estimate size for 
object type.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
Github user viirya commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213261995
  
Let me try it...


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
Github user viirya commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213261576
  
@cloud-fan Sounds good.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread gatorsmile
Github user gatorsmile commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213260014
  
We need to change the implementation of `UnaryNode `'s the default 
statistics calculation. However, the other node types that do not use the 
default method still face the same issue.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread gatorsmile
Github user gatorsmile commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213259525
  
@cloud-fan That does not help. The parent `UnaryNode` can be any type. We 
will face this issue when its child is `SerializeFromObject ` 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread gatorsmile
Github user gatorsmile commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60691895
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
@@ -82,7 +82,10 @@ private[sql] abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
*/
   object CanBroadcast {
 def unapply(plan: LogicalPlan): Option[LogicalPlan] = {
-  if (plan.statistics.sizeInBytes <= conf.autoBroadcastJoinThreshold) {
+  // We can't estimate the size of ObjectType
+  if (plan.find(_.isInstanceOf[ObjectProducer]).isDefined) {
--- End diff --

This is a special case, right? We are facing the same issue as long as we 
calculate the statistics values.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread cloud-fan
Github user cloud-fan commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213259121
  
After think about it, it is better to implement `statistics` in 
`SerializeFromObject`?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
Github user viirya commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60691766
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
@@ -82,7 +82,10 @@ private[sql] abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
*/
   object CanBroadcast {
 def unapply(plan: LogicalPlan): Option[LogicalPlan] = {
-  if (plan.statistics.sizeInBytes <= conf.autoBroadcastJoinThreshold) {
+  // We can't estimate the size of ObjectType
+  if (plan.find(_.isInstanceOf[ObjectProducer]).isDefined) {
--- End diff --

make sense. Let me add the check too.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread cloud-fan
Github user cloud-fan commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60691640
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
@@ -82,7 +82,10 @@ private[sql] abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
*/
   object CanBroadcast {
 def unapply(plan: LogicalPlan): Option[LogicalPlan] = {
-  if (plan.statistics.sizeInBytes <= conf.autoBroadcastJoinThreshold) {
+  // We can't estimate the size of ObjectType
+  if (plan.find(_.isInstanceOf[ObjectProducer]).isDefined) {
--- End diff --

`ObjectProducer` does not always produce objects, think about int encoder. 
We should check if the output is `ObjectType`


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213257892
  
**[Test build #56650 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56650/consoleFull)**
 for PR 12599 at commit 
[`8e0541c`](https://github.com/apache/spark/commit/8e0541c35d71608db1d2de36d8bd117079d4cd2c).


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
Github user viirya commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213257282
  
@cloud-fan Just added.



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread cloud-fan
Github user cloud-fan commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213257114
  
Can you construct a query that can trigger this bug?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
Github user viirya commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60691109
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
@@ -82,7 +82,10 @@ private[sql] abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
*/
   object CanBroadcast {
 def unapply(plan: LogicalPlan): Option[LogicalPlan] = {
-  if (plan.statistics.sizeInBytes <= conf.autoBroadcastJoinThreshold) {
+  // We can't estimate the size of ObjectType
+  if (plan.find(_.isInstanceOf[ObjectProducer]).isDefined) {
--- End diff --

`ObjectType` simply throws exception if we call its `defaultSize`.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread rxin
Github user rxin commented on a diff in the pull request:

https://github.com/apache/spark/pull/12599#discussion_r60690868
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
@@ -82,7 +82,10 @@ private[sql] abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
*/
   object CanBroadcast {
 def unapply(plan: LogicalPlan): Option[LogicalPlan] = {
-  if (plan.statistics.sizeInBytes <= conf.autoBroadcastJoinThreshold) {
+  // We can't estimate the size of ObjectType
+  if (plan.find(_.isInstanceOf[ObjectProducer]).isDefined) {
--- End diff --

what's the size currently?



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread SparkQA
Github user SparkQA commented on the pull request:

https://github.com/apache/spark/pull/12599#issuecomment-213252296
  
**[Test build #56647 has 
started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56647/consoleFull)**
 for PR 12599 at commit 
[`84207c7`](https://github.com/apache/spark/commit/84207c7aa08ae2e6d7d97a22b64497a3e1604ac8).


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request: [SPARK-14838][SQL] Skip automatically broadcas...

2016-04-21 Thread viirya
GitHub user viirya opened a pull request:

https://github.com/apache/spark/pull/12599

[SPARK-14838][SQL] Skip automatically broadcast a plan when it contains 
ObjectProducer

## What changes were proposed in this pull request?

In `SparkStrategies`, `CanBroadcast` will determine whether to broadcast a 
plan by the plan's estimated size. For any plan with `ObjectProducer` 
interface, its output is a `ObjectType`. As we can't estimate the size of 
`ObjectType`, we throw an `UnsupportedOperationException` if trying to do that. 
It causes the 
[failure](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56533/consoleFull).

To fix this, we should skip broadcasting a plan when it contains 
`ObjectProducer`.

## How was this patch tested?
Test will added later.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/viirya/spark-1 skip-broadcast-objectproducer

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/12599.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #12599


commit 84207c7aa08ae2e6d7d97a22b64497a3e1604ac8
Author: Liang-Chi Hsieh 
Date:   2016-04-22T04:20:34Z

Skip automatically broadcast a plan when it contains ObjectProducer.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org