You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Younes Naguib <Yo...@tritondigital.com> on 2015/10/07 20:07:11 UTC

Parquet file size

Hi,

I'm reading a large tsv file, and creating parquet files using sparksql:
insert overwrite
table tbl partition(year, month, day)....
Select .... from tbl_tsv;

This works nicely, but generates small parquet files (15MB).
I wanted to generate larger files, any idea how to address this?

Thanks,
Younes Naguib
Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | younes.naguib@tritondigital.com <ma...@streamtheworld.com>


Re: Parquet file size

Posted by Cheng Lian <li...@gmail.com>.
How many tasks are there in the write job? Since each task may write one 
file for each partition, you may end up with taskNum * 31 files.

Increasing SPLIT_MINSIZE does help reducing task number. Another way to 
address this issue is to use DataFrame.coalesce(n) to shrink task number 
to n explicitly.

Cheng

On 10/7/15 6:40 PM, Younes Naguib wrote:
> Thanks, I'll try that.
>
> *Younes Naguib**Streaming Division*
>
> Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 
> 1R8**
>
> Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | 
> younes.naguib@tritondigital.com<ma...@streamtheworld.com>**
>
> ------------------------------------------------------------------------
> *From:* odeaching@gmail.com [odeaching@gmail.com] on behalf of Deng 
> Ching-Mallete [oching@apache.org]
> *Sent:* Wednesday, October 07, 2015 9:14 PM
> *To:* Younes Naguib
> *Cc:* Cheng Lian; user@spark.apache.org
> *Subject:* Re: Parquet file size
>
> Hi,
>
> In our case, we're using 
> the org.apache.hadoop.mapreduce.lib.input.FileInputFormat.SPLIT_MINSIZE to 
> increase the size of the RDD partitions when loading text files, so it 
> would generate larger parquet files. We just set it in the Hadoop conf 
> of the SparkContext. You need to be careful though about setting it to 
> a large value, as you might encounter issues related to this:
> https://issues.apache.org/jira/browse/SPARK-6235
>
> For our jobs, we're setting the split size to 512MB which generates 
> between 110-200MB parquet files using the default compression. We're 
> using Spark-1.3.1, btw, and we also have the same partitioning of 
> year/month/day for our parquet files.
>
> HTH,
> Deng
>
> On Thu, Oct 8, 2015 at 8:25 AM, Younes Naguib 
> <Younes.Naguib@tritondigital.com 
> <ma...@tritondigital.com>> wrote:
>
>     Well, I only have data for 2015-08. So, in the end, only 31
>     partitions....
>     What I'm looking for, is some reasonably sized partitions.
>     In any case, just the idea of controlling the output parquet files
>     size or number would be nice.
>
>     *Younes Naguib**Streaming Division*
>
>     Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC 
>     H3G 1R8**
>
>     Tel.: +1 514 448 4037 x2688 <tel:%2B1%20514%20448%204037%20x2688>
>     | Tel.: +1 866 448 4037 x2688
>     <tel:%2B1%20866%20448%204037%20x2688> |
>     younes.naguib@tritondigital.com<ma...@streamtheworld.com>**
>
>     ------------------------------------------------------------------------
>     *From:* Cheng Lian [lian.cs.zju@gmail.com
>     <ma...@gmail.com>]
>     *Sent:* Wednesday, October 07, 2015 7:01 PM
>
>     *To:* Younes Naguib; 'user@spark.apache.org
>     <ma...@spark.apache.org>'
>     *Subject:* Re: Parquet file size
>
>     The reason why so many small files are generated should probably
>     be the fact that you are inserting into a partitioned table with
>     three partition columns.
>
>     If you want a large Parquet files, you may try to either avoid
>     using partitioned table, or using less partition columns (e.g.,
>     only year, without month and day).
>
>     Cheng
>
>     So you want to dump all data into a single large Parquet file?
>
>     On 10/7/15 1:55 PM, Younes Naguib wrote:
>>
>>     The TSV original files is 600GB and generated 40k files of 15-25MB.
>>
>>     y
>>
>>     *From:*Cheng Lian [mailto:lian.cs.zju@gmail.com]
>>     *Sent:* October-07-15 3:18 PM
>>     *To:* Younes Naguib; 'user@spark.apache.org
>>     <ma...@spark.apache.org>'
>>     *Subject:* Re: Parquet file size
>>
>>     Why do you want larger files? Doesn't the result Parquet file
>>     contain all the data in the original TSV file?
>>
>>     Cheng
>>
>>     On 10/7/15 11:07 AM, Younes Naguib wrote:
>>
>>         Hi,
>>
>>         I’m reading a large tsv file, and creating parquet files
>>         using sparksql:
>>
>>         insert overwrite
>>
>>         table tbl partition(year, month, day)....
>>
>>         Select .... from tbl_tsv;
>>
>>         This works nicely, but generates small parquet files (15MB).
>>
>>         I wanted to generate larger files, any idea how to address this?
>>
>>         *Thanks,*
>>
>>         *Younes Naguib*
>>
>>         Triton Digital | 1440 Ste-Catherine W., Suite 1200 |
>>         Montreal, QC  H3G 1R8
>>
>>         Tel.: +1 514 448 4037 x2688
>>         <tel:%2B1%20514%20448%204037%20x2688> | Tel.: +1 866 448 4037
>>         x2688 <tel:%2B1%20866%20448%204037%20x2688> |
>>         younes.naguib@tritondigital.com<ma...@streamtheworld.com>
>>
>>
>


