aviralgarg05 commented on code in PR #19890:
URL: https://github.com/apache/datafusion/pull/19890#discussion_r2711941955
##########
datafusion/core/tests/parquet/page_pruning.rs:
##########
@@ -961,3 +964,56 @@ fn cast_count_metric(metric: MetricValue) -> Option<usize>
{
_ => None,
}
}
+
+#[tokio::test]
+async fn test_parquet_opener_without_page_index() {
+ // Defines a simple schema and batch
+ let schema = Arc::new(Schema::new(vec![Field::new("a", DataType::Int32,
true)]));
+ let batch = RecordBatch::try_new(
+ schema.clone(),
+ vec![Arc::new(Int32Array::from(vec![1, 2, 3]))],
+ )
+ .unwrap();
+
+ // Create a temp file
+ let file = tempfile::Builder::new()
+ .suffix(".parquet")
+ .tempfile()
+ .unwrap();
+ let path = file.path().to_str().unwrap().to_string();
+
+ // Write parquet WITHOUT page index
+ let props = WriterProperties::builder().build();
+
+ let file_fs = std::fs::File::create(&path).unwrap();
Review Comment:
Good catch! I've refactored the test to use `tempfile::tempdir()` to manage
the file lifecycle. This allows us to create the file once and let the
directory handle cleanup, avoiding the need to reopen the file or manage the
ownership of `NamedTempFile` manually.
--
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]