Uh oh!
There was an error while loading. Please reload this page.
(WIP) Making compression ratio dynamically calculated based on bytes written - #347
(WIP) Making compression ratio dynamically calculated based on bytes written#347n3nash wants to merge 1 commit into
Conversation
n3nash
commented
Mar 14, 2018
@vinothchandar I would like to have a quick discussion on this before you take a pass. |
There was a problem hiding this comment.
type change here, probably do a rebase?
b30eef8 to
f04879eCompareThere was a problem hiding this comment.
Doing this helps to call fs.getBytesWritten(file) even after the stream is closed and gives back an exact number of uncompressed bytes written. @vinothchandar
There was a problem hiding this comment.
stream is closed implies that the file (block i think) is fully written?
There was a problem hiding this comment.
Yes, and so the wrappedStream has the correct number of bytes to return..
f04879e to
1437afbCompareThere was a problem hiding this comment.
We can make the DEFAULT be calculated based on maxFileSize.
1437afb to
1cfd36dCompare1cfd36d to
7483160Compareovj
commented
Mar 14, 2018
@n3nash Can we check in the underlying OutputStream (by adding wrapper) to see how much is getting written. This will help us to correctly throttle file size. |
n3nash
commented
Mar 16, 2018
@ovj this code actually already does that, the change is just to make sure we can get bytes before the stream is closed. |
vinothchandar
left a comment
There was a problem hiding this comment.
High level: we can go with two approaches
A) Just care about the compressed_size_per_record, based on commit metadata previously
B) Get uncompressed and compressed sizes and determine the compression ratio.. (This PR)
Neither really tackles the case when there is no history/commits to get a sense of the record size.. (correct me if I am missing sth)
I am actually leaning more on doubling down on A (which is what the partitioner uses to pack data today). Is that grossly inaccurate in sizing partitions?
Also can you confirm this has been set..
// Config to control whether we control insert split sizes automatically based on average record sizes
public static final String COPY_ON_WRITE_TABLE_AUTO_SPLIT_INSERTS = "hoodie.copyonwrite.insert.auto.split";
// its off by default
public static final String DEFAULT_COPY_ON_WRITE_TABLE_AUTO_SPLIT_INSERTS = String.valueOf(false);
| writeStatus.getStat().setNumWrites(recordsWritten); | ||
| writeStatus.getStat().setNumDeletes(recordsDeleted); | ||
| // an estimate of the number of bytes written | ||
| writeStatus.getStat().setTotalUncompressedWriteBytes(recordsWritten*averageRecordSize); |
There was a problem hiding this comment.
really like to understand how your IDE is setup :).. how come it missed formatting the space between * in this diff, while it changed it everywhere in the other..
we really need to do #287
There was a problem hiding this comment.
stream is closed implies that the file (block i think) is fully written?
| new HoodieParquetConfig(writeSupport, CompressionCodecName.GZIP, | ||
| config.getParquetBlockSize(), config.getParquetPageSize(), | ||
| config.getParquetMaxFileSize(), hoodieTable.getHadoopConf()); | ||
| config.getParquetMaxFileSize(), hoodieTable.getHadoopConf(), compressionRatioPerRecord(hoodieTable)); |
There was a problem hiding this comment.
this will be opened in each executor?
@vinothchandar I see few ways to pass information of number of records needed in a partition to create handle :
I personally like 1 over 2 and am not in favor of 3. But I also want to explore the addition of the metric (this PR) which makes things simpler. |
vinothchandar
commented
Mar 23, 2018
Option #4 (lmk what you think)
|
n3nash
commented
Mar 23, 2018
I'm fine with this approach too. Ideally, I was looking for something that requires less refactor and can be a quick way to fix this compression issue so I can spend time starting to run a dataset end to end, tune the compaction process and move towards running this in prod, hence this PR and my suggested approaches.. |
vinothchandar
commented
Mar 23, 2018
Understand where you are coming from. Unfortunately this is not straightforward. If thats your stated short term goal, I suggest just introduce a config for compression ratio, set it as desired and move on.. |
n3nash
commented
Mar 23, 2018
Yeah, let me do that for now. Once I start to run some datasets and am able to do validations, I can spend time on this again. |
vinothchandar
commented
Mar 29, 2018
closing for now , keeping the issue open |
No description provided.