Skip to content

Commit

Permalink
enable VACUUM logging by-default
Browse files Browse the repository at this point in the history
  • Loading branch information
xupengli-db committed Mar 8, 2024
1 parent a1fe112 commit aa966ea
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,9 @@ object VacuumCommand extends VacuumCommandImpl with Serializable {

trait VacuumCommandImpl extends DeltaCommand {

private val supportedFsForLogging = Seq(
"wasbs", "wasbss", "abfs", "abfss", "adl", "gs", "file", "hdfs"
)

/**
* Returns whether we should record vacuum metrics in the delta log.
* Logging is enabled by default.
*/
private def shouldLogVacuum(
spark: SparkSession,
Expand All @@ -412,19 +409,7 @@ trait VacuumCommandImpl extends DeltaCommand {
if (logVacuumConf.nonEmpty) {
return logVacuumConf.get
}

val logStore = deltaLog.store

try {
val rawResolvedUri: URI = logStore.resolvePathOnPhysicalStorage(path, hadoopConf).toUri
val scheme = rawResolvedUri.getScheme
supportedFsForLogging.contains(scheme)
} catch {
case _: UnsupportedOperationException =>
logWarning("Vacuum event logging" +
" not enabled on this file system because we cannot detect your cloud storage type.")
false
}
true
}

/**
Expand Down

0 comments on commit aa966ea

Please sign in to comment.