apache / apache/paimon

[Feature] Supports specifying hive environment parameters when altering table

Open
#4,507 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.

### Motivation

When using the Paimon Schema Evolution function, the alertTable method of Hive will be called to add fields, and the statistical information of the Hive table will be updated by default. In fact, Paimon will use its own statistical information instead of Hive's, so it can be turned off in scenarios where there are many fields in the Paimon table and they are updated frequently to avoid a sharp increase in HMS memory.
![image](https://github.com/user-attachments/assets/678ee2fe-a27b-4569-b08f-034a43e43dbc)

### Solution

When alterTable is triggered, the method called is changed to alter_table_with_environmentContext instead of alter_table. In this way, you can control whether to update table stats by setting the DO_NOT_UPDATE_STATS parameter in the EnvironmentContext object

### Anything else?

_No response_

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Hive Schema Evolution path where alterTable is triggered, and trace the existing alter_table call. Read the EnvironmentContext API and the DO_NOT_UPDATE_STATS parameter described in the issue. Done means the alteration uses the environment-aware entry point and allows table-statistics updates to be disabled without breaking schema changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.