# Snowflake：解析JSON错误 — 对象大小超过16777216字节的最大长度

- **ID:** `data/snowflake-semi-structured-field-exceeds-limit`
- **领域:** data
- **类别:** data_error
- **错误码:** `100132`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

VARIANT列中的单个JSON对象超过了Snowflake中半结构化数据字段的16 MB大小限制。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Snowflake 7.0 | active | — | — |
| Snowflake 8.0 | active | — | — |

## 解决方案

1. ```
   将大的JSON对象拆分为多个较小的对象（例如，对象数组），并使用FLATTEN函数将其加载为单独的行。
   ```
2. ```
   将JSON存储为TEXT列（VARCHAR）而非VARIANT，仅在查询较小的子集时使用PARSE_JSON()。
   ```

## 无效尝试

- **Increasing the VARIANT column size or using a different data type like TEXT** — Snowflake's semi-structured limit is a hard limit; changing column type does not bypass it. (100% 失败率)
- **Compressing the JSON data before loading** — Compression reduces storage but the parsed object size remains the same; the limit is on the parsed object, not the file. (80% 失败率)
