Delta Kernel¶
Delta Kernel is a Java API (abstractions) for working with delta tables, getting their snapshots and creating scan objects to scan a subset of the data in the tables.
libraryDependencies += "io.delta" % "delta-kernel-api" % "3.2.1"
libraryDependencies += "io.delta" % "delta-kernel-defaults" % "3.2.1"
libraryDependencies += "org.apache.hadoop" % "hadoop-client-api" % "3.3.4"
libraryDependencies += "org.apache.hadoop" % "hadoop-client-runtime" % "3.3.4"
Table.forPath utility is used to create a delta table. A required Engine can be created using DefaultEngine.create utility.
import org.apache.hadoop.conf.Configuration
val hadoopConf = new Configuration(false)
import io.delta.kernel.defaults.engine.DefaultEngine
val engine = DefaultEngine.create(hadoopConf)
val dataPath = "/tmp/delta-table"
import io.delta.kernel.Table
val deltaTable = Table.forPath(engine, dataPath)
assert(deltaTable.getPath(engine) == s"file:${dataPath}")