You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Thomas Decaux (JIRA)" <ji...@apache.org> on 2018/11/30 09:33:00 UTC

[jira] [Comment Edited] (SPARK-26214) Add "broadcast" method to DataFrame

    [ https://issues.apache.org/jira/browse/SPARK-26214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16704475#comment-16704475 ] 

Thomas Decaux edited comment on SPARK-26214 at 11/30/18 9:32 AM:
-----------------------------------------------------------------

Sure, it's already possible to do it (like I said).

The same thing for "cache" / "persist" DataFrame method:
{code:java}
public DataFrame persist(StorageLevel newLevel) {
 this.sqlContext().cacheManager().cacheQuery(this, scala.None..MODULE$, newLevel);
 return this;
}{code}
This is more a "short-cut" method as you can see, it's possible to use cacheManager *OR* the DataFrame method.

Same thing for registerTempTable:
{code:java}
public void registerTempTable(String tableName) {
 this.sqlContext().registerDataFrameAsTable(this, tableName);
}{code}
You can see here, this is a short-cut method.

I propose to do the same thing for broadcast.


was (Author: ebuildy):
Sure, it's already to do this (like I said).

The same thing for "cache" / "persist" DataFrame method:
{code:java}
public DataFrame persist(StorageLevel newLevel) {
 this.sqlContext().cacheManager().cacheQuery(this, scala.None..MODULE$, newLevel);
 return this;
}{code}
This is more a "short-cut" method as you can see, it's possible to use cacheManager *OR* the DataFrame method.

Same thing for registerTempTable:
{code:java}
public void registerTempTable(String tableName) {
 this.sqlContext().registerDataFrameAsTable(this, tableName);
}{code}
You can see here, this is a short-cut method.

I propose to do the same thing for broadcast.

> Add "broadcast" method to DataFrame
> -----------------------------------
>
>                 Key: SPARK-26214
>                 URL: https://issues.apache.org/jira/browse/SPARK-26214
>             Project: Spark
>          Issue Type: Wish
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Thomas Decaux
>            Priority: Trivial
>              Labels: broadcast, dataframe
>
> As discussed at [https://stackoverflow.com/questions/43984068/does-spark-sql-autobroadcastjointhreshold-work-for-joins-using-datasets-join-op/43994022,] it's possible to force broadcast of DataFrame, even if total size is greater than ``*spark.sql.autoBroadcastJoinThreshold``.*
> But this not trivial for beginner, because there is no "broadcast" method (I know, I am lazy ...).
> We could add this method, with a WARN if size is greater than the threshold.
> (if it's an easy one, I could do it?)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org