You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to save a large dataset with many groups each having 20M rows and currently it takes too much time. I think it would improve overall speed if appending a group would be 'pipelined' by separating into 2 steps:
preparing data to write
appending to the file
Current parquet-dotnet implementation already uses 2 separate memory streams while saving content of the column (DataColumnWriter.WriteColumnAsync):
copy data from column array into memory stream
copy memory stream into byte array and compress into another byte array
append compressed byte array to the parquet "file"
Whole process could be 'pipelined':
application starts a thread that prepares serialized compressed data and metadata for columns
application starts another thread that appends prepared column data to the parquet file:
Something like (BlockingCollection is an overkill here ofcourse):
using(varextendedGroupWriter=parquetWriter.CreateExtendedGroupWriter(...)){varqueue=newBlockingCollection();varprepareTask=Task.Factory.StartNew(()=>{foreach(varpartitioninGetLargePartitionedDataSet()){varpreparedgroup=extendedGroupWriter.StartGroupPreparation()// serializing and compressing data for field1.Append(field1,partition.Select(...))// serializing and compressing data for field2.Append(field2,partition.Select(...))// serializing and compressing data for field3.Append(field3,partition.Select(...)).PrepareGroupData();queue.Add(preparedGroup);}queue.CompleteAdding();});varwriteTask=Task.Factory.StartNew(()=>{while(!queue.IsCompleted){usingvarpreparedGroup=queue.Take(cancellationToken);parquetWriter.WritePreparedGroup(preparedGroup);}});awaitwriteTask;}
Or serialization and compression could be separate steps and compression could be done directly into the target stead, without using extra memory stream.
These same approach could be used on the column level:
first thread prepares data for the column
second thread appends column data as soon as it is ready
The text was updated successfully, but these errors were encountered:
Issue description
I have to save a large dataset with many groups each having 20M rows and currently it takes too much time. I think it would improve overall speed if appending a group would be 'pipelined' by separating into 2 steps:
Current parquet-dotnet implementation already uses 2 separate memory streams while saving content of the column (DataColumnWriter.WriteColumnAsync):
Whole process could be 'pipelined':
Something like (BlockingCollection is an overkill here ofcourse):
Or serialization and compression could be separate steps and compression could be done directly into the target stead, without using extra memory stream.
These same approach could be used on the column level:
The text was updated successfully, but these errors were encountered: