-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fddc6c3
commit 043975d
Showing
8 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
title: Delta Kernel | ||
nav: | ||
- index.md | ||
- ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# DefaultEngine | ||
|
||
`DefaultEngine` is...FIXME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Engine | ||
|
||
`Engine` is an [abstraction](#contract) of [Delta Engines](#implementations) that combine (_encapsulate_) together all the necessary delta clients to work with delta tables. | ||
|
||
## Implementations | ||
|
||
* [DefaultEngine](DefaultEngine.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# FileSystemClient | ||
|
||
`FileSystemClient` is...FIXME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Table | ||
|
||
`Table` is an [abstraction](#contract) of [delta tables](#implementations). | ||
|
||
## Contract (Subset) | ||
|
||
### Checkpoint | ||
|
||
```java | ||
checkpoint( | ||
Engine engine, | ||
long version) | ||
``` | ||
|
||
Checkpoints the delta table (at the given version) | ||
|
||
## Implementations | ||
|
||
* [TableImpl](TableImpl.md) | ||
|
||
## Create Delta Table for Path { #forPath } | ||
|
||
```java | ||
Table forPath( | ||
Engine engine, | ||
String path) | ||
``` | ||
|
||
`forPath` creates a [TableImpl](TableImpl.md#forPath) for the given [Engine](Engine.md) and the `path`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# TableImpl | ||
|
||
`TableImpl` is a [Table](Table.md) that can be created using [Table.forPath](Table.md#forPath) utility. | ||
|
||
!!! note | ||
There is no configuration property to change the default implementation of [Table](Table.md) abstraction at the moment. | ||
|
||
## Creating Instance | ||
|
||
`TableImpl` takes the following to be created: | ||
|
||
* <span id="tablePath"> Table path | ||
|
||
`TableImpl` is created using [TableImpl.forPath](#forPath) utility. | ||
|
||
## Create Delta Table for Path { #forPath } | ||
|
||
```java | ||
Table forPath( | ||
Engine engine, | ||
String path) | ||
``` | ||
|
||
`forPath` requests the given [Engine](Engine.md) for the [getFileSystemClient](Engine.md#getFileSystemClient) to [resolvePath](FileSystemClient.md#resolvePath). | ||
|
||
In the end, `forPath` creates a [TableImpl](TableImpl.md) with the path resolved. | ||
|
||
--- | ||
|
||
`forPath` is used when: | ||
|
||
* [Table.forPath](Table.md#forPath) utility is used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 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. | ||
|
||
``` text | ||
libraryDependencies += "io.delta" % "delta-kernel-api" % "{{ delta.version }}" | ||
libraryDependencies += "io.delta" % "delta-kernel-defaults" % "{{ delta.version }}" | ||
libraryDependencies += "org.apache.hadoop" % "hadoop-client-api" % "{{ hadoop.version }}" | ||
libraryDependencies += "org.apache.hadoop" % "hadoop-client-runtime" % "{{ hadoop.version }}" | ||
``` | ||
|
||
[Table.forPath](Table.md#forPath) utility is used to create a delta table. A required [Engine](Engine.md) can be created using [DefaultEngine.create](DefaultEngine.md#create) utility. | ||
|
||
```scala | ||
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}") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters