Skip to content

fix: keep rows from imported Iceberg files by not pushing range and IN residuals on name-mapped tables - #7233

Open
andygrove wants to merge 25 commits into
apache:mainfrom
andygrove:fix-7138-name-mapping
Open

andygrove wants to merge 25 commits into
apache:mainfrom
andygrove:fix-7138-name-mapping

Conversation

@andygrove

@andygrove andygrove commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Which issue does this PR close?

Part of #7138.

Based on #7156, which should merge first. Until then, the diff includes its changes. The change specific to this PR is the last commit.

Rationale for this change

A data file can store a narrower type than its table column, such as INT data in a BIGINT column or TINYINT data in an INT column. iceberg-rust skips all pages of such a file for range and IN predicates, and its row filter narrows the literal to the file's type, so an out-of-range value becomes NULL. The filter above the scan cannot restore the dropped rows.

#7156 guards the promotions that the schema history records. Files imported by add_files, migrate or snapshot are not checked against the schema, so the history records nothing for them and they still lose rows.

What changes are included in this PR?

Those three procedures set schema.name-mapping.default. For a table that has one, treat every INT, BIGINT, DOUBLE, DECIMAL and TIMESTAMP_NTZ column as promoted. Only null checks and equality outside NOT are pushed for those columns, which is the rule #7156 applies to recorded promotions. Range and IN predicates stay with the filter above the scan.

Tables with a name mapping and no imported files lose range pruning on those columns. That is the cost of not dropping rows silently.

An equality delete takes the same lossy comparison, because iceberg-rust turns each delete row into a filter on the key column. When a key column is in that set, the scan falls back to Spark.

Still open under #7138: promotions made before Iceberg 0.12, and files imported into a table without a name mapping. The Iceberg guide documents both.

How are these changes tested?

New test residuals on tables with a name mapping keep rows from imported files in CometIcebergNativeSuite. It appends a Parquet file that stores INT, TINYINT and FLOAT to a table with BIGINT, INT and DOUBLE columns, adds a name mapping the way add_files does, and compares ten range, IN and equality predicates with Spark. It also checks that id = 2 AND t = 2 still pushes. The test fails with the guard disabled.

New test equality delete keyed on a promoted column falls back to Spark promotes INT to BIGINT, commits an equality delete of 3000000000, and checks the answer against Spark and that the scan falls back. It fails with the fallback disabled.

Spark 4.1 / JDK 17, with #7156 at aeeb1b0 merged: CometIcebergNativeSuite, CometIcebergNativeScanSuite and CometFuzzIcebergSuite passed (198 passed, 2 version cancellations). Other Spark profiles were not run locally.

