[Spark] Add RowTrackingBackfillCommand#3449
Merged
tdas merged 5 commits intodelta-io:masterfrom Aug 2, 2024
Merged
Conversation
johanl-db
reviewed
Jul 31, 2024
...c/test/scala/org/apache/spark/sql/delta/rowtracking/RowTrackingConflictResolutionSuite.scala
Outdated
Show resolved
Hide resolved
johanl-db
reviewed
Jul 31, 2024
Comment on lines
+55
to
+69
| def recordBackfillBatchStats(txnId: String, wasSuccessful: Boolean): Unit = { | ||
| if (wasSuccessful) { | ||
| numSuccessfulBatch.incrementAndGet() | ||
| } else { | ||
| numFailedBatch.incrementAndGet() | ||
| } | ||
| val totalExecutionTimeInMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTimeNs) | ||
| val batchStats = BackfillBatchStats( | ||
| origTxn.txnId, txnId, batchId, filesInBatch.size, totalExecutionTimeInMs, wasSuccessful) | ||
| recordDeltaEvent( | ||
| origTxn.deltaLog, | ||
| opType = backfillBatchStatsOpType, | ||
| data = batchStats | ||
| ) | ||
| } |
Collaborator
There was a problem hiding this comment.
nit: define as a private method in BackfillBatch and add a comment for better readability
Contributor
Author
There was a problem hiding this comment.
@johanl-db I'm not sure if it is more readable since
- It is separate from the function, so I will have to look back and forth.
- I will have to pass
origTxn,startTimeMs,batchId,numSuccessfulBatch,numFailedBatchas arguments.
spark/src/main/scala/org/apache/spark/sql/delta/commands/backfill/BackfillExecutor.scala
Outdated
Show resolved
Hide resolved
Comment on lines
+92
to
+93
| val mayInterruptIfRunning = false | ||
| futures.foreach(_.cancel(mayInterruptIfRunning)) |
Collaborator
There was a problem hiding this comment.
Suggested change
| val mayInterruptIfRunning = false | |
| futures.foreach(_.cancel(mayInterruptIfRunning)) | |
| futures.foreach(_.cancel(mayInterruptIfRunning = false)) |
Contributor
Author
There was a problem hiding this comment.
@johanl-db This actually doesn't work because cancel is from Java Future so we don't have the Scala's syntactic sugar.
johanl-db
reviewed
Jul 31, 2024
Collaborator
johanl-db
left a comment
There was a problem hiding this comment.
Looks good, some minor comments
johanl-db
approved these changes
Aug 1, 2024
…ow-tracking-backfill-command
tdas
approved these changes
Aug 1, 2024
8 tasks
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.
Which Delta project/connector is this regarding?
Description
Adding the RowTrackingBackfillCommand, the ability to assign row IDs to table rows after the table creation.
How was this patch tested?
Added UTs.
Does this PR introduce any user-facing changes?
No.