Skip to content

[Bug]: Iceberg STRING table with an empty value is rejected as invalid manifest metadata #27210

Closed

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

b7125ed

Other Environment Information

- Branch: main
- Commit: b7125edccd610e96039bd84b0213a2beb6583877
- Topology: local 1 CN + 1 TN + 1 LogService, DISK-V2
- External catalog: Nessie 0.108.4 + MinIO; Oracle: Spark 3.5.1 + Iceberg 1.6.1; Iceberg format v2 / Parquet

Actual Behavior

A supported Iceberg STRING column containing an empty string is rejected during manifest parsing. Mapping DDL succeeds, but the first SELECT fails with:

ERROR 20400 (HY000): invalid state ICEBERG_METADATA_INVALID: Iceberg manifest entry is invalid [entry=0]

The error is stable in 3/3 independently created tables. No panic, restart, or connection loss was observed.

Expected Behavior

The table is valid Iceberg v2/Parquet data. MatrixOne must read all rows including the empty string, exactly as Spark does.

Steps to Reproduce

1. Create a table through Spark against the same Nessie REST catalog and MinIO warehouse:

CREATE TABLE tiera.string_boundary1.empty (id BIGINT, x STRING)
USING iceberg TBLPROPERTIES ('format-version'='2');
INSERT INTO tiera.string_boundary1.empty VALUES
  (1, ''), (2, 'z'), (3, NULL);

2. Create the normal MatrixOne REST catalog/access mapping and map it:

CREATE EXTERNAL TABLE empty_t (id BIGINT, x TEXT) ENGINE=ICEBERG WITH (
  'catalog'='type_min_cat', 'namespace'='string_boundary1', 'table'='empty',
  'ref'='main', 'read_mode'='append_only', 'write_mode'='read_only'
);

3. Execute `SELECT COUNT(*), COUNT(x) FROM empty_t;`.
4. Repeat with independently created `string_boundary2.empty` and `string_boundary3.empty` tables.

Additional information

Controls:

  • Spark returns COUNT(*)=3, COUNT(x)=2.
  • The same table shape with nonempty ASCII strings (a, z, NULL) reads successfully 3/3.
  • The same table shape with Unicode nonempty strings (中文, é, NULL) reads successfully 3/3.
  • This is also consistent with a truncate-partitioned table that contains an empty string failing manifest parsing, while identity/bucket partitions with normal strings work.

Regression suggestion: Spark/Nessie/MinIO deterministic case with '', a nonempty ASCII string, a Unicode string and NULL; assert full scan and equality controls. No big-data data set is needed.

Activity

  1. added
    kind/bug
    on Aug 17, 2026
  2. changed the title [-][Bug]:[/-] [+][Bug]: Iceberg STRING table with an empty value is rejected as invalid manifest metadata[/+] on Aug 17, 2026
  3. added theissue type on Aug 17, 2026
  4. added this to the MO-202608 milestone on Aug 17, 2026
  5. added
    ai-easy
    on Sep 4, 2026
  6. Ariznawlll commented on Sep 8, 2026

    @Ariznawlll
    CollaboratorAuthor

    最新 main(commit f72ca9e)本地验证:执行 mo-cgo-test ./test/iceberg -run TestLocalE2EEmptyStringReadCase -count=1 -p=1,空字符串/非空字符串/NULL 的结果断言及错误分支全部通过(0.445s)。当前 Docker 的 MinIO 已退出,缺少可读的 Spark/Nessie/MinIO Iceberg v2/Parquet 数据集,因此未执行真实 manifest 读取和 COUNT(*)=3, COUNT(x)=2 的外部表验收。结论:#28153 已在当前 main,代码级空字符串回归测试通过;真实 Iceberg manifest 读取待依赖服务恢复,暂不关闭。

  7. Ariznawlll commented on Sep 16, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试版本

    • 分支:main
    • commit:b347a62a30719cf3f2c8ca5a2da0dcfb11639f8c
    • 部署方式:临时 2 CN 分布式验证环境;Nessie 0.108.4、MinIO、Iceberg 1.6.1、format v2 / Parquet。
    • 测试日期:2026-09-16

    原问题验证

    用 Spark 创建三个独立 Iceberg v2 / Parquet 表,并分别写入 (1, '')、一个非空字符串和 (3, NULL);再以只读 Iceberg external table 映射读取。由于测试环境无法拉取 Spark 3.5.1 镜像,本次使用 Spark 3.5.4;Iceberg 版本保持为原问题的 1.6.1。该差异已记录,且本次验证的空字符串 manifest/read 路径一致。

    Happy Path 覆盖

    1. 空字符串表读取为 COUNT(*)=3、COUNT(x)=2、COUNT(NULLIF(x,''))=1、x='' 的行数为 1;逐行可区分空字符串、非空字符串和 SQL NULL。
    2. ASCII 控制表 (1, ''),(2, 'normal'),(3, NULL) 与 Unicode 控制表 (1, ''),(2, '中文'),(3, NULL) 均返回 3,2,1,1,并能读到各自的非空控制值。
    3. 三张表分别独立建表、映射和查询,结果一致;没有再出现 ICEBERG_METADATA_INVALID 或 manifest entry invalid 错误。

    Unhappy Path 覆盖

    1. 对只读 Iceberg external table 的写入尝试被拒绝;随后回读源表仍为 COUNT(*)=3, COUNT(x)=2, empty_count=1,证明被拒绝操作没有改变源数据。
    2. 各轮读取均在临时环境完成,没有观察到查询挂起、CN 重启或数据残留;验证结束后已确认临时运行目录、对象存储 fixture、catalog 配置和环境变量均被清理。

    白盒验证

    不适用:原问题是外部 Iceberg manifest/read 的公开 SQL 行为,Spark/Nessie/MinIO 生成的真实 v2/Parquet fixture 已直接覆盖。未使用白盒注入替代该外部读取路径。

    回归测试

    已有针对空字符串读取的回归资产:test/iceberg/iceberg_e2e_local.go 和 TestLocalE2EEmptyStringReadCase。本轮以真实 Spark 生成的 fixture 完成黑盒复验,未新增重复 case。

    测试证据

    真实 Iceberg 读取的三张表统计分别为:空字符串表 3,2,1,1,ASCII 控制表 3,2,1,1,Unicode 控制表 3,2,1,1;每张表都核对了空字符串、非空字符串和 NULL 的逐行语义。固定 SHA 的回归代码链接见上节。

    测试结论

    测试通过。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-easykind/bugphase/testing

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions