Skip to content

Commit

Permalink
fix sql commands in iceberg documentation (#7327)
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnro314 authored Jan 24, 2024
1 parent 4a7cb61 commit 3d8e3c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/integrations/iceberg.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ spark-shell --conf spark.sql.catalog.lakefs="org.apache.iceberg.spark.SparkCatal
To create a table on your main branch, use the following syntax:

```sql
CREATE TABLE lakefs.main.table1 (id int, data string);
CREATE TABLE lakefs.main.db1.table1 (id int, data string);
```

### Insert data into the table

```sql
INSERT INTO lakefs.main.table1 VALUES (1, 'data1');
INSERT INTO lakefs.main.table1 VALUES (2, 'data2');
INSERT INTO lakefs.main.db1.table1 VALUES (1, 'data1');
INSERT INTO lakefs.main.db1.table1 VALUES (2, 'data2');
```

### Create a branch
Expand All @@ -126,15 +126,15 @@ lakectl branch create lakefs://example-repo/dev -s lakefs://example-repo/main
We can now make changes on the branch:

```sql
INSERT INTO lakefs.dev.table1 VALUES (3, 'data3');
INSERT INTO lakefs.dev.db1.table1 VALUES (3, 'data3');
```

### Query the table

If we query the table on the branch, we will see the data we inserted:

```sql
SELECT * FROM lakefs.dev.table1;
SELECT * FROM lakefs.dev.db1.table1;
```

Results in:
Expand All @@ -151,7 +151,7 @@ Results in:
However, if we query the table on the main branch, we will not see the new changes:

```sql
SELECT * FROM lakefs.main.table1;
SELECT * FROM lakefs.main.db1.table1;
```

Results in:
Expand Down

0 comments on commit 3d8e3c2

Please sign in to comment.