Skip to content

Commit

Permalink
[doc] Document hive.metastore.disallow.incompatible.col.type.changes …
Browse files Browse the repository at this point in the history
…for Flink and Spark client
  • Loading branch information
JingsongLi committed Dec 19, 2024
1 parent e23f7fe commit 1bf8989
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 9 additions & 2 deletions docs/content/flink/sql-alter.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ ALTER TABLE my_table RENAME c0 TO c1;

## Dropping Columns

The following SQL drops two columns `c1` and `c2` from table `my_table`. In hive catalog, you need to ensure disable `hive.metastore.disallow.incompatible.col.type.changes` in your hive server,
otherwise this operation may fail, throws an exception like `The following columns have types incompatible with the existing columns in their respective positions`.
The following SQL drops two columns `c1` and `c2` from table `my_table`.

```sql
ALTER TABLE my_table DROP (c1, c2);
Expand All @@ -107,6 +106,14 @@ ALTER TABLE my_table DROP (c1, c2);
To drop a column in a row type, see [Changing Column Type](#changing-column-type).
{{< /hint >}}

In hive catalog, you need to ensure:

1. disable `hive.metastore.disallow.incompatible.col.type.changes` in your hive server
2. or set `hadoop.hive.metastore.disallow.incompatible.col.type.changes=false` in your paimon catalog.

Otherwise this operation may fail, throws an exception like `The following columns have types incompatible with the
existing columns in their respective positions`.

## Dropping Partitions

The following SQL drops the partitions of the paimon table.
Expand Down
10 changes: 7 additions & 3 deletions docs/content/spark/sql-alter.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ The following SQL drops a nested column `f2` from a struct type, which is the va
ALTER TABLE my_table DROP COLUMN v.value.f2;
```

For hive catalog, you need to disable `'hive.metastore.disallow.incompatible.col.type.changes'`, otherwise this
operation may fail, throws an exception like `'The following columns have types incompatible with the existing columns
in their respective positions'`.
In hive catalog, you need to ensure:

1. disable `hive.metastore.disallow.incompatible.col.type.changes` in your hive server
2. or `spark-sql --conf spark.hadoop.hive.metastore.disallow.incompatible.col.type.changes=false` in your spark.

Otherwise this operation may fail, throws an exception like `The following columns have types incompatible with the
existing columns in their respective positions`.

## Dropping Partitions

Expand Down

0 comments on commit 1bf8989

Please sign in to comment.