kosiew commented on code in PR #27241:
URL: https://github.com/apache/datafusion/pull/27241#discussion_r4766816191
##########
datafusion/proto-models/src/from_proto.rs:
##########
@@ -345,6 +345,15 @@ impl TryFrom<&ParquetOptionsProto> for ParquetOptions {
};
let to_usize =
|value: u64, field: &str| usize_from_wire(value, "ParquetOptions",
field);
+ let maximum_buffered_record_batches_per_stream =
+ if proto.maximum_buffered_record_batches_per_stream == 0 {
Review Comment:
Could we document in both decoders that the non-optional proto3 field cannot
distinguish omission from explicit zero? Both therefore resolve to the default
capacity.
##########
datafusion/common/src/config.rs:
##########
@@ -1573,7 +1573,7 @@ config_namespace! {
/// Boosting these values is likely worthwhile when
/// writing out already in-memory data, such as from a cached
/// data frame.
- pub maximum_buffered_record_batches_per_stream: usize, default = 2
+ pub maximum_buffered_record_batches_per_stream: ConfigNonZeroUsize,
default = non_zero_usize_default(2)
Review Comment:
This breaks Rust source compatibility even for valid capacities. Please
document the break in the PR description, and add a 57.0.0 upgrade note
covering `ConfigNonZeroUsize::try_new(n)?` and `.get()`, or retain `usize` with
configuration and pre-write validation.
##########
datafusion/datasource-parquet/src/file_format.rs:
##########
@@ -851,7 +851,7 @@ impl From<&ParquetFormatFactory> for
protobuf::TableParquetOptions {
}),
allow_single_file_parallelism:
global_options.global.allow_single_file_parallelism,
maximum_parallel_row_group_writers:
global_options.global.maximum_parallel_row_group_writers as u64,
- maximum_buffered_record_batches_per_stream:
global_options.global.maximum_buffered_record_batches_per_stream as u64,
+ maximum_buffered_record_batches_per_stream:
global_options.global.maximum_buffered_record_batches_per_stream.get() as u64,
Review Comment:
Could we extend `roundtrip_default_codec_parquet` to set capacity to `4` and
assert that the decoded factory preserves it? Existing protobuf tests do not
exercise this separate factory encoder.
--
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]