From 975d6fb49e99148eafea9f4f42a8a5f29e1c4785 Mon Sep 17 00:00:00 2001 From: ritchie Date: Sun, 22 Oct 2023 19:50:20 +0200 Subject: [PATCH] fix row count --- .../src/physical_plan/executors/scan/parquet.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/polars-lazy/src/physical_plan/executors/scan/parquet.rs b/crates/polars-lazy/src/physical_plan/executors/scan/parquet.rs index bd1c52606ef9..78ecc0a0e3dc 100644 --- a/crates/polars-lazy/src/physical_plan/executors/scan/parquet.rs +++ b/crates/polars-lazy/src/physical_plan/executors/scan/parquet.rs @@ -80,7 +80,7 @@ impl ParquetExec { &self.predicate, &mut self.file_options.with_columns.clone(), &mut self.file_info.schema.clone(), - self.file_options.row_count.is_some(), + base_row_count.is_some(), hive_partitions.as_deref(), ); @@ -138,9 +138,8 @@ impl ParquetExec { .collect::>>() })?; - let n_read = - remaining_rows_to_read.saturating_sub(out.iter().map(|df| df.height()).sum()); - remaining_rows_to_read = n_read; + let n_read = out.iter().map(|df| df.height()).sum(); + remaining_rows_to_read = remaining_rows_to_read.saturating_sub(n_read); if let Some(rc) = &mut base_row_count { rc.offset += n_read as IdxSize; }