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

Tian Tian edited comment on SPARK-6221 at 12/23/19 3:24 AM:
------------------------------------------------------------

I encounterd this problem and find 
[issue-24940](https://issues.apache.org/jira/browse/SPARK-24940)

Use {quote}/*+ COALESCE(numPartitions) */{quote} or {quote}/*+ 
REPARTITION(numPartitions) */{quote} in spark sql query will control output 
file numbers.

In my parctice I recommend second parm for users, because it will generate a 
new stage to do this job, while first parm won't which may lead the job dead 
because of fewer tasks in the last stage.


was (Author: tian tian):
I encounterd this problem and find 
[issue-24940](https://issues.apache.org/jira/browse/SPARK-24940)

Use `/*+ COALESCE(numPartitions) */` or `/*+ REPARTITION(numPartitions) */` in 
spark sql query will control output file numbers.

In my parctice I recommend second parm for users, because it will generate a 
new stage to do this job, while first parm won't which may lead the job dead 
because of fewer tasks in the last stage.

> SparkSQL should support auto merging output files
> -------------------------------------------------
>
>                 Key: SPARK-6221
>                 URL: https://issues.apache.org/jira/browse/SPARK-6221
>             Project: Spark
>          Issue Type: New Feature
>          Components: SQL
>            Reporter: Tianyi Wang
>            Priority: Major
>
> Hive has a feature that could automatically merge small files in HQL's output 
> path. 
> This feature is quite useful for some cases that people use {{insert into}} 
> to  handle minute data from the input path to a daily table.
> In that case, if the SQL includes {{group by}} or {{join}} operation, we 
> always set the {{reduce number}} at least 200 to avoid the possible OOM in 
> reduce side.
> That will cause this SQL output at least 200 files at the end of the 
> execution. So the daily table will finally contains more than 50000 files. 
> If we could provide the same feature in SparkSQL, it will extremely reduce 
> hdfs operations and spark tasks when we run other sql on this table.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to