Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pratyakshsharma committed Sep 28, 2023
1 parent e2f4916 commit ba81ddd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions site/docs/develop/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ tests) + Jackson's DataBinding and JAX-RS modules (any version from the last ~3+
## API

The `NessieClientBuilder` and concrete builder implementations (such as `HttpClientBuilder`) provide an easy way of configuring and building a `NessieApi`. The currently stable API that should be used
is `NessieApiV1`, which can be instantiated as shown below:
is `NessieApiV2`, which can be instantiated as shown below:


```java

import java.net.URI;
import java.util.List;
import org.projectnessie.client.api.NessieApiV1;
import org.projectnessie.client.api.NessieApiV2;
import org.projectnessie.client.NessieClientBuilder;
import org.projectnessie.model.Reference;

NessieApiV1 api = NessieClientBuilder.createClientBuilder(null, null)
.withUri(URI.create("http://localhost:19120/api/v1"))
.build(NessieApiV1.class);
NessieApiV2 api = NessieClientBuilder.createClientBuilder(null, null)
.withUri(URI.create("http://localhost:19120/api/v2"))
.build(NessieApiV2.class);

List<Reference> references = api.getAllReferences().get().getReferences();
references.stream()
Expand Down Expand Up @@ -131,8 +131,8 @@ config.getVersion();
Creates a new commit by adding metadata for an `IcebergTable` under the specified `ContentKey` instance represented by `key` and deletes content represented by `key2`

```java
ContentKey key = ContentKey.of("<table.namespace>", "<table.name>");
ContentKey key2 = ContentKey.of("<other.namespace>", "<other.name>");
ContentKey key = ContentKey.of("your-namespace", "your-table-name");
ContentKey key2 = ContentKey.of("your-namespace2", "your-table-name2");
IcebergTable icebergTable = IcebergTable.of("path1", 42L);
api.commitMultipleOperations()
.branchName(branch)
Expand All @@ -147,17 +147,17 @@ api.commitMultipleOperations()

Fetches the content for a single `ContentKey`
```java
ContentKey key = ContentKey.of("<table.namespace>", "<table.name>");
ContentKey key = ContentKey.of("your-namespace", "your-table-name");
Map<ContentKey, Content> map = api.getContent().key(key).refName("dev").get();
```

Fetches the content for multiple `ContentKey` instances
```java
List<ContentKey> keys =
Arrays.asList(
ContentKey.of("<table1.namespace>", "<table1.name>"),
ContentKey.of("<table2.namespace>", "<table2.name>"),
ContentKey.of("<table3.namespace>", "<table3.name>"));
ContentKey.of("your-namespace1", "your-table-name1"),
ContentKey.of("your-namespace2", "your-table-name2"),
ContentKey.of("your-namespace3", "your-table-name3"));
Map<ContentKey, Content> allContent = api.getContent().keys(keys).refName("dev").get();
```

Expand Down
4 changes: 2 additions & 2 deletions site/docs/tools/iceberg/spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ Spark/Hadoop configs.
``` python linenums="1"
# read from branch dev
spark.read().format("iceberg").load("testing.region@dev")
# read specifically from hash in dev branch
spark.read().format("iceberg").load("testing.region@dev#<hash>")
# read specifically from hash
spark.read().format("iceberg").load("testing.region@<hash>")

spark.sql("SELECT * FROM nessie.testing.`region@dev`")
spark.sql("SELECT * FROM nessie.testing.`region@dev#<hash>`")
Expand Down

0 comments on commit ba81ddd

Please sign in to comment.