RE: Parquet file size

Posted by Younes Naguib <Yo...@tritondigital.com>.
Thanks, I'll try that.

Younes Naguib Streaming Division
Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | younes.naguib@tritondigital.com <ma...@streamtheworld.com>
________________________________
From: odeaching@gmail.com [odeaching@gmail.com] on behalf of Deng Ching-Mallete [oching@apache.org]
Sent: Wednesday, October 07, 2015 9:14 PM
To: Younes Naguib
Cc: Cheng Lian; user@spark.apache.org
Subject: Re: Parquet file size

Hi,

In our case, we're using the org.apache.hadoop.mapreduce.lib.input.FileInputFormat.SPLIT_MINSIZE to increase the size of the RDD partitions when loading text files, so it would generate larger parquet files. We just set it in the Hadoop conf of the SparkContext. You need to be careful though about setting it to a large value, as you might encounter issues related to this:

https://issues.apache.org/jira/browse/SPARK-6235

For our jobs, we're setting the split size to 512MB which generates between 110-200MB parquet files using the default compression. We're using Spark-1.3.1, btw, and we also have the same partitioning of year/month/day for our parquet files.

HTH,
Deng

On Thu, Oct 8, 2015 at 8:25 AM, Younes Naguib <Yo...@tritondigital.com>> wrote:
Well, I only have data for 2015-08. So, in the end, only 31 partitions....
What I'm looking for, is some reasonably sized partitions.
In any case, just the idea of controlling the output parquet files size or number would be nice.

Younes Naguib Streaming Division
Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
Tel.: +1 514 448 4037 x2688<tel:%2B1%20514%20448%204037%20x2688> | Tel.: +1 866 448 4037 x2688<tel:%2B1%20866%20448%204037%20x2688> | younes.naguib@tritondigital.com <ma...@streamtheworld.com>
________________________________
From: Cheng Lian [lian.cs.zju@gmail.com<ma...@gmail.com>]
Sent: Wednesday, October 07, 2015 7:01 PM

To: Younes Naguib; 'user@spark.apache.org<ma...@spark.apache.org>'
Subject: Re: Parquet file size

The reason why so many small files are generated should probably be the fact that you are inserting into a partitioned table with three partition columns.

If you want a large Parquet files, you may try to either avoid using partitioned table, or using less partition columns (e.g., only year, without month and day).

Cheng

So you want to dump all data into a single large Parquet file?

On 10/7/15 1:55 PM, Younes Naguib wrote:
The TSV original files is 600GB and generated 40k files of 15-25MB.

y

From: Cheng Lian [mailto:lian.cs.zju@gmail.com]
Sent: October-07-15 3:18 PM
To: Younes Naguib; 'user@spark.apache.org<ma...@spark.apache.org>'
Subject: Re: Parquet file size

Why do you want larger files? Doesn't the result Parquet file contain all the data in the original TSV file?

Cheng
On 10/7/15 11:07 AM, Younes Naguib wrote:
Hi,

I’m reading a large tsv file, and creating parquet files using sparksql:
insert overwrite
table tbl partition(year, month, day)....
Select .... from tbl_tsv;

This works nicely, but generates small parquet files (15MB).
I wanted to generate larger files, any idea how to address this?

Thanks,
Younes Naguib
Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
Tel.: +1 514 448 4037 x2688<tel:%2B1%20514%20448%204037%20x2688> | Tel.: +1 866 448 4037 x2688<tel:%2B1%20866%20448%204037%20x2688> | younes.naguib@tritondigital.com <ma...@streamtheworld.com>



Re: Parquet file size

Posted by Deng Ching-Mallete <oc...@apache.org>.
Hi,

In our case, we're using
the org.apache.hadoop.mapreduce.lib.input.FileInputFormat.SPLIT_MINSIZE to
increase the size of the RDD partitions when loading text files, so it
would generate larger parquet files. We just set it in the Hadoop conf of
the SparkContext. You need to be careful though about setting it to a large
value, as you might encounter issues related to this:

https://issues.apache.org/jira/browse/SPARK-6235

For our jobs, we're setting the split size to 512MB which generates between
110-200MB parquet files using the default compression. We're using
Spark-1.3.1, btw, and we also have the same partitioning of year/month/day
for our parquet files.

HTH,
Deng

On Thu, Oct 8, 2015 at 8:25 AM, Younes Naguib <
Younes.Naguib@tritondigital.com> wrote:

> Well, I only have data for 2015-08. So, in the end, only 31 partitions....
> What I'm looking for, is some reasonably sized partitions.
> In any case, just the idea of controlling the output parquet files size or
> number would be nice.
>
> *Younes Naguib* *Streaming Division*
>
> Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
>
> Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | younes.naguib
> @tritondigital.com <yo...@streamtheworld.com>
> ------------------------------
> *From:* Cheng Lian [lian.cs.zju@gmail.com]
> *Sent:* Wednesday, October 07, 2015 7:01 PM
>
> *To:* Younes Naguib; 'user@spark.apache.org'
> *Subject:* Re: Parquet file size
>
> The reason why so many small files are generated should probably be the
> fact that you are inserting into a partitioned table with three partition
> columns.
>
> If you want a large Parquet files, you may try to either avoid using
> partitioned table, or using less partition columns (e.g., only year,
> without month and day).
>
> Cheng
>
> So you want to dump all data into a single large Parquet file?
>
> On 10/7/15 1:55 PM, Younes Naguib wrote:
>
> The TSV original files is 600GB and generated 40k files of 15-25MB.
>
>
>
> y
>
>
>
> *From:* Cheng Lian [mailto:lian.cs.zju@gmail.com <li...@gmail.com>]
> *Sent:* October-07-15 3:18 PM
> *To:* Younes Naguib; 'user@spark.apache.org'
> *Subject:* Re: Parquet file size
>
>
>
> Why do you want larger files? Doesn't the result Parquet file contain all
> the data in the original TSV file?
>
> Cheng
>
> On 10/7/15 11:07 AM, Younes Naguib wrote:
>
> Hi,
>
>
>
> I’m reading a large tsv file, and creating parquet files using sparksql:
>
> insert overwrite
>
> table tbl partition(year, month, day)....
>
> Select .... from tbl_tsv;
>
>
>
> This works nicely, but generates small parquet files (15MB).
>
> I wanted to generate larger files, any idea how to address this?
>
>
>
> *Thanks,*
>
> *Younes Naguib*
>
> Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
>
> Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | younes.naguib
> @tritondigital.com <yo...@streamtheworld.com>
>
>
>

RE: Parquet file size

Posted by Younes Naguib <Yo...@tritondigital.com>.
Well, I only have data for 2015-08. So, in the end, only 31 partitions....
What I'm looking for, is some reasonably sized partitions.
In any case, just the idea of controlling the output parquet files size or number would be nice.

Younes Naguib Streaming Division
Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | younes.naguib@tritondigital.com <ma...@streamtheworld.com>
________________________________
From: Cheng Lian [lian.cs.zju@gmail.com]
Sent: Wednesday, October 07, 2015 7:01 PM
To: Younes Naguib; 'user@spark.apache.org'
Subject: Re: Parquet file size

The reason why so many small files are generated should probably be the fact that you are inserting into a partitioned table with three partition columns.

If you want a large Parquet files, you may try to either avoid using partitioned table, or using less partition columns (e.g., only year, without month and day).

Cheng

So you want to dump all data into a single large Parquet file?

On 10/7/15 1:55 PM, Younes Naguib wrote:
The TSV original files is 600GB and generated 40k files of 15-25MB.

y

From: Cheng Lian [mailto:lian.cs.zju@gmail.com]
Sent: October-07-15 3:18 PM
To: Younes Naguib; 'user@spark.apache.org<ma...@spark.apache.org>'
Subject: Re: Parquet file size

Why do you want larger files? Doesn't the result Parquet file contain all the data in the original TSV file?

Cheng
On 10/7/15 11:07 AM, Younes Naguib wrote:
Hi,

I’m reading a large tsv file, and creating parquet files using sparksql:
insert overwrite
table tbl partition(year, month, day)....
Select .... from tbl_tsv;

This works nicely, but generates small parquet files (15MB).
I wanted to generate larger files, any idea how to address this?

Thanks,
Younes Naguib
Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | younes.naguib@tritondigital.com <ma...@streamtheworld.com>




Re: Parquet file size

Posted by Cheng Lian <li...@gmail.com>.
The reason why so many small files are generated should probably be the 
fact that you are inserting into a partitioned table with three 
partition columns.

If you want a large Parquet files, you may try to either avoid using 
partitioned table, or using less partition columns (e.g., only year, 
without month and day).

Cheng

So you want to dump all data into a single large Parquet file?

On 10/7/15 1:55 PM, Younes Naguib wrote:
>
> The TSV original files is 600GB and generated 40k files of 15-25MB.
>
> y
>
> *From:*Cheng Lian [mailto:lian.cs.zju@gmail.com]
> *Sent:* October-07-15 3:18 PM
> *To:* Younes Naguib; 'user@spark.apache.org'
> *Subject:* Re: Parquet file size
>
> Why do you want larger files? Doesn't the result Parquet file contain 
> all the data in the original TSV file?
>
> Cheng
>
> On 10/7/15 11:07 AM, Younes Naguib wrote:
>
>     Hi,
>
>     I’m reading a large tsv file, and creating parquet files using
>     sparksql:
>
>     insert overwrite
>
>     table tbl partition(year, month, day)....
>
>     Select .... from tbl_tsv;
>
>     This works nicely, but generates small parquet files (15MB).
>
>     I wanted to generate larger files, any idea how to address this?
>
>     *Thanks,*
>
>     *Younes Naguib*
>
>     Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC 
>     H3G 1R8
>
>     Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 |
>     younes.naguib@tritondigital.com<ma...@streamtheworld.com>
>


RE: Parquet file size

Posted by Younes Naguib <Yo...@tritondigital.com>.
The TSV original files is 600GB and generated 40k files of 15-25MB.

y

From: Cheng Lian [mailto:lian.cs.zju@gmail.com]
Sent: October-07-15 3:18 PM
To: Younes Naguib; 'user@spark.apache.org'
Subject: Re: Parquet file size

Why do you want larger files? Doesn't the result Parquet file contain all the data in the original TSV file?

Cheng
On 10/7/15 11:07 AM, Younes Naguib wrote:
Hi,

I'm reading a large tsv file, and creating parquet files using sparksql:
insert overwrite
table tbl partition(year, month, day)....
Select .... from tbl_tsv;

This works nicely, but generates small parquet files (15MB).
I wanted to generate larger files, any idea how to address this?

Thanks,
Younes Naguib
Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | younes.naguib@tritondigital.com <ma...@streamtheworld.com>



Re: Parquet file size

Posted by Cheng Lian <li...@gmail.com>.
Why do you want larger files? Doesn't the result Parquet file contain 
all the data in the original TSV file?

Cheng

On 10/7/15 11:07 AM, Younes Naguib wrote:
>
> Hi,
>
> I’m reading a large tsv file, and creating parquet files using sparksql:
>
> insert overwrite
>
> table tbl partition(year, month, day)....
>
> Select .... from tbl_tsv;
>
> This works nicely, but generates small parquet files (15MB).
>
> I wanted to generate larger files, any idea how to address this?
>
> *Thanks,*
>
> *Younes Naguib***
>
> Triton Digital | 1440 Ste-Catherine W., Suite 1200 | Montreal, QC  H3G 1R8
>
> Tel.: +1 514 448 4037 x2688 | Tel.: +1 866 448 4037 x2688 | 
> younes.naguib@tritondigital.com<ma...@streamtheworld.com>
>