You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by et...@apache.org on 2023/07/18 07:36:38 UTC
[iceberg] 01/01: Docs: Update wording around nullability
This is an automated email from the ASF dual-hosted git repository.
etudenhoefner pushed a commit to branch spark-ddl-nullability
in repository https://gitbox.apache.org/repos/asf/iceberg.git
commit 913c05666be73ecdaf1edb6f1b62c4a2c1dd7f1f
Author: Eduard Tudenhoefner <et...@gmail.com>
AuthorDate: Tue Jul 18 09:36:31 2023 +0200
Docs: Update wording around nullability
---
docs/spark-ddl.md | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/docs/spark-ddl.md b/docs/spark-ddl.md
index 6c80b5b2bc..282aa938c8 100644
--- a/docs/spark-ddl.md
+++ b/docs/spark-ddl.md
@@ -306,12 +306,17 @@ ALTER TABLE prod.db.sample ALTER COLUMN col FIRST
ALTER TABLE prod.db.sample ALTER COLUMN nested.col AFTER other_col
```
-Nullability can be changed using `SET NOT NULL` and `DROP NOT NULL`:
+Nullability for a non-nullable column can be changed using `DROP NOT NULL`:
```sql
ALTER TABLE prod.db.sample ALTER COLUMN id DROP NOT NULL
```
+{{< hint info >}}
+It is not possible to change a nullable column to non-nullable with `SET NOT NULL` because Iceberg doesn't know whether there is existing data with null values.
+{{< /hint >}}
+
+
{{< hint info >}}
`ALTER COLUMN` is not used to update `struct` types. Use `ADD COLUMN` and `DROP COLUMN` to add or remove struct fields.
{{< /hint >}}
@@ -526,4 +531,4 @@ Tags can be removed via the `DROP TAG` sql
```sql
ALTER TABLE prod.db.sample DROP TAG historical-tag
-```
\ No newline at end of file
+```