-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
SqlToS3Operator: feat/ add max_rows_per_file parameter #37055
SqlToS3Operator: feat/ add max_rows_per_file parameter #37055
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
LGTM |
I reverse-quoted a grouby_keywords as spellchecking did not like it, hopefully it will get green and I will be able to merge it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you explicitly fail if both parameters are specified, you could potentially simplify this statement:
if self.max_rows_per_file and not self.groupby_kwargs:
But I'll leave that up to you :)
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Yeah. Thought about that too, but now it is very explicit as well. |
Description
SqlToS3Operator
create an S3 object from the output of a sql qurey. Unless you specify a groupby_kwargs parameter, the entire data will be written in one object. This could results on data pipeline issues especially when output files are consumed by limited resources workers (like Kubernetes pods).So I suggest adding a new paramter,
max_rows_per_file
, to limit the size of destination files and dispatch output data into multiple files.Use case/motivation
I faced a lot of out-of-memory issues when trying to process SqlToS3Operator destination object. With such a feature, output will be standardized and next compute worker can easily has an adequate size and a predictable run time.
Code of Conduct
I agree to follow this project's Code of Conduct