- External table: When using a Hive external table or Hudi external table to query data in Apache Hive™ or Apache Hudi, you can execute this statement to update the metadata of a Hive table or Hudi table cached in the database.
- External catalog: When using an external catalog (except for JDBC Catalog) to query data in the corresponding data source, you can execute this statement to update the metadata cached in the database.
NOTE Only users with the ALTER privilege on the corresponding external table can perform this operation.
Basic concepts
- Hive external table: is created and stored in the database. You can use it to query Hive data.
- Hudi external table: is created and stored in the database. You can use it to query Hudi data.
- Hive table: is created and stored in Hive.
- Hudi table: is created and stored in Hudi.
Syntaxes and parameters
The following describes the syntaxes and parameters based on different cases:-
External table
-
External catalog
Usage notes
Only users who have theALTER_PRIV privilege can execute this statement to update the metadata of Hive tables and Hudi tables cached in the database.
Examples
Usage examples in different cases are as follows:External table
Example 1: Update the cached metadata of the corresponding Hive table in the database by specifying the external tablehive1.
hudi1 and the partitions in that table.
External catalog
Example 1: Update the metadata ofhive_table cached in the database.
p2 in hive_table cached in the database.
hudi_table cached in the database.