Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spark] Add more tests checking the preservedRowTracking tag #2953

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

longvu-db
Copy link
Contributor

@longvu-db longvu-db commented Apr 23, 2024

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

Add more tests checking the behavior of the preservedRowTracking tag in specific commands like Merge/Update/Delete/Optimize/Remove Column Mapping, we introduced Preserving Row Tracking for these commands in previous PRs, which include adding the preservedRowTracking tag.

How was this patch tested?

Added UTs.

Does this PR introduce any user-facing changes?

No.

@longvu-db longvu-db force-pushed the stack/move-preserve-tag-to-commit branch from c3d1656 to 44c6dc3 Compare April 23, 2024 15:55
@longvu-db longvu-db changed the title [Spark] Adding Preserving Row Tracking tag for all commands if Row Tracking is Enabled [Spark] Always add Preserving Row Tracking tag if Row Tracking is Enabled Apr 23, 2024
@longvu-db longvu-db changed the title [Spark] Always add Preserving Row Tracking tag if Row Tracking is Enabled [Spark] Always add Preserving Row Tracking tag for all commands if Row Tracking is Enabled Apr 23, 2024
@longvu-db longvu-db changed the title [Spark] Always add Preserving Row Tracking tag for all commands if Row Tracking is Enabled [Spark] Always add the PreservedRowTracking tag for all commands if Row Tracking is Enabled Apr 23, 2024
@longvu-db longvu-db changed the title [Spark] Always add the PreservedRowTracking tag for all commands if Row Tracking is Enabled [Spark] Set preservedRowTracking tag on CommitInfo Apr 23, 2024
@longvu-db longvu-db force-pushed the stack/move-preserve-tag-to-commit branch from 44c6dc3 to 66230a9 Compare April 23, 2024 21:08
@longvu-db longvu-db closed this Apr 23, 2024
@longvu-db longvu-db force-pushed the stack/move-preserve-tag-to-commit branch from 66230a9 to 83b4719 Compare April 23, 2024 23:11
@longvu-db longvu-db reopened this Apr 23, 2024
@longvu-db longvu-db force-pushed the stack/move-preserve-tag-to-commit branch from f697735 to 1bf0b0f Compare April 24, 2024 11:04
Comment on lines 1111 to 1113
val allTags = RowTracking.addPreservedRowTrackingTagIfNotSet(
protocol, metadata, tags)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Blindly tagging all commits as preserving row tracking is pretty brittle: there may be a case (now or introduced in the future) that doesn't preserve row tracking and there's virtually no chance that we detect it and correctly mark row tracking information as not preserved.

We could instead add tags to the most relevant code paths to explicitly mark that row tracking is preserved, at least in inserts (WriteIntoDelta, InsertOnlyMergeExecutor) so that most data ingestion operations are covered

We should in any case have a test somewhere that checks that the preserved row tracking tag is set to true for inserts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, let's think more about it, but for now let's keep the Preserving tests in the commands that we preserved Row Tracking (that I forgot to add in the previous Delta PRs).

@longvu-db longvu-db force-pushed the stack/move-preserve-tag-to-commit branch from 1bf0b0f to a6eac93 Compare April 24, 2024 11:55
@longvu-db longvu-db changed the title [Spark] Set preservedRowTracking tag on CommitInfo [Spark] Add tests checking the preservedRowTracking tag in Merge/Update/Delete/Optimize/Remove Column Mapping Apr 24, 2024
@longvu-db longvu-db changed the title [Spark] Add tests checking the preservedRowTracking tag in Merge/Update/Delete/Optimize/Remove Column Mapping [Spark] Add more tests checking the preservedRowTracking tag Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants