# Parquet统计信息最小值/最大值在行组合并后不正确

- **ID:** `data/parquet-corrupt-min-max-statistics`
- **领域:** data
- **类别:** data_error
- **错误码:** `PARQUET_STATISTICS_CORRUPT`
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

合并Parquet行组时，最小/最大统计信息未从实际数据重新计算，而是从列元数据派生，导致过滤下推不正确。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| parquet-mr 1.12.0 | active | — | — |
| Spark 3.4.0 | active | — | — |
| Apache Arrow 12.0.0 | active | — | — |

## 解决方案

1. ```
   Use Spark's `OPTIMIZE` command with `REWRITE_DATA` option to force statistics recomputation: `OPTIMUTE table_name REWRITE DATA WHERE partition_column = 'value'`.
   ```
2. ```
   Disable predicate pushdown temporarily by setting `spark.sql.parquet.filterPushdown=false` and re-enable after verifying statistics.
   ```

## 无效尝试

- **** — Recomputing statistics by rewriting the entire Parquet file is expensive and may not fix the issue if the metadata is already corrupted. (70% 失败率)
- **** — Adjusting filter predicates to use more relaxed conditions may bypass the incorrect statistics but leads to performance degradation. (60% 失败率)
