Skip to content

Commit

Permalink
code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
c27kwan committed Jul 5, 2024
1 parent 30e26c8 commit a21913f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.apache.spark.sql.delta.commands

import scala.collection.mutable

// scalastyle:off import.ordering.noEmptyLine
import org.apache.spark.sql.delta._
import org.apache.spark.sql.delta.actions._
Expand Down Expand Up @@ -263,7 +265,7 @@ case class WriteIntoDelta(
var dataWithDefaultExprs = data
// Add identity columns if they are not in `data`.
// Column names for which we will track identity column high water marks.
val trackHighWaterMarks = scala.collection.mutable.Set[String]()
val trackHighWaterMarks = mutable.Set.empty[String]
val topLevelOutputNames = CaseInsensitiveMap(data.schema.map(f => f.name -> f).toMap)
val selectExprs = txn.metadata.schema.map { f =>
if (ColumnWithDefaultExprUtils.isIdentityColumn(f) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.apache.spark.sql.delta.stats.{
DeltaJobStatisticsTracker,
StatisticsCollection
}
import org.apache.spark.sql.util.ScalaExtensions._
import org.apache.hadoop.fs.Path

import org.apache.spark.sql.{DataFrame, Dataset, SparkSession}
Expand Down Expand Up @@ -466,8 +467,7 @@ trait TransactionalWrite extends DeltaLogging { self: OptimisticTransactionImpl
bucketSpec = None,
statsTrackers = optionalStatsTracker.toSeq
++ statsTrackers
++ identityTrackerOpt.toSeq
,
++ identityTrackerOpt.toSeq,
options = options)
} catch {
case InnerInvariantViolationException(violationException) =>
Expand Down Expand Up @@ -514,7 +514,7 @@ trait TransactionalWrite extends DeltaLogging { self: OptimisticTransactionImpl

if (resultFiles.nonEmpty && !isOptimize) registerPostCommitHook(AutoCompact)
// Record the updated high water marks to be used during transaction commit.
identityTrackerOpt.foreach { tracker =>
identityTrackerOpt.ifDefined { tracker =>
updatedIdentityHighWaterMarks.appendAll(tracker.highWaterMarks.toSeq)
}

Expand Down

0 comments on commit a21913f

Please sign in to comment.