Skip to content

fix(spark): Handle ResolvedIdentifier in DropTableVisitor (#2544)#4316

Merged
mobuchowski merged 1 commit intomainfrom
mobuchowski/fix-droptable-visitor-2544
Feb 5, 2026
Merged

fix(spark): Handle ResolvedIdentifier in DropTableVisitor (#2544)#4316
mobuchowski merged 1 commit intomainfrom
mobuchowski/fix-droptable-visitor-2544

Conversation

@mobuchowski
Copy link
Member

AI description:

When users run DROP TABLE commands on Databricks Runtime 14.2+, OpenLineage throws a ClassCastException because DropTableVisitor assumes the child of a DropTable node is always a ResolvedTable. However, newer Spark versions (3.4+) and Databricks runtimes wrap table references in ResolvedIdentifier, causing the visitor to fail and preventing lineage extraction for drop operations.

This fix adds handling for ResolvedIdentifier alongside the existing ResolvedTable support. When ResolvedIdentifier is detected (via reflection to maintain backwards compatibility with older Spark versions), the visitor extracts the underlying ResolvedTable from the identifier before processing. This allows DROP TABLE lineage to work correctly across all supported Spark and Databricks versions.

On Databricks 14.2+ and Spark 3.4+, DropTable.child() returns a
ResolvedIdentifier instead of a ResolvedTable, causing a
ClassCastException. This change adds reflection-based support to handle
both types, enabling DROP TABLE lineage tracking on newer Spark versions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mobuchowski mobuchowski requested a review from a team as a code owner February 2, 2026 15:00
@boring-cyborg boring-cyborg bot added area:integration/spark area:tests Testing code language:java Uses Java programming language labels Feb 2, 2026
@pawel-big-lebowski
Copy link
Collaborator

@mobuchowski: for those type of issues, running full Spark tests is recommended to cover several Spark versions

@pawel-big-lebowski pawel-big-lebowski added the full-tests Run full tests label Feb 3, 2026
@mobuchowski
Copy link
Member Author

@pawel-big-lebowski it's 🟢

@mobuchowski mobuchowski merged commit 92858cf into main Feb 5, 2026
42 checks passed
@mobuchowski mobuchowski deleted the mobuchowski/fix-droptable-visitor-2544 branch February 5, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integration/spark area:tests Testing code full-tests Run full tests language:java Uses Java programming language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants