---
title: "Glob pattern"
description: "A glob pattern is a wildcard-based string pattern, using characters like `*` and `?`, used to match multiple filenames or paths at once instead of listing them individually."
canonical: "https://motherduck.com/glossary/glob-pattern/"
related:
  - title: "Delta Lake | MotherDuck Docs"
    url: "https://motherduck.com/docs/integrations/file-formats/delta-lake/"
  - title: "SQL Golf: 5 SQL Tricks You Should (Probably) Never Use"
    url: "https://motherduck.com/blog/its-a-sql-golf-quackmas/"
  - title: "INCLUDE_PATTERN clause | MotherDuck Docs"
    url: "https://motherduck.com/docs/sql-reference/motherduck-sql-reference/include-pattern/"
gated_asset:
  title: "DuckLake on MotherDuck"
  url: "https://motherduck.com/product/ducklake/"
---

# Glob pattern

> A glob pattern is a wildcard-based string pattern, using characters like `*` and `?`, used to match multiple filenames or paths at once instead of listing them individually.

## Overview

Glob patterns are a shorthand syntax for matching sets of file paths using wildcard characters, originally from Unix shells and now used across most programming languages and tools that work with the filesystem. The most common wildcards are `*` (matches any sequence of characters within a path segment), `**` (matches recursively across directories, in tools that support it), and `?` (matches a single character). Rather than enumerating every file explicitly, a glob pattern lets you describe a shape that many files share.

## Glob patterns in DuckDB

DuckDB accepts glob patterns anywhere a file path is expected in functions like `read_parquet`, `read_csv`, and `read_json`, which is the standard way to query many files as a single logical table.

```sql
-- all Parquet files in a directory
SELECT * FROM read_parquet('data/*.parquet');

-- recursive match across subdirectories
SELECT * FROM read_parquet('data/**/*.parquet');

-- multiple explicit patterns
SELECT * FROM read_parquet(['data/2026-01/*.parquet', 'data/2026-02/*.parquet']);
```

Adding `filename := true` (or the `filename` parameter, depending on version) to these functions attaches a column indicating which source file each row came from, which is useful for auditing or partition-aware filtering.

## A caveat with object storage

When reading from S3 via the `httpfs` extension, the `?` single-character wildcard is not supported due to how it interacts with HTTP URL encoding — only `*` is reliably supported for S3 paths. Local and HTTP(S) filesystems don't have this restriction. Combining glob patterns with DuckDB's Hive-style partition detection (recognizing `key=value` directory structures) is a common pattern for querying partitioned Parquet datasets directly from a data lake.
