Skip to content

[Bug]: SHOW CREATE TABLE drops FILEPATH for ordinary CSV external tables, leaving restored tables unreadable #31261

Closed

Description

@slyunnn

Description

For an ordinary local CSV external table without Hive partitioning, MatrixOne returns a SHOW CREATE TABLE definition with the original FILEPATH replaced by an empty string. The source table can read its file, but an external table recreated from this DDL (including through mo-dump SQL restore) cannot read the same file.

This is a MatrixOne external-table DDL/metadata defect, separate from the executable-comment marker in #30559.

Verified environment

  • MatrixOne main b466f4ae9b74813a4ff93eaf43a6c81e6cbb8b0b (2026-10-26); the running binary was rebuilt and restarted from this commit, and git_version() returned b466f4a on all routes.
  • Local 2 CN / 1 TN / 1 Log service / Proxy topology; tested via Proxy 6001, CN1 16001, and CN2 16002, using the MySQL text protocol.
  • Local CSV with the rows 1,alpha and 2,beta, stored at a path readable by the MatrixOne services.
  • mo-dump main d9d6375512620f12ff371b8602cc1d10d6f6caa0; the executable-comment marker fix from mo_dump PR #65 is present.

Minimal reproduction

Prepare a server-readable CSV with exactly:

1,alpha
2,beta

Replace the placeholder below with its absolute path, then execute:

CREATE DATABASE ext_ddl_source;
CREATE EXTERNAL TABLE ext_ddl_source.e(id INT, v VARCHAR(20))
  INFILE{'filepath'='<server-readable-absolute-path>/rows.csv'}
  FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';

SELECT * FROM ext_ddl_source.e ORDER BY id;
-- (1, alpha), (2, beta)

SHOW CREATE TABLE ext_ddl_source.e;

The generated DDL contains:

INFILE{'FILEPATH'='','COMPRESSION'='','FORMAT'='csv','JSONDATA'=''}

Recreate the table in a separate database using the returned DDL, or export and restore it with current mo-dump and a native MySQL client. The SQL restore finishes with exit 0 and the external-table catalog object exists, but SELECT * FROM <restored_table> fails with 20300: invalid configuration: the jsondata '' is not supported. The source CSV remains present and readable by the original table. This was observed through all three SQL routes.

Expected behavior

SHOW CREATE TABLE must preserve the external file configuration needed to recreate an equivalent table. A restored ordinary CSV external table should read the same rows as the source when the referenced file remains accessible. Do not expose secrets in generated DDL for credential-bearing external sources.

Scope and prior reports

  • #24372 covered Hive-partitioned external tables and was closed after that scope was verified. The ordinary non-Hive CSV failure was reported later in this comment, so this is not a newly discovered failure.
  • #30559 covers the distinct mo-dump executable-comment marker. Its 2026-10-26 regression confirms the marker no longer aborts SQL restore, while this DDL loss still prevents querying the restored external table.
  • S3/Stage portability and credential handling were not verified in this reproduction; they are not claimed fixed or failed here.

Acceptance criteria

  • An ordinary non-Hive CSV external table with a real server-readable file returns a SHOW CREATE TABLE definition retaining the required source configuration.
  • Replaying that DDL in a new database, and restoring a mo-dump export with a native MySQL client, both produce a queryable external table with the same rows, provided the file remains available to every relevant CN.
  • Verify through Proxy and both CN routes; retain a focused regression for the non-Hive case alongside the earlier Hive-partitioned coverage.

Activity

  1. added
    kind/bug
    on Oct 26, 2026
  2. added theissue type on Oct 26, 2026
  3. added this to the MO-202610 milestone on Oct 26, 2026
  4. XuPeng-SH commented on Oct 28, 2026

    @XuPeng-SH
    Contributor

    QA on merged main b888c218fb3a4f094bb8417288a45c47402e5635 (#31466): our local parser checks passed (3 top-level tests, 26 RUN entries); resource limits prevented local verification of the renderer, credential masking, DDL replay and restored rows.

    Subsequently, slyunnn independently verified the original local CSV contract on exact 66c9e7624e3374897acc649195fde5b2836343a5 using two CNs and Proxy: FILEPATH and apostrophe-path replay preserved the rows; synthetic credentials were redacted; actual mo-dump and native MySQL restore returned matching rows. Details: #31261 (comment). These are external verification results, not local execution in this QA environment. Live S3/Stage access and a separate mo-tester BVT run were not covered. The issue remains assigned to slyunnn.

  5. assigned and unassigned on Oct 28, 2026
  6. slyunnn commented on Oct 28, 2026

    @slyunnn
    Author

    Regression and extended verification for #31261 (2026-10-28)

    Verification Environment

    • MatrixOne latest origin/main: 66c9e7624e3374897acc649195fde5b2836343a5 — fix: widen integer addition and multiplication (#31088). The fresh mo-service binary reports this exact vcs.revision with vcs.modified=false; git_version() returned 66c9e76 through every route.
    • Fresh local 2 CN / 1 TN / 1 Log service / Proxy topology. Endpoints: Proxy 6001, CN1 16001, CN2 16002; all were reachable before and after testing.
    • MySQL text protocol via PyMySQL for SQL assertions; actual mo-dump CLI plus native MySQL client for SQL restore. The tested mo-dump binary is mo_dump main 9f0cc1173a9dc2def2656de3cb5c4b988c879442, with vcs.modified=false.

    What Was Covered

    • OK — Original ordinary, non-Hive CSV external table: the source read 3 rows; SHOW CREATE TABLE retained the real FILEPATH. Executing that returned DDL in a second database reproduced the same ordered rows through Proxy, CN1, and CN2.
    • OK — An apostrophe-containing local file path survived SHOW CREATE TABLE, DDL replay, and reading the same 2 rows through all 3 routes.
    • OK — Synthetic credential-bearing s3-opts paths did not expose the supplied key or secret in SHOW CREATE TABLE on any route; the renderer emitted redaction.
    • OK — Real mo-dump export and native MySQL-client SQL restore through Proxy completed with exit 0; source and restored external tables each returned the same 3 rows.
    • OK — A missing local file produced an empty scan without damaging the connection; no specific missing-file error contract is inferred from this control.
    • Not covered — Live S3/Stage access with real credentials; a separate mo-tester run of the committed BVT.

    Findings

    • The associated fix is MatrixOne PR #31466, merged as b888c218fb3a4f094bb8417288a45c47402e5635. It retains file-based external-table paths in the SHOW CREATE renderer and masks credential-bearing service arguments.
    • The previously reported empty-FILEPATH symptom and unreadable restored table did not reproduce on the current binary. No MatrixOne service source was changed.

    MOTR / BVT Coverage

    Final Conclusion

    Fixed for the ordinary non-Hive local CSV external-table and SQL-restore contract on the exact current main runtime. Large-data regression is not needed: the defect is DDL metadata rendering, not a row-count, batch, spill, or concurrency boundary; 3 rows suffice to prove source/replay/restored rowset equivalence. Live cloud-source portability remains outside this verification.

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

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions