File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
kernel-spark/src/main/java/io/delta/kernel/spark/catalog Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2121import io .delta .kernel .Snapshot ;
2222import io .delta .kernel .spark .read .SparkScanBuilder ;
2323import io .delta .kernel .spark .snapshot .DeltaSnapshotManager ;
24- import io .delta .kernel .spark .snapshot .PathBasedSnapshotManager ;
24+ import io .delta .kernel .spark .snapshot .DeltaSnapshotManagerFactory ;
2525import io .delta .kernel .spark .utils .SchemaUtils ;
2626import java .util .*;
2727import org .apache .hadoop .conf .Configuration ;
@@ -141,7 +141,11 @@ private SparkTable(
141141
142142 this .hadoopConf =
143143 SparkSession .active ().sessionState ().newHadoopConfWithOptions (toScalaMap (options ));
144- this .snapshotManager = new PathBasedSnapshotManager (tablePath , hadoopConf );
144+ this .snapshotManager =
145+ catalogTable .isPresent ()
146+ ? DeltaSnapshotManagerFactory .fromCatalogTable (
147+ catalogTable .get (), SparkSession .active (), hadoopConf )
148+ : DeltaSnapshotManagerFactory .fromPath (tablePath , hadoopConf );
145149 // Load the initial snapshot through the manager
146150 this .initialSnapshot = snapshotManager .loadLatestSnapshot ();
147151 this .schema = SchemaUtils .convertKernelSchemaToSparkSchema (initialSnapshot .getSchema ());
You can’t perform that action at this time.
0 commit comments