terbed commented on code in PR #65:
URL: https://github.com/apache/datafusion-iceberg/pull/65#discussion_r4329684391


##########
crates/datafusion/src/test_utils/harness.rs:
##########
@@ -177,3 +208,135 @@ impl Storage for FixtureStorage {
         Ok(OutputFile::new(Arc::new(self.clone()), path.to_string()))
     }
 }
+
+#[cfg(test)]
+struct CountingFileRead {
+    reader: Box<dyn FileRead>,
+    bytes: Arc<AtomicU64>,
+}
+
+#[cfg(test)]
+#[async_trait]
+impl FileRead for CountingFileRead {
+    async fn read(&self, range: Range<u64>) -> IcebergResult<Bytes> {
+        let bytes = self.reader.read(range).await?;
+        self.bytes.fetch_add(bytes.len() as u64, Ordering::Relaxed);
+        Ok(bytes)
+    }
+}
+
+#[cfg(test)]
+impl IcebergTestHarness {
+    pub(crate) fn context(&self) -> &SessionContext {
+        &self.ctx
+    }
+
+    pub(crate) fn take_parquet_read_bytes(&self) -> u64 {
+        self.parquet_read_bytes.swap(0, Ordering::Relaxed)
+    }
+
+    pub(crate) async fn with_parquet(
+        schema: iceberg::spec::Schema,
+        batch: &datafusion::arrow::array::RecordBatch,
+        properties: parquet::file::properties::WriterProperties,
+        catalog_backed: bool,
+    ) -> Result<(Self, tempfile::TempDir)> {

Review Comment:
   The simplest approach would be to prove correctness with taxi but not 
necessarily prove that enabled page indexing reduce read bytes (that opens the 
scope quite significantly). 



-- 
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]

Reply via email to