Skip to content

fix(fileservice): honor explicit hidden paths in external scans - #28362

Merged
XuPeng-SH merged 1 commit into
matrixorigin:mainfrom
XuPeng-SH:codex/fix-load-hidden-paths-28270
Sep 8, 2026
Merged

XuPeng-SH merged 1 commit into
matrixorigin:mainfrom
XuPeng-SH:codex/fix-load-hidden-paths-28270

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG
  • Test and CI

Which issue(s) this PR fixes:

Fixes #28270

What this PR does / why we need it:

Local external-file discovery lists each path component. LocalETLFS.List
previously removed dot-prefixed entries before the planner could match even an
explicit .data component, silently turning existing input into an empty list.

  • Add an opt-in LocalETLFS.ListWithHidden backed by the existing listing loop.
    ReadDir uses it only when a local path component starts with .. This covers
    literal hidden directories/files, dot-prefixed globs, and hidden components
    after a wildcard.
  • Preserve ordinary List semantics for every existing consumer, including
    filtering temporary files used by atomic writes. Ordinary * still does not
    discover hidden entries. Other filesystem implementations remain unchanged.
  • Keep component-by-component existence/type checks: missing components match
    nothing and do not create directories. Bypassing listing through dynamic local
    filesystem construction would risk creating missing parent directories.
  • Cover absolute and named etl: paths, returned file sizes/cardinality,
    visible/hidden wildcard controls, directory symlinks, invalid patterns,
    cancellation, and file-vs-directory boundaries. Four one-row CSV fixtures
    support an isolated public LOAD/external-table case.

Validation

Linux/amd64, Go 1.26.4, controlled native CPU test wrapper; base and merge-base
074bc173a5b64ed0ff0b6ad6ab091f478bf76c27 (fresh main).

  • Pre-fix TestReadDirHiddenPaths: FAIL with missing explicitly selected files.
    The same regression and nearby controls pass after the fix.
  • Focused TestLocalETLFSListExplicitHiddenEntries and
    TestReadDirHiddenPaths: PASS. Final strengthened cardinality oracle also
    passed after review.
  • Owning packages: mo-cgo-test -count=1 -timeout=10m ./pkg/fileservice ./pkg/sql/plan
    PASS (30.154s and 5.440s).
  • All five Parquet compile tests named in [Bug]: LOAD/extern glob silently ignores explicit hidden directory components #28270 passed with both TMPDIR and
    GOTMPDIR beneath an explicitly hidden directory. This includes file fanout,
    empty-file/schema validation, and cancellation consumer paths.
  • make -j8 build: PASS.
  • New load_hidden_paths.sql: 17/17 twice on the same standalone instance,
    0.240s and 0.166s, normal comparison mode with independently specified results.
    Zero residual fixture databases/tables and no created .missing directory
    were verified. SQL and ISCP readiness were checked before running.
  • Entire load_data directory: PASS, 1057 successful, 0 failed, 2 existing
    ignored statements, approximately 5s reported case time. No new skips or
    weakened assertions. Initial local harness runs lacked LOCAL INFILE enablement
    and output cleanup; both settings were aligned with mo-tester configuration
    before the successful group run.

The literal CSV LOAD is a compatibility control; external-table scans exercise
the public ReadDir regression, while existing Parquet compile tests exercise
the LOAD fanout consumer. No additional service fixture was added to UT.

Pre-PR review

Reviewed all 10 delivery files and the shared closure from public LOAD/external
scan callers through ReadDir, filesystem selection, entry matching, and iterator
cleanup. R2 local filesystem/public result contract; ordinary bug fix, no design
document gate. No shared mutable state, new worker/cache, persisted/wire format,
or distributed routing change. The opt-in flag is call-local, and the existing
deferred directory close covers completion, error, and early iterator stop.
Default discovery and all its other consumers keep the same behavior and I/O
shape; no new scan or allocation layer is introduced. Race/restart/multi-CN
stress is not the discriminating evidence for this sequential selection change.
No unresolved in-scope review blockers. CI is not waited for.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Sep 8, 2026
@mergify mergify Bot added kind/bug Something isn't working kind/test-ci labels Sep 8, 2026
@XuPeng-SH
XuPeng-SH merged commit eb7912a into matrixorigin:main Sep 8, 2026
27 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/fix-load-hidden-paths-28270 branch September 8, 2026 01:38
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…ixorigin#28362)

## What type of PR is this?

- [x] BUG
- [x] Test and CI

## Which issue(s) this PR fixes:

Fixes matrixorigin#28270

## What this PR does / why we need it:

Local external-file discovery lists each path component.
`LocalETLFS.List`
previously removed dot-prefixed entries before the planner could match
even an
explicit `.data` component, silently turning existing input into an
empty list.

- Add an opt-in `LocalETLFS.ListWithHidden` backed by the existing
listing loop.
`ReadDir` uses it only when a local path component starts with `.`. This
covers
literal hidden directories/files, dot-prefixed globs, and hidden
components
  after a wildcard.
- Preserve ordinary `List` semantics for every existing consumer,
including
filtering temporary files used by atomic writes. Ordinary `*` still does
not
discover hidden entries. Other filesystem implementations remain
unchanged.
- Keep component-by-component existence/type checks: missing components
match
nothing and do not create directories. Bypassing listing through dynamic
local
filesystem construction would risk creating missing parent directories.
- Cover absolute and named `etl:` paths, returned file
sizes/cardinality,
visible/hidden wildcard controls, directory symlinks, invalid patterns,
cancellation, and file-vs-directory boundaries. Four one-row CSV
fixtures
  support an isolated public LOAD/external-table case.

## Validation

Linux/amd64, Go 1.26.4, controlled native CPU test wrapper; base and
merge-base
`074bc173a5b64ed0ff0b6ad6ab091f478bf76c27` (fresh main).

- Pre-fix `TestReadDirHiddenPaths`: FAIL with missing explicitly
selected files.
  The same regression and nearby controls pass after the fix.
- Focused `TestLocalETLFSListExplicitHiddenEntries` and
`TestReadDirHiddenPaths`: PASS. Final strengthened cardinality oracle
also
  passed after review.
- Owning packages: `mo-cgo-test -count=1 -timeout=10m ./pkg/fileservice
./pkg/sql/plan`
  PASS (30.154s and 5.440s).
- All five Parquet compile tests named in matrixorigin#28270 passed with both TMPDIR
and
GOTMPDIR beneath an explicitly hidden directory. This includes file
fanout,
  empty-file/schema validation, and cancellation consumer paths.
- `make -j8 build`: PASS.
- New `load_hidden_paths.sql`: 17/17 twice on the same standalone
instance,
0.240s and 0.166s, normal comparison mode with independently specified
results.
Zero residual fixture databases/tables and no created `.missing`
directory
  were verified. SQL and ISCP readiness were checked before running.
- Entire `load_data` directory: PASS, 1057 successful, 0 failed, 2
existing
ignored statements, approximately 5s reported case time. No new skips or
weakened assertions. Initial local harness runs lacked LOCAL INFILE
enablement
and output cleanup; both settings were aligned with mo-tester
configuration
  before the successful group run.

The literal CSV LOAD is a compatibility control; external-table scans
exercise
the public `ReadDir` regression, while existing Parquet compile tests
exercise
the LOAD fanout consumer. No additional service fixture was added to UT.

## Pre-PR review

Reviewed all 10 delivery files and the shared closure from public
LOAD/external
scan callers through `ReadDir`, filesystem selection, entry matching,
and iterator
cleanup. R2 local filesystem/public result contract; ordinary bug fix,
no design
document gate. No shared mutable state, new worker/cache, persisted/wire
format,
or distributed routing change. The opt-in flag is call-local, and the
existing
deferred directory close covers completion, error, and early iterator
stop.
Default discovery and all its other consumers keep the same behavior and
I/O
shape; no new scan or allocation layer is introduced.
Race/restart/multi-CN
stress is not the discriminating evidence for this sequential selection
change.
No unresolved in-scope review blockers. CI is not waited for.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…ixorigin#28362)

## What type of PR is this?

- [x] BUG
- [x] Test and CI

## Which issue(s) this PR fixes:

Fixes matrixorigin#28270

## What this PR does / why we need it:

Local external-file discovery lists each path component.
`LocalETLFS.List`
previously removed dot-prefixed entries before the planner could match
even an
explicit `.data` component, silently turning existing input into an
empty list.

- Add an opt-in `LocalETLFS.ListWithHidden` backed by the existing
listing loop.
`ReadDir` uses it only when a local path component starts with `.`. This
covers
literal hidden directories/files, dot-prefixed globs, and hidden
components
  after a wildcard.
- Preserve ordinary `List` semantics for every existing consumer,
including
filtering temporary files used by atomic writes. Ordinary `*` still does
not
discover hidden entries. Other filesystem implementations remain
unchanged.
- Keep component-by-component existence/type checks: missing components
match
nothing and do not create directories. Bypassing listing through dynamic
local
filesystem construction would risk creating missing parent directories.
- Cover absolute and named `etl:` paths, returned file
sizes/cardinality,
visible/hidden wildcard controls, directory symlinks, invalid patterns,
cancellation, and file-vs-directory boundaries. Four one-row CSV
fixtures
  support an isolated public LOAD/external-table case.

## Validation

Linux/amd64, Go 1.26.4, controlled native CPU test wrapper; base and
merge-base
`074bc173a5b64ed0ff0b6ad6ab091f478bf76c27` (fresh main).

- Pre-fix `TestReadDirHiddenPaths`: FAIL with missing explicitly
selected files.
  The same regression and nearby controls pass after the fix.
- Focused `TestLocalETLFSListExplicitHiddenEntries` and
`TestReadDirHiddenPaths`: PASS. Final strengthened cardinality oracle
also
  passed after review.
- Owning packages: `mo-cgo-test -count=1 -timeout=10m ./pkg/fileservice
./pkg/sql/plan`
  PASS (30.154s and 5.440s).
- All five Parquet compile tests named in matrixorigin#28270 passed with both TMPDIR
and
GOTMPDIR beneath an explicitly hidden directory. This includes file
fanout,
  empty-file/schema validation, and cancellation consumer paths.
- `make -j8 build`: PASS.
- New `load_hidden_paths.sql`: 17/17 twice on the same standalone
instance,
0.240s and 0.166s, normal comparison mode with independently specified
results.
Zero residual fixture databases/tables and no created `.missing`
directory
  were verified. SQL and ISCP readiness were checked before running.
- Entire `load_data` directory: PASS, 1057 successful, 0 failed, 2
existing
ignored statements, approximately 5s reported case time. No new skips or
weakened assertions. Initial local harness runs lacked LOCAL INFILE
enablement
and output cleanup; both settings were aligned with mo-tester
configuration
  before the successful group run.

The literal CSV LOAD is a compatibility control; external-table scans
exercise
the public `ReadDir` regression, while existing Parquet compile tests
exercise
the LOAD fanout consumer. No additional service fixture was added to UT.

## Pre-PR review

Reviewed all 10 delivery files and the shared closure from public
LOAD/external
scan callers through `ReadDir`, filesystem selection, entry matching,
and iterator
cleanup. R2 local filesystem/public result contract; ordinary bug fix,
no design
document gate. No shared mutable state, new worker/cache, persisted/wire
format,
or distributed routing change. The opt-in flag is call-local, and the
existing
deferred directory close covers completion, error, and early iterator
stop.
Default discovery and all its other consumers keep the same behavior and
I/O
shape; no new scan or allocation layer is introduced.
Race/restart/multi-CN
stress is not the discriminating evidence for this sequential selection
change.
No unresolved in-scope review blockers. CI is not waited for.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…ixorigin#28362)

