Skip to content

Spark: Remove deprecated and unused methods in SparkRead/WriteConf and SparkSchemaUtil - #17626

Open
dramaticlly wants to merge 2 commits into
apache:mainfrom
dramaticlly:1.12deprecation-spark-schemautil-confs
Open

Spark: Remove deprecated and unused methods in SparkRead/WriteConf and SparkSchemaUtil#17626
dramaticlly wants to merge 2 commits into
apache:mainfrom
dramaticlly:1.12deprecation-spark-schemautil-confs

Conversation

@dramaticlly

@dramaticlly dramaticlly commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Deprecated method in SparkTableUtil will follow up together with position-delete follow up

Note, #14308 only include the deprecation for latest spark 4.1 and it was later copied over to spark 4.0. I also included the same unused class in spark 3.5 (although not marked as deprecated in iceberg 1.11 release) considering to keep them in sync.

AI Disclosure

Model: Claude Opus 5 (1M context)
Platform/Tool: Claude Code
Human Oversight: reviewed
Prompt Summary: split #16449 into smaller self-contained PRs; verify each group compiles and tests green standalone

- SparkSchemaUtil.convertWithFreshIds(Schema, StructType) and
  prune(Schema, StructType, List<Expression>) in Spark 4.0 and 4.1
- SparkReadConf/SparkWriteConf constructors taking an unused branch
  argument in Spark 4.1

Spark 3.5 is unaffected: these overloads were never deprecated there.
apache#14308 deprecated SparkSchemaUtil.convertWithFreshIds(Schema, StructType)
and prune(Schema, StructType, List<Expression>) for 1.12.0 removal, but
only touched spark/v4.0; Spark 4.1 inherited the annotations via the later
4.0<->4.1 directory move. Spark 3.5 was never updated, so the same two
methods remain there without @deprecated.

Removing them alongside 4.0 and 4.1 rather than leaving 3.5 out of sync for
the release. Both are unused: every caller across all three versions uses
convertWithFreshIds(schema, sparkType, caseSensitive) and
prune(schema, requestedType, filter, caseSensitive) or prune(schema,
requestedType). There are no references in main, test or jmh sources.

Note this removes public methods that carried no @deprecated in 3.5.
@github-actions github-actions Bot added the spark label Aug 12, 2026
@dramaticlly

Copy link
Copy Markdown
Contributor Author

@ebyhr @huaxingao do you want to take a look?

@huaxingao

Copy link
Copy Markdown
Contributor

4.0/4.1 look good since those were deprecated in 1.11 for 1.12 removal. But I'm a bit concerned about 3.5 because removing them now is a breaking change for anyone still calling them on 3.5. Could we deprecate them in 3.5 this release and remove them in a later one?

* @return a Schema corresponding to the Spark projection
* @throws IllegalArgumentException if the Spark type does not match the Schema
*/
public static Schema prune(Schema schema, StructType requestedType, List<Expression> filters) {

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.

These are not deprecated in 3.5?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants