zhuqi-lucas commented on code in PR #19064:
URL: https://github.com/apache/datafusion/pull/19064#discussion_r2614434991
##########
datafusion/datasource-parquet/src/opener.rs:
##########
@@ -434,10 +436,90 @@ impl FileOpener for ParquetOpener {
}
let row_group_indexes = access_plan.row_group_indexes();
- if let Some(row_selection) =
- access_plan.into_overall_row_selection(rg_metadata)?
- {
- builder = builder.with_row_selection(row_selection);
+
+ // Extract row selection before potentially reversing
+ let row_selection_opt =
+ access_plan.into_overall_row_selection(rg_metadata)?;
+
+ if reverse_scan_inexact {
+ // Reverse the row groups
+ let reversed_indexes: Vec<_> =
+ row_group_indexes.clone().into_iter().rev().collect();
+
+ // If we have a row selection, we need to rebuild it for the
reversed order
+ if let Some(row_selection) = row_selection_opt {
+ // Build a mapping of row group index to its row range in
the file
+ let mut rg_row_ranges: Vec<(usize, usize, usize)> =
Vec::new(); // (rg_index, start_row, end_row)
Review Comment:
Addressed in latest PR, thanks!
##########
datafusion/datasource-parquet/src/opener.rs:
##########
@@ -434,10 +436,90 @@ impl FileOpener for ParquetOpener {
}
let row_group_indexes = access_plan.row_group_indexes();
- if let Some(row_selection) =
- access_plan.into_overall_row_selection(rg_metadata)?
- {
- builder = builder.with_row_selection(row_selection);
+
+ // Extract row selection before potentially reversing
+ let row_selection_opt =
Review Comment:
Addressed in latest PR, thanks!
##########
datafusion/datasource-parquet/src/source.rs:
##########
@@ -490,6 +497,15 @@ impl ParquetSource {
)),
}
}
+
+ pub fn with_reverse_scan_inexact(mut self, reverse_scan_inexact: bool) ->
Self {
+ self.reverse_scan_inexact = reverse_scan_inexact;
+ self
+ }
+
+ pub fn reverse_scan_inexact(&self) -> bool {
+ self.reverse_scan_inexact
+ }
Review Comment:
Addressed in latest PR, thanks!
--
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]