Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-49991][SQL] Make HadoopMapReduceCommitProtocol respect 'mapreduce.output.basename' to generate file names #48494

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Oct 16, 2024

What changes were proposed in this pull request?

In 'HadoopMapReduceCommitProtocol', task output files are generated ahead instead of calling org.apache.hadoop.mapreduce.lib.output.FileOutputFormat#getDefaultWorkFile, which uses the mapreduce.output.basename as the prefix of output files.
In this pull request, we modify the HadoopMapReduceCommitProtocol.getFilename method to also look up this config instead of using the hardcoded 'part'.

Why are the changes needed?

Given a custom file name is a useful feature for users. They can use it to distinguish files added by different engines, on different days, etc. We can also align the usage scenario with other SQL on Hadoop engines for better Hadoop compatibility.

Does this PR introduce any user-facing change?

Yes, a Hadoop configuration 'mapreduce.output.basename' can be used in file datasource output files

How was this patch tested?

new tests

Was this patch authored or co-authored using generative AI tooling?

no`

@yaooqinn
Copy link
Member Author

cc @cloud-fan @dongjoon-hyun, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant