datafusion
datafusion copied to clipboard
docs: update parquet_sql_multiple_files.rs with a relative path ex
Which issue does this PR close?
Related to #9280, but not sure if it'd technically close it.
Rationale for this change
It's easy to get tripped up when querying the local file system if you aren't using absolute paths because by default there's a local file system registered at file://, so nothing needs to be done for absolute paths. But if you want to query with relative paths, you first need to register an ObjectStore, so this example shows that.
An alternative might be to also register file://./ by default, but I'm not sure all the consequences of that. Or perhaps something easy like ctx.register_cwd()?
What changes are included in this PR?
Updates the example.
Are these changes tested?
Yes, running:
arrow-datafusion update-p… ➜ cargo run --example parquet_sql_multiple_files
Finished dev [unoptimized + debuginfo] target(s) in 0.38s
Running `target/debug/examples/parquet_sql_multiple_files`
+----+----------+-------------+--------------+---------+------------+-----------+------------+------------------+------------+---------------------+
| id | bool_col | tinyint_col | smallint_col | int_col | bigint_col | float_col | double_col | date_string_col | string_col | timestamp_col |
+----+----------+-------------+--------------+---------+------------+-----------+------------+------------------+------------+---------------------+
| 4 | true | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 30332f30312f3039 | 30 | 2009-03-01T00:00:00 |
+----+----------+-------------+--------------+---------+------------+-----------+------------+------------------+------------+---------------------+
+----+----------+-------------+--------------+---------+------------+-----------+------------+------------------+------------+---------------------+
| id | bool_col | tinyint_col | smallint_col | int_col | bigint_col | float_col | double_col | date_string_col | string_col | timestamp_col |
+----+----------+-------------+--------------+---------+------------+-----------+------------+------------------+------------+---------------------+
| 4 | true | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 30332f30312f3039 | 30 | 2009-03-01T00:00:00 |
+----+----------+-------------+--------------+---------+------------+-----------+------------+------------------+------------+---------------------+
Are there any user-facing changes?
Insofar as it's a doc-related update.