fix(spark): Handle ResolvedIdentifier in DropTableVisitor (#2544)#4316
Merged
mobuchowski merged 1 commit intomainfrom Feb 5, 2026
Merged
fix(spark): Handle ResolvedIdentifier in DropTableVisitor (#2544)#4316mobuchowski merged 1 commit intomainfrom
mobuchowski merged 1 commit intomainfrom
Conversation
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>
Collaborator
|
@mobuchowski: for those type of issues, running full Spark tests is recommended to cover several Spark versions |
Member
Author
|
@pawel-big-lebowski it's 🟢 |
pawel-big-lebowski
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.