-
Notifications
You must be signed in to change notification settings - Fork 352
feat: Make FanoutWriter writer configurable
#1872
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
base: main
Are you sure you want to change the base?
feat: Make FanoutWriter writer configurable
#1872
Conversation
|
cc @CTTY |
CTTY
left a comment
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.
Thanks for working on this! I've left some minor comments
|
|
||
| /// Whether to use `FanoutWriter` for partitioned tables (handles unsorted data). | ||
| /// If false, uses `ClusteredWriter` (requires sorted data, more memory efficient). | ||
| pub const PROPERTY_WRITE_FANOUT_ENABLED: &str = "write.fanout.enabled"; |
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.
I think write.datafusion.fanout.enabled will be a better property name since Java has
public static final String SPARK_WRITE_PARTITIONED_FANOUT_ENABLED = "write.spark.fanout.enabled";| props, | ||
| TableProperties::PROPERTY_WRITE_TARGET_FILE_SIZE_BYTES, | ||
| TableProperties::PROPERTY_WRITE_TARGET_FILE_SIZE_BYTES_DEFAULT, | ||
| )?, |
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.
Should we add the new property here as well?
| /// The default format for files. | ||
| pub write_format_default: String, | ||
| /// The target file size for files. | ||
| pub write_target_file_size_bytes: usize, |
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.
We need to add the property here as well
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.
I was thinking about this, I think whether or not to place it in the TableProperty struct is currently a bit inconsistent. write_format_default and write_target_file_size_bytes don't seem to be called by table_property.<property> and are manually parsed in write.rs. I'm not sure why they are parsed differently, but should we standardize one way to do it?
The different ways are currently calling try_from or parsing the way it is done in this pull request.
Which issue does this PR close?
What changes are included in this PR?
Adds
PROPERTY_WRITE_FANOUT_ENABLEDtoTablePropertiesI made it
write.fanout.enabledinstead ofwrite.fanout-enabledin case there is anything we want configurable withFanoutWriterin the future.Are these changes tested?
Yes by existing tests.