prestodb/presto · error · PrestoException

LOCAL_FILE_NO_FILES

LOCAL_FILE_NO_FILES

Error message

No matching files found in directory: " + location

What it means

DataLocation.files() found no files matching the configured glob pattern in the directory for a local-file catalog table. The location exists and is a directory, but the pattern matched nothing, so there is no data to read.

Solutions

  1. Verify files exist in the directory and their names match the table's filename pattern property
  2. Fix the table definition's location/pattern in the local-file connector config
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-local-file/src/main/java/com/facebook/presto/localfile/DataLocation.java:93 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/9a80b16dbbb1dd67. Report an issue: GitHub.

Appendix: source

Thrown at presto-local-file/src/main/java/com/facebook/presto/localfile/DataLocation.java:93

    public List<File> files()
    {
        checkState(location.exists(), "location %s doesn't exist", location);
        if (!pattern.isPresent()) {
            return ImmutableList.of(location);
        }

        checkState(location.isDirectory(), "location %s is not a directory", location);

        try (DirectoryStream<Path> paths = newDirectoryStream(location.toPath(), pattern.get())) {
            ImmutableList.Builder<File> builder = ImmutableList.builder();
            for (Path path : paths) {
                builder.add(path.toFile());
            }
            List<File> files = builder.build();

            if (files.isEmpty()) {
                throw new PrestoException(LOCAL_FILE_NO_FILES, "No matching files found in directory: " + location);
            }
            return files.stream()
                    .sorted((o1, o2) -> Long.compare(o2.lastModified(), o1.lastModified()))
                    .collect(Collectors.toList());
        }
        catch (IOException e) {
            throw new PrestoException(LOCAL_FILE_FILESYSTEM_ERROR, "Error listing files in directory: " + location, e);
        }
    }
}

View on GitHub (pinned to 55bb57d202)