Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/spark-writes.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,14 @@ data.writeTo("prod.db.table")
.createOrReplace()
```

You can specify an Iceberg table location such as the `LOCATION` clause in SQL by add the `location` paramter to the `tableProperty`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I know there's a bad example above, but typically we avoid 'you' or 'me' in documentation. you can see other reviews, for example: #4301 (comment)

Also, I'm not sure why we reference "LOCATION" clause in SQL, which is documented elsewhere.

How about:
The Iceberg table location can also be specified by the `location` table configuration

Let me know what you think

Copy link
Contributor Author

@tomtongue tomtongue Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing this and the great suggenstion, Szehon! The following your suggestion is simpler and makes sense. Based on your suggestion, I updated a bit; ... table configuration to table property. How about this?

The Iceberg table location can also be specified by the `location` table property.

For your comment;

Nit: I know there's a bad example above, but typically we avoid 'you' or 'me' in documentation. you can see other reviews, for example: #4301 (comment)

Thanks for pointing out, I understand it.

Also, I'm not sure why we reference "LOCATION" clause in SQL, which is documented elsewhere.

I tried saying the tableProperty("location", "...") is the same as LOCATION in SQL, but the suggestion is better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that will work. Thanks!


```scala
data.writeTo("prod.db.table")
.tableProperty("location", "/path/to/location")
.createOrReplace()
```

## Writing to partitioned tables

Iceberg requires the data to be sorted according to the partition spec per task (Spark partition) in prior to write
Expand Down