gene-bordegaray commented on code in PR #24500:
URL: https://github.com/apache/datafusion/pull/24500#discussion_r3822798957
##########
datafusion/sqllogictest/src/test_context/range_partitioning.rs:
##########
Review Comment:
the new `register_time_bin_listing_table` is very similar to this function.
Could we deduplicate the boilerplate a bit to make this cleaner / better
pattern for future tests. We could have this function accept a vec of record
batches insted of the iterator and an optional sort order
```rust
fn register_parquet_listing_table(
ctx: &SessionContext,
name: &str,
table_dir: impl AsRef<Path>,
schema: SchemaRef,
partitions: impl IntoIterator<Item = &'static [(i32, i32, i32)]>,
batches: Vec<RecordBatch>,
output_partitioning: Partitioning,
file_sort_order: Option<Vec<Vec<SortExpr>>>,
) {
...
let mut options = ListingOptions::new(Arc::new(ParquetFormat::default()))
.with_output_partitioning(Some(output_partitioning));
if let Some(file_sort_order) = file_sort_order {
options = options.with_file_sort_order(file_sort_order);
}
```
--
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]