FelixYBW commented on issue #11397:
URL: 
https://github.com/apache/incubator-gluten/issues/11397#issuecomment-3791921574

   So if we follow Spark's way, we need to remove rule 
RemoveNativeWriteFilesSortAndProject, then in valox we write partition one by 
one. Close previous writer when a new writer is open.
   
   There are 3 solutions here:
   
   - Follow Spark's way
   - Manually repartition data before write like 
`df.repartition(tbl_filenum[tbl]['part_cnt'], 
tbl_filenum[tbl]['part']).write.mode("overwrite").format("parquet").option("compression",
 "zstd").partitionBy(tbl_filenum[tbl]['part']).option('fs.s3a.committer.name', 
'magic').save(f"s3a://presto-workload/{databasename}/{tbl}")`. Each partition 
write a parquet file. It's the ideal case but if data is biased, we wll get a 
large partition as below:
   
       <img width="546" height="116" alt="Image" 
src="https://github.com/user-attachments/assets/cb48b8c0-3e7c-4035-9a81-bd902875db03";
 />
   - Add a `RebalanceByColumn(part columns)` before writer as  @wForget shared 
in https://github.com/apache/incubator-gluten/issues/7656. It's something 
similar to add a `repartition(partitionnum, tbl_filenum[tbl]['part'])` 
automatically


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to