anoopj commented on code in PR #17541:
URL: https://github.com/apache/iceberg/pull/17541#discussion_r4106696519


##########
core/src/test/java/org/apache/iceberg/TestFilePlanner.java:
##########
@@ -0,0 +1,677 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import static org.apache.iceberg.types.Types.NestedField.optional;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.tuple;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.function.UnaryOperator;
+import org.apache.iceberg.expressions.Expressions;
+import org.apache.iceberg.inmemory.InMemoryFileIO;
+import org.apache.iceberg.io.CloseableIterable;
+import org.apache.iceberg.io.FileAppender;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import org.apache.iceberg.metrics.DefaultMetricsContext;
+import org.apache.iceberg.metrics.ScanMetrics;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
+import org.apache.iceberg.transforms.Transforms;
+import org.apache.iceberg.types.Types;
+import org.apache.iceberg.util.LocationUtil;
+import org.apache.iceberg.util.ThreadPools;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.FieldSource;
+
+class TestFilePlanner {

Review Comment:
   I iterated with Claude a few times. 
   
   ### FilePlanner (`TestFilePlanner`)
   
   | Behavior | Test |
   |---|---|
   | Direct-data root -> one task per file, no deletes | 
`rootWithDirectDataEntries` |
   | Leaf-manifest-only root -> leaves expanded; root + each leaf counted 
scanned | `rootWithLeafManifestEntriesOnly` |
   | Mixed direct-data + leaf-manifest | `mixedRootDataAndLeafManifest` |
   | Co-located DV attached as a POSITION_DELETES DeleteFile with correct 
fields | `deletionVectorAttachedToTask` |
   | Residual handling | `residualAttachedFromFilter` |
   | Same-spec files share schema/spec/residual. Note that this is testing the 
internals of the class (caching), but I think we need coverage here | 
`sameSpecFilesShareContext` |
   | Lazy leaves: construct + close the plan without iterating scans only the 
root | `buildingAndClosingWithoutIteratingDoesNotScanLeaves` |
   | Parallel leaf expansion yields all files | 
`parallelLeafExpansionYieldsAllFiles` |
   | DELETE_MANIFEST in root (negative test) | 
`deleteContentInRootIsUnsupported` |
   | Non-DATA entry in a leaf (negative test) | 
`nonDataEntryInLeafFailsPlanning` |
   | Empty root -> no tasks | `emptyRootYieldsNoTasks` |
   | Multi-spec: union partition, per-spec pruning + residual, partition 
re-projected | `planFilesAcrossMultipleSpecs` |
   | Scan metrics: result/total data & delete counts and sizes, DV counter, and 
co-located DVs are not counted as indexed delete files | 
`planFilesReportsScanMetrics` |
   | Filter forwarded into an opened leaf; matching file survives | 
`filterAppliesToLeafManifestFiles` |
   | Leaf-manifest ref pruned by its stats is skipped and never opened | 
`prunedLeafManifestIsNotExpanded` |



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