Skip to content

Commit

Permalink
[Kernel] Add Backward Compatibility for KernelSnapshotDelegator
Browse files Browse the repository at this point in the history
  • Loading branch information
EstherBear committed May 28, 2024
1 parent e116b58 commit b5dcde8
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@

package io.delta.standalone.internal

import io.delta.kernel.defaults.engine.DefaultEngine
import io.delta.kernel.engine.Engine
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.Path

import io.delta.kernel.internal.{SnapshotImpl => SnapshotImplKernel}
import io.delta.standalone.DeltaScan
import io.delta.standalone.actions.{AddFile => AddFileJ, Metadata => MetadataJ}
Expand Down Expand Up @@ -63,6 +65,18 @@ class KernelSnapshotDelegator(
engine: Engine)
extends SnapshotImpl(hadoopConf, path, -1, LogSegment.empty(path), -1, standaloneDeltaLog, -1) {

// For backward compatibility
def this(
kernelSnapshot: SnapshotImplKernel,
kernelSnapshotWrapper: KernelSnapshotWrapper,
hadoopConf: Configuration,
path: Path,
version: Long,
kernelDeltaLog: KernelDeltaLogDelegator,
standaloneDeltaLog: DeltaLogImpl) =
this(kernelSnapshot, kernelSnapshotWrapper, hadoopConf, path, version, kernelDeltaLog,
standaloneDeltaLog, DefaultEngine.create(hadoopConf))

lazy val standaloneSnapshot: SnapshotImpl = standaloneDeltaLog.getSnapshotForVersionAsOf(getVersion())

/**
Expand Down

0 comments on commit b5dcde8

Please sign in to comment.