rich7420 and others added 5 commits October 22, 2026 13:43
Decline FLOAT and DOUBLE range comparisons and zero or NaN literals.
Spark treats -0.0 as equal to 0.0 and sorts every NaN above all
numbers, while iceberg-rust compares by IEEE 754 total order, and its
row-group pruning trusts statistics that can omit NaN
(apache/iceberg-rust#3494).

Decline equality under NOT on nullable columns. Iceberg passes `<=>`
as `=`, so the native reader dropped NULL rows that Spark keeps for
`NOT (id <=> 1)`.

On columns whose type changed in the schema history, push only
equality outside NOT and null checks, since iceberg-rust compares
older, narrower files incorrectly (apache/iceberg-rust#3122). An
incomplete history treats every BIGINT, DOUBLE and DECIMAL column as
promoted.

Closes apache#7136. Closes apache#7137. Part of apache#7138.
Spark rewrites `b = false` on a nullable boolean as `b IS NOT NULL AND
NOT b`, which Iceberg passes as `not_null(b) AND not(b = true)`. Declining
equality under NOT on a nullable column left that residual unpushed, so
CometFuzzIcebergSuite found no residual for its boolean column.

A NULL value fails a NOT_NULL conjunct, and with it the whole AND, in
Spark and in the native reader alike. Treat a column checked that way as
non-nullable within the AND, so the null-safe concern no longer applies.
…cans

Extract referencedColumn so the residual converter and notNullColumns share
the bare-reference check. Share the residual predicate loop of the new native
tests, and assert that `id != 1` and `b = false` are still pushed while
`NOT (id <=> 1)` and `b IS NOT TRUE` are not.

CometFuzzIcebergSuite samples its equality literal from the data. Skip zero
as well as NaN, since floating-point comparisons with zero are no longer
pushed.

Note in the Iceberg guide that `!=` is not affected by the negated-equality
rule.
@github-actions github-actions Bot added bug Something isn't working area:scan Parquet scan / data reading area:Iceberg labels Oct 26, 2026
…is incomplete

Iceberg format v3 allows promoting a date column to timestamp or
timestamp_ns. When snapshot expiration has removed older schemas, such
a column can still have data files that store dates, so treat it as
promoted, as long, double and decimal columns already are.

Add a VERSION AS OF read to the promoted-column regression test. Iceberg
cannot plan a filter on a dropped column, so the test drops id and adds
it back as a new INT column first. Only the snapshot's schema then shows
that the id this read filters on was promoted. Correct the code comment
that said the scan schema covers a dropped column.

The Iceberg guide now lists DECIMAL and TIMESTAMP_NTZ in the
incomplete-history rule, says the native scan does not prune row groups
for these predicates, and links apache#7588, which tracks restoring FLOAT
and DOUBLE range pruning.

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guard is conservative, and it matches what I traced in iceberg-rust at the pinned revision. The row filter casts the literal down to the file type. IN combines the per-literal results with the non-Kleene or, so one literal that becomes NULL drops every row. INT32 and FLOAT page bounds on long and double fields cannot be compared with the literal, so the page index skips those pages. The last commit conflicts with the current head of #7156 (e1afd07) in iceberg.md and in the comment above promotedColumns in CometIcebergNativeScan.scala, so it needs a rebase.

Comment on lines +1268 to +1279
def narrowableColumns(schema: Any): Set[String] = {
import scala.jdk.CollectionConverters._
getMethod(schema.getClass, "columns")
.invoke(schema)
.asInstanceOf[java.util.List[_]]
.asScala
.filter { column =>
Set("int", "long", "double").contains(
getMethod(column.getClass, "type").invoke(column).toString)
}
.map(fieldName)
.toSet

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

narrowableColumns walks columns and reads each type the same way promotedColumns does, but it keeps a separate type list. The latest commit on #7156 (e1afd07) adds timestamp and timestamp_ns to the promotable list in promotedColumns, so the two lists already differ after the rebase. Could this become a parameter of promotedColumns, for example filesMayBeNarrower: Boolean? It would add int to the promotable types and treat them as !historyComplete does. That keeps one list and also stops building Set("int", "long", "double") once per column. Decimal columns would join the set too. That is harmless, because pageIndexUnsupportedColumns already keeps every decimal residual out of the scan.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. narrowableColumns is gone. promotedColumns now takes filesMayBeNarrower, which adds int to the promotable types and treats them as !historyComplete does. The set of types is built once per call. I added a unit test for the new flag.

Comment on lines +1089 to +1101
// Columns whose type changed over the table's history; residual predicates comparing them
// with a literal are dropped, except equality. The scan schema also covers a column that
// VERSION AS OF reads after it was dropped from the table.
// add_files, migrate and snapshot import files without checking their types against the
// schema, so the history records nothing for them, but they set a name mapping. A table with
// one is treated as if every column that can hold a narrower type were promoted.
val schemas = Seq(metadata.tableSchema, metadata.scanSchema)
val recordedPromotions =
schemas.flatMap(IcebergReflection.promotedColumns(metadata.table, _))
val importedNarrowings =
if (metadata.nameMapping.isDefined) schemas.flatMap(IcebergReflection.narrowableColumns)
else Nil
val promotedColumns = (recordedPromotions ++ importedNarrowings).toSet

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment block above still describes only the schema history, and the new block repeats the reason that the narrowableColumns scaladoc gives. Could they be merged into one comment? It would also help to say here that this is a workaround for apache/iceberg-rust#3122. apache/iceberg-rust#3540 (row filter) and apache/iceberg-rust#3507 (page index) are open, and once the pin includes both, this guard and the one for recorded promotions can be removed. Until then, IN lookups on BIGINT keys of migrated tables lose row group pruning in the native scan, which is a common pattern.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged the two comments into one. It now names apache/iceberg-rust#3122, says the guard can go once the pin includes #3540 and #3507, and notes that IN lookups on BIGINT keys of migrated tables lose row group pruning until then.

Comment on lines +4483 to +4501
icebergTable
.updateProperties()
.set(
org.apache.iceberg.TableProperties.DEFAULT_NAME_MAPPING,
org.apache.iceberg.mapping.NameMappingParser
.toJson(org.apache.iceberg.mapping.MappingUtil.create(icebergTable.schema())))
.commit()
val file = new File(source).listFiles().find(_.getName.endsWith(".parquet")).get
icebergTable
.newAppend()
.appendFile(
org.apache.iceberg.DataFiles
.builder(icebergTable.spec())
.withPath(file.getAbsolutePath)
.withFileSizeInBytes(file.length())
.withRecordCount(3L)
.withFormat(org.apache.iceberg.FileFormat.PARQUET)
.build())
.commit()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guard depends on add_files, migrate and snapshot setting schema.name-mapping.default, but the test sets the mapping itself. Would SparkActions.get().snapshotTable(...), as used in migration - nested name mapping falls back to Spark, work with a source Parquet table declared as id BIGINT, t INT, d DOUBLE over this file? Then the test would also catch Iceberg no longer setting the mapping. I have not tried whether the import accepts the type mismatch.

@andygrove andygrove Nov 15, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. The test now builds a Parquet source table declared as id BIGINT, t INT, d DOUBLE over a file that stores INT, TINYINT and FLOAT, and imports it with snapshotTable. The import accepts the mismatch. The test asserts that the table has the name mapping and a single schema. With the guard forced off, the test fails.

"id IN (1, 2)",
"t < 200",
"t IN (1, 200)",
"d > 0.5D",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d > 0.5D never reaches the native scan because of the FLOAT/DOUBLE range rule, whether or not the table has a name mapping, so it passes with this guard disabled. Is it there for when #7588 restores range pruning on DOUBLE? If so, a short comment would say so. Otherwise d IN (1.0D, 2.0D) is the case that exercises d.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. d > 0.5D was not covered by this guard, so I removed it and added a comment saying d is covered by IN only.

… mapping

Files imported by add_files, migrate and snapshot can store a narrower type
than their column, which the schema history does not record. iceberg-rust
skips their pages for range and IN predicates and narrows the literal to the
file type, so matching rows are dropped before the post-scan filter runs.
Those procedures set a name mapping, so treat every INT, BIGINT and DOUBLE
column of such a table as promoted: only null checks and equality outside
NOT are pushed.

Part of apache#7138.
@andygrove
andygrove force-pushed the fix-7138-name-mapping branch from 911c315 to 2f6f4a1 Compare November 15, 2026 20:01
@andygrove
andygrove marked this pull request as ready for review November 15, 2026 20:05
andygrove and others added 3 commits November 22, 2026 07:25
# Conflicts:
#	spark/src/test/scala/org/apache/comet/serde/operator/CometIcebergNativeScanSuite.scala
apache#7491 moved residual pool entries from the common block into each
partition, so the null-safe equality test read zero residuals from
commonData even when the predicate was pushed. Count them with
IcebergScanPlanData.distinctResiduals, as CometFuzzIcebergSuite does.

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The four points from my last review are addressed in code. Two things need another pass. The new test still reads the residual count from commonData, which is empty since #7491 (inline), and the branch conflicts again with the head of #7156 (d5bf49ecd6) in iceberg.md and in the comment above promotedColumns, because that PR now says "= under NOT" and "equality outside NOT" in both places. Rebasing also brings in its distinctResiduals fix for the inherited null-safe test at line 5034, and the fork run on this head failed the Spark 4.1, JDK 17 [scans] job that runs CometIcebergNativeSuite, which I expect is these two assertions but could not confirm from the log.

Comment on lines +5109 to +5110
val common = OperatorOuterClass.IcebergScanCommon.parseFrom(scans.head.commonData)
assert(common.getResidualPoolCount == 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since #7491, which this branch now includes, the common block ships no residual pool entries, so getResidualPoolCount is 0 here even when the residual is pushed, and the assertion fails. assert(distinctResiduals(scans.head).size == 1) counts the per-partition pools, as d5bf49ecd6 on #7156 does for the null-safe test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5d09d65. The assertion is now assert(distinctResiduals(scans.head).size == 1), which counts the per-partition pools as #7156 does.

Comment on lines +136 to +138
`DOUBLE`, `DECIMAL` and `TIMESTAMP_NTZ` column when expiring snapshots removed older schemas,
and to every `INT`, `BIGINT` and `DOUBLE` column of a table with a
`schema.name-mapping.default` property, which `add_files`, `migrate` and `snapshot` set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With filesMayBeNarrower, assumeNarrower also returns every timestamp, timestamp_ns and decimal(...) column, so a table with a name mapping loses range and IN pushdown on TIMESTAMP_NTZ columns too. This bullet and the PR description list only INT, BIGINT and DOUBLE. Could both name the incomplete-history types plus INT? A timestamp column in the new unit test for the flag would also pin that behavior.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, assumeNarrower also returns decimal(...) and timestamp columns. The bullet now lists INT, BIGINT, DOUBLE, DECIMAL and TIMESTAMP_NTZ, and I updated the PR description. I extended files that may be narrower treat every column of a narrowable type as promoted with a decimal(10,2), a timestamp and a timestamptz column. It expects the first two and not the third. (b4a5d60)

Comment on lines +5100 to +5102
for (predicate <- predicates) {
checkIcebergNativeScan(s"SELECT id FROM $table WHERE $predicate")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop is checkResidualPredicates(table, predicates), the helper the other residual tests in this file use.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used the helper. (b4a5d60)

Comment on lines +5071 to +5085
val actions = Class
.forName("org.apache.iceberg.spark.actions.SparkActions")
.getMethod("get")
.invoke(null)
val snapshot = actions.getClass
.getMethod("snapshotTable", classOf[String])
.invoke(actions, sourceName)
val destination = snapshot.getClass
.getMethod("as", classOf[String])
.invoke(snapshot, table)
destination.getClass.getMethod("execute").invoke(destination)
try {
val icebergTable = Spark3Util.loadIcebergTable(spark, table)
assert(icebergTable.properties().get("schema.name-mapping.default") != null)
assert(icebergTable.schemas().size() == 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reflective snapshotTable call and the two assertions after it repeat lines 2698 to 2712 of migration - nested name mapping falls back to Spark almost line for line, and this is the fourth such call in the suite. A small helper that snapshots a source table into a destination and returns the loaded Iceberg table would serve both tests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added snapshotIntoIceberg(source, destination). It runs the import, loads the table and asserts the name mapping and the single schema. Both migration - nested name mapping falls back to Spark and this test use it. I left the two older snapshotTable call sites alone, since they cancel on ClassNotFoundException and are not part of this change. (b4a5d60)

@andygrove

Copy link
Copy Markdown
Member Author

Thanks @comphead. Inline replies are in each thread. The branch merges cleanly with main now, so I have not rebased onto #7156 yet.

Each AND rescanned its subtree for NOT_NULL columns. Iceberg combines
scan filters from left to right, so collecting those columns for a chain
of n conjuncts took about n^2/2 reads per file task.

The root now collects the columns once, and child ANDs reuse the map.
A chain below OR or NOT keeps the constraints it inherits and adds its
own. The collection accumulates in one pass instead of merging sets, so
its cost no longer depends on the shape of the chain. The serialized
predicate stays the same.

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the whole diff against the pinned iceberg-rust de0a6ac847. The guard matches what that revision does: try_cast_literal casts the literal down to the file's type (crates/iceberg/src/arrow/reader/predicate_visitor.rs:647-659), and the page-index IN uses !any(ge) / !any(le), which skips pages it cannot compare. The filter above the scan still applies every residual, so the cost is only native pruning. A per-table check is the cheapest stopgap, since the JVM has no per-file type information that would reveal a TINYINT file under an INT column. Two points below: the upstream fixes are now merged, and equality deletes take the same lossy path.

Comment on lines +1393 to +1395
// This workaround can go once the pin includes the iceberg-rust fixes for the row filter
// (#3540) and the page index (#3507). Until then, IN lookups on BIGINT keys of migrated tables
// lose row group pruning in the native scan.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both fixes are merged now. apache/iceberg-rust#3507 landed as 58af4edf51 on 2026-11-16, and apache/iceberg-rust#3540 landed as 90e454aa51 on 2026-11-23. Both come after iceberg-rust's Arrow 60 bump (apache/iceberg-rust#3257), so the current pin (Arrow 59.2) cannot take them. The iceberg-rust pin in #7618 (6c97391) is older than both as well. apache/iceberg-rust#3540 converts the filter columns to the table schema for each file, and it covers INT(8), UINT_32 and date to timestamp files. Once the pin reaches 90e454aa51, this guard, the schema-history guard and the two gaps that iceberg.md lists can all be removed. Could the comment name that commit and the Arrow 60 dependency, so the next pin bump knows what to remove? Also, #7712 works around the same bug by checking each file's footer, so only one of the two workarounds should land.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 6f7677c. The comment now names 90e454aa51 for the row filter (#3540) and 58af4edf51 for the page index (#3507), and says both come after iceberg-rust's Arrow 60 bump (#3257), so the pin needs that dependency first. On #7712, I agree that only one of the two workarounds should land. I'd like to settle that with its author before either merges.

Comment on lines +1020 to +1027
- **Data files that store a narrower type than their column.** Files written before a type
promotion, such as `INT` to `BIGINT`, keep the older type, and files imported by `add_files`,
`migrate` or `snapshot` can store any narrower type. iceberg-rust compares such a file with a
filter literal incorrectly, so comparisons other than `=` pushed to the native scan can drop
matching rows. Comet avoids this for promotions that the schema history records and for tables
with a name mapping, which the import procedures set, but not for promotions made before
Iceberg 0.12 or for files imported into a table without a name mapping
([#7138](https://github.com/apache/datafusion-comet/issues/7138)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Equality deletes go through the same comparison, and neither guard covers them. At the pin, iceberg-rust turns each delete row into col IS NULL OR col != v, binds it to the task schema (crates/iceberg/src/arrow/caching_delete_file_loader.rs:617-629, delete_filter.rs:231), and ANDs it into the same row filter (reader/pipeline.rs:478-544). There not_eq calls try_cast_literal (predicate_visitor.rs:520-533). Take an equality delete written after an INT to BIGINT promotion with a value above i32::MAX. When it applies to an older INT file, v becomes NULL and every non-NULL row of that file is dropped. A DOUBLE delete value such as 0.1 rounds to the FLOAT 0.1 and removes a row that Spark keeps. CometScanRule checks equality-delete keys only for nesting and type (CometScanRule.scala:1214-1257). Could this bullet list equality deletes keyed on such a column, or could CometScanRule fall back when a key is in promotedColumns? #7712 also lists this as not covered. I found this by reading the code and did not run it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I confirmed this against the code and chose the fallback. CometScanRule now declines the native scan when an equality-delete key is in the promoted-column set. That set covers the current, scan and historic schemas with the name-mapping widening, so a dropped key is covered too. The new test equality delete keyed on a promoted column falls back to Spark promotes INT to BIGINT and commits a delete of 3000000000. It matches Spark and fails with the fallback disabled. The fallback is listed under "Current limitations" in iceberg.md (28006e6).

# Conflicts:
#	docs/source/user-guide/latest/iceberg.md
#	spark/src/main/scala/org/apache/comet/serde/operator/CometIcebergNativeScan.scala
@andygrove

Copy link
Copy Markdown
Member Author

#7712 checks each data file's footer and covers the same bug for range, IN and != residuals, including files that no metadata records. If it lands first, the name-mapping residual guard here is redundant and I'll drop it. The equality-delete fallback stays, because #7712 does not cover equality deletes. That would leave this PR as the fallback and its test. Which order do you prefer, @comphead?

@sunchao sunchao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new range/IN guard and the retained equality pushdown behaved as intended in the imported-file cases. I still see a planning-cost problem in the new equality-delete guard.

// compares it with a file that still stores a narrower type incorrectly, so a key
// that may have been promoted drops rows Spark keeps (apache/iceberg-rust#3122). A
// dropped key exists only in the history, so every schema is checked.
lazy val promotedKeyColumns = (Seq(metadata.tableSchema, metadata.scanSchema) ++

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we collect promotion information once, keyed by equality field ID? Here each historical schema runs through promotedColumns, which scans history again for its columns. With 128 schemas, 100 columns and one unchanged equality key I measured about 100 ms and 4 MB of allocation for this guard alone on the driver. Unioning the resulting names also makes a new id (field 2, STRING) fall back if an older id (field 1) was promoted INT → BIGINT and then dropped. A single pass over the relevant IDs can still protect dropped keys and keep the conservative name-mapping fallback. Please cover the drop/re-add case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 78f78f8. IcebergReflection.promotedFieldIds makes one pass over the table history plus the scan and table schemas and records the types seen for each top-level field id. A field id counts as promoted if it has more than one type, or if it has a promotable type and the history is incomplete or the table has a name mapping. promotedColumns now uses it too, so there is one list of promotable types and no findField call per column per schema. CometScanRule computes the ids once, lazily, and checks promotedKeyIds.contains(fid). A dropped key still falls back, because its id stays in the history. A new id (field 2, STRING) no longer falls back when an older id (field 1) was promoted and dropped. I added a unit test for that case, a dropped column and a later one of the same name are told apart by field id, and an end-to-end test, equality delete keyed on a column that reuses the name of a promoted one is native. I did not re-run your 128-schema measurement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Iceberg area:scan Parquet scan / data reading bug Something isn't working run-iceberg-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants