Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvarya-db committed Dec 12, 2024
1 parent f6099c3 commit 07c5d49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,13 @@ class Snapshot(
.orElse(Option.when(_computedStateTriggered)(domainMetadata)),
numDeletedRecordsOpt = checksumOpt.flatMap(_.numDeletedRecordsOpt)
.orElse(Option.when(_computedStateTriggered)(numDeletedRecordsOpt).flatten)
.filter(_ => deletionVectorMetricsEnabled),
.filter(_ => deletionVectorsReadableAndMetricsEnabled),
numDeletionVectorsOpt = checksumOpt.flatMap(_.numDeletionVectorsOpt)
.orElse(Option.when(_computedStateTriggered)(numDeletionVectorsOpt).flatten)
.filter(_ => deletionVectorMetricsEnabled),
.filter(_ => deletionVectorsReadableAndMetricsEnabled),
deletedRecordCountsHistogramOpt = checksumOpt.flatMap(_.deletedRecordCountsHistogramOpt)
.orElse(Option.when(_computedStateTriggered)(deletedRecordCountsHistogramOpt).flatten)
.filter(_ => deletionVectorMetricsEnabled && deletionVectorHistogramEnabled),
.filter(_ => deletionVectorsReadableAndHistogramEnabled),
histogramOpt = checksumOpt.flatMap(_.histogramOpt)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,17 @@ trait SnapshotStateManager extends DeltaLogging { self: Snapshot =>
def deletedRecordCountsHistogramOpt: Option[DeletedRecordCountsHistogram] =
computedState.deletedRecordCountsHistogramOpt

protected def deletionVectorMetricsEnabled: Boolean = {
protected def deletionVectorsReadableAndMetricsEnabled: Boolean = {
val checksumDVMetricsEnabled =
spark.sessionState.conf.getConf(DeltaSQLConf.DELTA_CHECKSUM_DV_METRICS_ENABLED)
val dvsReadable = DeletionVectorUtils.deletionVectorsReadable(snapshotToScan)
checksumDVMetricsEnabled && dvsReadable
}

protected def deletionVectorHistogramEnabled: Boolean = {
protected def deletionVectorsReadableAndHistogramEnabled: Boolean = {
val deletedRecordCountsHistogramEnabled =
spark.sessionState.conf.getConf(DeltaSQLConf.DELTA_DELETED_RECORD_COUNTS_HISTOGRAM_ENABLED)
deletionVectorMetricsEnabled && deletedRecordCountsHistogramEnabled
deletionVectorsReadableAndMetricsEnabled && deletedRecordCountsHistogramEnabled
}

/** Generate a default SnapshotState of a new table given the table metadata and the protocol. */
Expand Down

0 comments on commit 07c5d49

Please sign in to comment.