Skip to content

Conversation

@jonathanc-n
Copy link
Contributor

Which issue does this PR close?

What changes are included in this PR?

Adds PROPERTY_WRITE_FANOUT_ENABLED to TableProperties

I made it write.fanout.enabled instead of write.fanout-enabled in case there is anything we want configurable with FanoutWriter in the future.

Are these changes tested?

Yes by existing tests.

@jonathanc-n
Copy link
Contributor Author

cc @CTTY

Copy link
Collaborator

@CTTY CTTY left a 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";
Copy link
Collaborator

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,
)?,
Copy link
Collaborator

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,
Copy link
Collaborator

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

Copy link
Contributor Author

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make fanout/clustered mode configurable for datafusion write

2 participants