Repository navigation
Description
Description
MatrixOne cannot read a supported external Iceberg v2 table generated by Spark when the data file uses the NYC TLC Parquet schema. The failure is not scale-dependent: it reproduces with a table containing only 1 row.
The same Iceberg snapshot is readable by Spark. MatrixOne's small deterministic Iceberg tables also work, so catalog connectivity, Nessie, MinIO, credentials, and the basic Iceberg read path are healthy.
This bug was found while validating #23359 with the published Iceberg external-table test design.
Environment
- Branch:
main - Commit:
1f9e501594509fb5d2e0284833faf8c3426e2285 - Test date:
2026-08-16 - MatrixOne deployment: local
1 CN + 1 TN + 1 LogService - External services: Nessie REST catalog + MinIO S3-compatible object storage
- Spark:
3.5.1 - Iceberg Spark runtime:
1.6.1 - Table format: Iceberg v2, partitioned by
months(tpep_pickup_datetime) - Source Parquet: NYC TLC Yellow Taxi 2024-01
Steps to reproduce
The repository already contains the complete seed and comparison harness. The following is the smallest reproducible path.
1. Build MatrixOne and start the local Iceberg services
git checkout 1f9e501594509fb5d2e0284833faf8c3426e2285
make build
make dev-up-iceberg-tier-a
# Start MatrixOne in another terminal.
./mo-service -launch etc/launch-minio-local/launch.tomlWait until MatrixOne accepts connections on 127.0.0.1:6001 and Nessie is available on 127.0.0.1:19120.
2. Seed only one Spark row into an Iceberg v2 table
Use a local MySQL client command template with valid local credentials; do not commit credentials into the repository.
export MO_ICEBERG_NYC_TLC_ROW_LIMIT=1
export MO_ICEBERG_MO_SQL_CMD='mysql -h 127.0.0.1 -P 6001 -u root -p<local-password> -e {sql}'
export MO_ICEBERG_MO_QUERY_SQL_CMD='mysql -h 127.0.0.1 -P 6001 -u root -p<local-password> --batch --raw --skip-column-names -e {sql}'
make dev-seed-iceberg-tier-b-nyc-tlcThe seed executes etc/launch-minio-local/tier-b/seed_nyc_tlc.spark.sql, creates tiera.public_nyc_tlc.yellow_tripdata, and maps it to iceberg_tier_b.yellow_tripdata in MatrixOne.
The relevant Spark table definition is:
CREATE TABLE tiera.public_nyc_tlc.yellow_tripdata
USING iceberg
PARTITIONED BY (months(tpep_pickup_datetime))
TBLPROPERTIES (
'format-version'='2',
'write.delete.mode'='merge-on-read',
'write.update.mode'='merge-on-read',
'write.merge.mode'='merge-on-read'
)
AS
SELECT *
FROM (
SELECT
CAST(`VendorID` AS INT) AS vendor_id,
CAST(tpep_pickup_datetime AS TIMESTAMP) AS tpep_pickup_datetime,
CAST(tpep_dropoff_datetime AS TIMESTAMP) AS tpep_dropoff_datetime,
CAST(passenger_count AS INT) AS passenger_count,
CAST(trip_distance AS DOUBLE) AS trip_distance,
CAST(`RatecodeID` AS INT) AS rate_code_id,
CAST(store_and_fwd_flag AS STRING) AS store_and_fwd_flag,
CAST(`PULocationID` AS INT) AS pu_location_id,
CAST(`DOLocationID` AS INT) AS do_location_id,
CAST(payment_type AS INT) AS payment_type,
CAST(fare_amount AS DECIMAL(12,2)) AS fare_amount,
CAST(extra AS DECIMAL(12,2)) AS extra,
CAST(mta_tax AS DECIMAL(12,2)) AS mta_tax,
CAST(tip_amount AS DECIMAL(12,2)) AS tip_amount,
CAST(tolls_amount AS DECIMAL(12,2)) AS tolls_amount,
CAST(improvement_surcharge AS DECIMAL(12,2)) AS improvement_surcharge,
CAST(total_amount AS DECIMAL(12,2)) AS total_amount,
CAST(congestion_surcharge AS DECIMAL(12,2)) AS congestion_surcharge,
CAST(`Airport_fee` AS DECIMAL(12,2)) AS airport_fee
FROM parquet.`yellow_tripdata_2024-01.parquet`
WHERE tpep_pickup_datetime >= TIMESTAMP '2024-01-01 00:00:00'
AND tpep_pickup_datetime < TIMESTAMP '2024-02-01 00:00:00'
LIMIT 1
) src;3. Confirm the Spark control
SELECT COUNT(*)
FROM tiera.public_nyc_tlc.yellow_tripdata;Spark returns:
1
4. Query the same Iceberg snapshot from MatrixOne
SELECT COUNT(*)
FROM iceberg_tier_b.yellow_tripdata;Repeat the query three times on a fresh mapped table.
5. Run the repository Tier B comparison (optional full check)
set -a
source etc/launch-minio-local/tier-b/tier_b_nyc_tlc.generated.env
set +a
MO_ICEBERG_CI_PROFILE=tier-b make test-iceberg-nightlyActual behavior
The MatrixOne query fails 3/3 even with one row. Depending on the query shape, the error is one of:
ERROR 20400 (HY000): invalid state ICEBERG_OBJECT_IO: Iceberg signed HTTP response is too large to materialize [max_bytes=536870912, signed_url=<redacted>]
ERROR 20400 (HY000): ICEBERG_OBJECT_IO: Iceberg row-group footer read failed [file=<redacted>]
The error is inconsistent with the physical object size. In the 200,000-row control, the two data files were only:
437,541 bytes / 25,866 records
3,032,314 bytes / 174,134 records
Both are far below the reported 512 MiB materialization limit.
Expected behavior
MatrixOne should read the Spark-generated Iceberg v2 table and return the same rows as Spark. For the minimal reproducer:
COUNT(*) = 1
Stability and controls
- Minimal reproducer: 3/3 failed at 1 row.
- Scale boundary: 1, 1,000, 10,000, 50,000, 100,000 and 200,000 rows all reproduced the failure; each focused count was repeated 3 times.
- Spark oracle: passed and returned the expected row count from the same snapshot.
- MatrixOne deterministic local Iceberg E2E control: 3 fresh runs, 12/12 subcases passed (catalog, append/read, time travel, partition filter, merge-on-read delete).
- Topology control: reproduced on both MinIO-backed MatrixOne fileservice and a fresh standard local
DISK-V2MatrixOne launch. - Service health: no MatrixOne panic, OOM or restart was observed; all test databases and external mappings were cleaned up.
- This is not a big-data-only bug: one row is sufficient.
Evidence
The repository's Tier B runner produced the following failures on all three rounds:
ICE-TEST-130_public_dataset_count_filter: query_failed
ICE-TEST-130_public_dataset_limit_projection: query_failed
ICE-TEST-130_public_dataset_location_aggregation: query_failed
Example MatrixOne SQL and error:
select count(*) as c
from iceberg_tier_b.yellow_tripdata
where tpep_pickup_datetime >= timestamp '2024-01-01 00:00:00'
and tpep_pickup_datetime < timestamp '2024-02-01 00:00:00';
ERROR 20400 (HY000): ICEBERG_OBJECT_IO: Iceberg row-group footer read failed
Code analysis
Confirmed error locations on the tested commit:
pkg/iceberg/io/signed_http_fs.go:signedHTTPFileService.materializedReadTooLargeemits the 512 MiB error.pkg/iceberg/metadata/row_group_parquet.go:readParquetRowGroupFooterswrapsparquet.OpenFilefailures asIceberg row-group footer read failed.
Hypothesis: a range/size contract mismatch between the signed HTTP object reader and Parquet ReaderAt causes a small Spark-generated Parquet object to be handled as an unbounded/full response, or returns incorrect bytes for footer reads. This is a hypothesis, not yet a confirmed root cause.
Regression coverage
After the fix, add:
- A deterministic Spark-generated one-row Iceberg v2 fixture in the external Iceberg/MOTR scenario suite using Nessie + MinIO. Assert
COUNT(*), ordered projection, aggregation and row values against Spark. - Keep the existing 200,000-row NYC TLC Tier B smoke.
- Run the full NYC month only in nightly big-data after the one-row correctness path passes; large data is not required to reproduce this defect.
Do not baseline the current error as expected behavior.
Related
- Source feature validation: [Feature Request]: Support External Iceberg Tables #23359
- Test design: https://github.com/Ariznawlll/mo-test-reports/tree/main/iceberg-external-table-test-design
- No matching open or closed MatrixOne issue was found using the exact errors and the keywords
Iceberg,Spark,Parquet,row-group footer, andICEBERG_OBJECT_IO.
Activity
Ariznawlll commentedon Aug 16, 2026
补充最新
main@1f9e501594509fb5d2e0284833faf8c3426e2285的原生 MinIO + Nessie 复现证据(非 Docker 环境):RELEASE.2025-09-06T17-38-46Z,Nessie0.108.4,Spark3.5.1+ Iceberg1.6.1。iceberg_rewrite_data_files合并为 1 个文件后,MatrixOne 3/3 同样出现 signed HTTP 读取失败;Spark 对同一新 snapshot 读取正常、行数及 checksum 不变。这说明问题不依赖 Docker,也不只存在于原报告的数据源;它与生成对象的布局/大小或 footer/range 获取路径相关。64-file 重写后的读取失败继续归入本 issue,没有重复新建 bug。独立的维护返回元数据错误已拆为 #27201。
Ariznawlll commentedon Aug 19, 2026
测试版本
mainb5c948130897783c544e12ab83bfd94702282f89原问题验证
原问题是 Spark 生成的 NYC TLC Iceberg v2 Parquet 表即使只有 1 行,MatrixOne 读取也会因 signed HTTP range 响应分片导致 row-group footer 读取失败;该问题不是大数据量专属。
Happy Path 覆盖
TestSignedHTTPFileServiceReadsFragmentedKnownLengthResponse:已知长度且被分片的 signed range 响应完整读取,3/3 通过。TestLocalScanPlannerReadsFragmentedSignedParquetFooterThroughProvider:通过真实 provider → object reader → Parquet footer 路径读取 1 行 fixture,3/3 通过。Unhappy Path 覆盖
TestSignedHTTPFileServiceRejectsTruncatedKnownLengthResponse覆盖响应体截断,正确返回io.ErrUnexpectedEOF,不会把不完整数据当作成功读取。白盒验证
执行
go test ./pkg/iceberg/io -run 'TestSignedHTTPFileServiceReadsFragmentedKnownLengthResponse|TestSignedHTTPFileServiceRejectsTruncatedKnownLengthResponse' -count=3和go test ./pkg/iceberg/metadata -run '^TestLocalScanPlannerReadsFragmentedSignedParquetFooterThroughProvider$' -count=3,全部通过。对应修复为 PR #27204,commit0d7ad8b6b。回归测试
该场景依赖 Spark/Nessie/MinIO 和外部 Iceberg 表,不适合普通 MOTR SQL suite;保留 Iceberg Tier B/nightly 外部表回归。
大数据评估
不需要新增 big-data。原问题 1 行即可触发;现有 200,000 行 NYC TLC smoke 可继续作为 nightly 守护,但不是本缺陷的必要覆盖。
测试结论
测试通过。