Skip to content

Apache DataFusion SQL Query Engine

datafusion-cli: document reading partitioned parquet (#15505)

Zaki1e05beae4738
diff --git a/docs/source/user-guide/cli/datasources.md b/docs/source/user-guide/cli/datasources.md
index 39172e94e5..2e14f1f54c 100644
--- a/docs/source/user-guide/cli/datasources.md
+++ b/docs/source/user-guide/cli/datasources.md
@@ -95,8 +95,7 @@ additional configuration options.
# `CREATE EXTERNAL TABLE`
It is also possible to create a table backed by files or remote locations via
-`CREATE EXTERNAL TABLE` as shown below. Note that wildcards (e.g. `*`) are also
-supported
+`CREATE EXTERNAL TABLE` as shown below. Note that DataFusion does not support wildcards (e.g. `*`) in file paths; instead, specify the directory path directly to read all compatible files in that directory.
For example, to create a table `hits` backed by a local parquet file, use:
@@ -126,6 +125,32 @@ select count(*) from hits;
1 row in set. Query took 0.344 seconds.
```
+**Why Wildcards Are Not Supported**
+
+Although wildcards (e.g., _.parquet or \*\*/_.parquet) may work for local filesystems in some cases, they are not officially supported by DataFusion. This is because wildcards are not universally applicable across all storage backends (e.g., S3, GCS). Instead, DataFusion expects the user to specify the directory path, and it will automatically read all compatible files within that directory.
+
+For example, the following usage is not supported:
+
+```sql
+CREATE EXTERNAL TABLE test (
+ message TEXT,
+ day DATE
+)
+STORED AS PARQUET
+LOCATION 'gs://bucket/*.parquet';
+```
+
+Instead, you should use:
+
+```sql
+CREATE EXTERNAL TABLE test (
+ message TEXT,
+ day DATE
+)
+STORED AS PARQUET
+LOCATION 'gs://bucket/my_table';
+```
+
# Formats
## Parquet
@@ -149,14 +174,6 @@ STORED AS PARQUET
LOCATION '/mnt/nyctaxi/';
```
-Register a single folder parquet datasource by specifying a wildcard for files to read
-
-```sql
-CREATE EXTERNAL TABLE taxi
-STORED AS PARQUET
-LOCATION '/mnt/nyctaxi/*.parquet';
-```
-
## CSV
DataFusion will infer the CSV schema automatically or you can provide it explicitly.