# Filename Globbing and Container Formation

Source: https://userguide.qualytics.io/source-datastore/datastore/deep-dive/filename-globbing/

> **Warning: DFS connectors only**
>
> This page applies to datastores on **DFS** connectors (Amazon S3, Azure Data Lake Storage, and Google Cloud Storage), which group files into containers by name pattern. JDBC and Native connectors read tables, collections, or objects, so filename globbing does not apply to them. See [Supported Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/supported-connectors/#dfs-connectors).

Filenames with similar structures in the same folder are automatically included in a single globbed container during the Sync operation.

## Use Folders for Precise File Grouping

Organizing files within distinct folders is a straightforward and effective strategy in Distributed File Systems (DFS).

When all files in a folder share a common schema, it simplifies the process of grouping and managing them.

This approach ensures precise file grouping without relying on complex glob patterns.

### How to Use Folders for Shared Schema

#### 1. **Create a Folder:**

> **Example: Begin by creating a new folder in your distributed file system.**
>
> - Suppose you have order data files with filenames like `orders_20240229.csv`, `orders-20240228.csv`, `orders-20240227.csv`.
> - Create a folder named `Orders` to group these files.
>
> **Qualytics Pattern:** Qualytics will automatically create the container `orders_*.csv` based on the filenames.

#### 2. **Place Related Files in the Folder:**

> **Example: Move or upload files that share a common schema into the created folder.**
>
> - Move the order data files into the `Orders` folder.

#### 3. **Repeat for Each Schema:**

> **Example: Create separate folders for different schemas, and organize files accordingly.**
>
> - Suppose you have customer data files with filenames like `customers_us.csv`, `customers_eu.csv`.
> - Create a folder named `Customers` to group these files.
>
> **Qualytics Pattern:** Qualytics will automatically create the pattern `customers_*.csv` based on the filenames.

#### 4. **Naming Conventions:**

> **Example: Consider adopting clear and consistent naming conventions for folders to enhance organization.**
>
> - Use descriptive names for folders, such as `Orders`, `Customers`, to make it easier to identify the contents.

##### Flowchart: Using Folders for Shared Schema

```mermaid
graph TD
  A[Start] -->|Create a Folder| B(Create Folder)
  B -->|Place Related Files| C(Move or Upload Files)
  C -->|Repeat for Each Schema| D(Create Separate Folders)
  D -->|Naming Conventions| E(Consider Clear Naming)
  E --> F[End]
```

## Use Filename Conventions for Posix Globs

This option leverages filename conventions that align with POSIX globs, allowing the system to automatically organize files for you.

The system intelligently analyzes filename patterns, making the process seamless and efficient.

### How to Use Filename Conventions for Posix Globs

#### 1. **Follow Clear Filename Conventions:**

> **Example: Adopt clear and consistent filename conventions that lend themselves to POSIX globs.**
>
> - Suppose you have log files with filenames like `app_log_20240229.txt`, `app_log_20240228.txt`, `app_log_20240227.txt`.
> - Use a consistent naming convention like `app_log_*.txt`, where `*` serves as a placeholder for varying elements.
> - ***The `*` in the convention acts as a wildcard, representing any variation in the filename. In this example, it matches the date part (`20240229`, `20240228`, etc.).***

#### 2. **Upload or Move Files:**

> **Example: Upload or move files with filenames following the adopted conventions to your distributed file system.**
>
> - Move log files with the specified naming convention to your DFS.

#### 3. **System Analysis:**

> **Example: The system will automatically detect and analyze the filename conventions, creating appropriate glob patterns.**
>
> - With filenames like `app_log_20240229.txt`, `app_log_20240228.txt`, the system will create the pattern `app_log_*.txt`.

#### Flowchart: Using Folders for Filename Conventions

```mermaid
graph TD
  A[Start] -->|Follow Clear Conventions| B(Adopt Consistent Conventions)
  B -->|Upload or Move Files| C(Move Files to DFS)
  C -->|System Analysis| D(Automatic Pattern Creation)
  D --> E[End]
```

## Why Not Manually Create Your Own Globs?

While the system offers powerful features to automate file organization, manually creating globs is strongly discouraged.

This option may lead to errors, inconsistencies, and hinder the efficiency of the system.

It is recommended to leverage the automated tools for a seamless and error-free experience.

### Complexity and Error-Prone

> **Warning: Manually creating globs can be complex, prone to typos, and susceptible to errors in pattern formation.**
>
> - Suppose you want to group log files with the pattern `app_log_*.txt`. A manual attempt might result in mistakes like `app_log_202*.txt` or `app_log_*.tx`.

### Inconsistencies Across Files

> **Warning: Manual glob creation may lead to inconsistencies across different files, making it challenging to establish a uniform file organization.**
>
> - Trying to manually create globs for order data files with varying date formats (`orders_20240229.csv`, `orders-20240228.csv`) can result in inconsistent patterns.

## Explore Deeper Knowledge

If you want to go deeper into the knowledge or if you are curious and want to learn more about DFS filename globbing, you can explore our comprehensive guide here: [How DFS Filename Globbing Works](https://userguide.qualytics.io/dfs-globbing/how-dfs-filename-globbing-works/).

> **Info: Understanding DFS**
>
> For a broader overview of DFS datastores in Qualytics, see the [Understanding DFS](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/dfs/) page.

---

## See Also

- **HashiCorp Vault**

  Pull connection credentials from a secrets manager instead of typing them in.

  [HashiCorp Vault](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/hashicorp-vault/)
- **Examples**

  Real scenarios, from onboarding a warehouse to protecting a busy database.

  [Examples](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/examples/)
- **Best Practices**

  Recommendations for scoping datastores, sharing connections, and keeping access tight.

  [Best Practices](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/best-practices/)
- **Permissions**

  The role and team permission each datastore action needs.

  [Permissions](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/permissions/)
- **How It Works**

  How a datastore maps to your storage, the layers behind it, the lifecycle, and the Timeline.

  [How It Works](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/how-it-works/)
- **Connection**

  How a connection holds the credentials that one or more datastores share.

  [Connection](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/connection/)
- **Multiple-Schema**

  Create one datastore per schema or folder from a single connection.

  [Multiple-Schema](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/multiple-schema/)
- **Supported Connectors**

  Every connector by family, with its enrichment support and multi-schema fields.

  [Supported Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/supported-connectors/)
- **JDBC Connectors**

  How Qualytics reads relational databases and warehouses through JDBC.

  [JDBC Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/jdbc/)
- **DFS Connectors**

  How Qualytics reads files from cloud object storage and distributed file systems.

  [DFS Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/dfs/)
- **Native Connectors**

  How Qualytics reads a platform's own storage or API without its query engine.

  [Native Connectors](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/native/)
- **Supported File Formats**

  The file formats DFS datastores read, including compressed variants.

  [Supported File Formats](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/supported-file-formats/)

*Last updated: November 16, 2026.*