## What type of PR is this?

- [x] BUG
- [x] Test and CI

## Which issue(s) this PR fixes:

Fixes matrixorigin#28270

## What this PR does / why we need it:

Local external-file discovery lists each path component.
`LocalETLFS.List`
previously removed dot-prefixed entries before the planner could match
even an
explicit `.data` component, silently turning existing input into an
empty list.

- Add an opt-in `LocalETLFS.ListWithHidden` backed by the existing
listing loop.
`ReadDir` uses it only when a local path component starts with `.`. This
covers
literal hidden directories/files, dot-prefixed globs, and hidden
components
  after a wildcard.
- Preserve ordinary `List` semantics for every existing consumer,
including
filtering temporary files used by atomic writes. Ordinary `*` still does
not
discover hidden entries. Other filesystem implementations remain
unchanged.
- Keep component-by-component existence/type checks: missing components
match
nothing and do not create directories. Bypassing listing through dynamic
local
filesystem construction would risk creating missing parent directories.
- Cover absolute and named `etl:` paths, returned file
sizes/cardinality,
visible/hidden wildcard controls, directory symlinks, invalid patterns,
cancellation, and file-vs-directory boundaries. Four one-row CSV
fixtures
  support an isolated public LOAD/external-table case.

## Validation

Linux/amd64, Go 1.26.4, controlled native CPU test wrapper; base and
merge-base
`074bc173a5b64ed0ff0b6ad6ab091f478bf76c27` (fresh main).

- Pre-fix `TestReadDirHiddenPaths`: FAIL with missing explicitly
selected files.
  The same regression and nearby controls pass after the fix.
- Focused `TestLocalETLFSListExplicitHiddenEntries` and
`TestReadDirHiddenPaths`: PASS. Final strengthened cardinality oracle
also
  passed after review.
- Owning packages: `mo-cgo-test -count=1 -timeout=10m ./pkg/fileservice
./pkg/sql/plan`
  PASS (30.154s and 5.440s).
- All five Parquet compile tests named in matrixorigin#28270 passed with both TMPDIR
and
GOTMPDIR beneath an explicitly hidden directory. This includes file
fanout,
  empty-file/schema validation, and cancellation consumer paths.
- `make -j8 build`: PASS.
- New `load_hidden_paths.sql`: 17/17 twice on the same standalone
instance,
0.240s and 0.166s, normal comparison mode with independently specified
results.
Zero residual fixture databases/tables and no created `.missing`
directory
  were verified. SQL and ISCP readiness were checked before running.
- Entire `load_data` directory: PASS, 1057 successful, 0 failed, 2
existing
ignored statements, approximately 5s reported case time. No new skips or
weakened assertions. Initial local harness runs lacked LOCAL INFILE
enablement
and output cleanup; both settings were aligned with mo-tester
configuration
  before the successful group run.

The literal CSV LOAD is a compatibility control; external-table scans
exercise
the public `ReadDir` regression, while existing Parquet compile tests
exercise
the LOAD fanout consumer. No additional service fixture was added to UT.

## Pre-PR review

Reviewed all 10 delivery files and the shared closure from public
LOAD/external
scan callers through `ReadDir`, filesystem selection, entry matching,
and iterator
cleanup. R2 local filesystem/public result contract; ordinary bug fix,
no design
document gate. No shared mutable state, new worker/cache, persisted/wire
format,
or distributed routing change. The opt-in flag is call-local, and the
existing
deferred directory close covers completion, error, and early iterator
stop.
Default discovery and all its other consumers keep the same behavior and
I/O
shape; no new scan or allocation layer is introduced.
Race/restart/multi-CN
stress is not the discriminating evidence for this sequential selection
change.
No unresolved in-scope review blockers. CI is not waited for.

This branch was previously deployed

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

Labels

kind/bug Something isn't working kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: LOAD/extern glob silently ignores explicit hidden directory components

2 participants