alamb commented on code in PR #27876:
URL: https://github.com/apache/datafusion/pull/27876#discussion_r4763369080
##########
datafusion/core/tests/parquet/struct_field_pruning.rs:
##########
@@ -0,0 +1,98 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: See the NOTICE file distributed with this work for
additional information regarding copyright ownership
+// SPDX-FileContributor: Licensed to the Apache Software Foundation (ASF)
under one or more contributor license agreements
+
+//! Pruning on struct fields, for files that SQL cannot write.
+
+use std::io::Write;
+use std::sync::Arc;
+
+use arrow::array::{ArrayRef, Int64Array, RecordBatch, StructArray};
+use arrow::datatypes::{DataType, Field, Fields, Schema};
+use datafusion::prelude::{ParquetReadOptions, SessionContext};
+use datafusion_common::ScalarValue;
+use parquet::arrow::ArrowWriter;
+use parquet::file::metadata::{ParquetMetaData, ParquetMetaDataWriter};
+use parquet::file::statistics::Statistics;
+use parquet::file::writer::TrackedWrite;
+use tempfile::NamedTempFile;
+
+/// Writes `s: {a: Int64}` with rows `{a: 1}` and `{a: null}` in one row
+/// group. The footer keeps the min and max of `s.a`, but not its null count.
+fn struct_file_without_null_count() -> NamedTempFile {
Review Comment:
what is the purpose of hand constructing a file without null statistics?
It might be easier to understand if the test wrote a file with null
statistics and then updated the statistics and rewrite the file (not sure if
this is possible with the parquet API today)
##########
datafusion/core/tests/parquet/struct_field_pruning.rs:
##########
@@ -0,0 +1,98 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: See the NOTICE file distributed with this work for
additional information regarding copyright ownership
+// SPDX-FileContributor: Licensed to the Apache Software Foundation (ASF)
under one or more contributor license agreements
+
+//! Pruning on struct fields, for files that SQL cannot write.
+
+use std::io::Write;
+use std::sync::Arc;
+
+use arrow::array::{ArrayRef, Int64Array, RecordBatch, StructArray};
+use arrow::datatypes::{DataType, Field, Fields, Schema};
+use datafusion::prelude::{ParquetReadOptions, SessionContext};
+use datafusion_common::ScalarValue;
+use parquet::arrow::ArrowWriter;
+use parquet::file::metadata::{ParquetMetaData, ParquetMetaDataWriter};
+use parquet::file::statistics::Statistics;
+use parquet::file::writer::TrackedWrite;
+use tempfile::NamedTempFile;
+
+/// Writes `s: {a: Int64}` with rows `{a: 1}` and `{a: null}` in one row
+/// group. The footer keeps the min and max of `s.a`, but not its null count.
+fn struct_file_without_null_count() -> NamedTempFile {
Review Comment:
Also in theory we could add this setup file to the slt harness runner (or
check it in) so that the tests could be entirely .slt
--
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]