Skip to content

Commit

Permalink
fix#9501 (#10028)
Browse files Browse the repository at this point in the history
  • Loading branch information
colommar committed Apr 11, 2024
1 parent 7dc20b8 commit feb9100
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 73 deletions.
4 changes: 2 additions & 2 deletions benchmarks/queries/clickbench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ LIMIT 10;
Here are some interesting statistics about the data used in the queries
Max length of `"SearchPhrase"` is 1113 characters
```sql
select min(length("SearchPhrase")) as "SearchPhrase_len_min", max(length("SearchPhrase")) "SearchPhrase_len_max" from 'hits.parquet' limit 10;
> select min(length("SearchPhrase")) as "SearchPhrase_len_min", max(length("SearchPhrase")) "SearchPhrase_len_max" from 'hits.parquet' limit 10;
+----------------------+----------------------+
| SearchPhrase_len_min | SearchPhrase_len_max |
+----------------------+----------------------+
Expand All @@ -74,7 +74,7 @@ Max length of `"SearchPhrase"` is 1113 characters

Here is the schema of the data
```sql
describe 'hits.parquet';
> describe 'hits.parquet';
+-----------------------+-----------+-------------+
| column_name | data_type | is_nullable |
+-----------------------+-----------+-------------+
Expand Down
2 changes: 1 addition & 1 deletion datafusion-cli/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub async fn exec_from_repl(
rl.load_history(".history").ok();

loop {
match rl.readline(" ") {
match rl.readline("> ") {
Ok(line) if line.starts_with('\\') => {
rl.add_history_entry(line.trim_end())?;
let command = line.split_whitespace().collect::<Vec<_>>().join(" ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ mod tests {
/// Return a test for data_index_bloom_encoding_stats.parquet
/// Note the values in the `String` column are:
/// ```sql
/// select * from './parquet-testing/data/data_index_bloom_encoding_stats.parquet';
/// > select * from './parquet-testing/data/data_index_bloom_encoding_stats.parquet';
/// +-----------+
/// | String |
/// +-----------+
Expand Down
2 changes: 1 addition & 1 deletion datafusion/expr/src/logical_plan/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,7 @@ pub struct Prepare {
/// # Example output:
///
/// ```sql
/// describe traces;
/// > describe traces;
/// +--------------------+-----------------------------+-------------+
/// | column_name | data_type | is_nullable |
/// +--------------------+-----------------------------+-------------+
Expand Down
10 changes: 5 additions & 5 deletions datafusion/optimizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Every expression in DataFusion has a name, which is used as the column name. For
contains a single column with the name `"COUNT(aggregate_test_100.c9)"`:

```text
select count(c9) from aggregate_test_100;
> select count(c9) from aggregate_test_100;
+------------------------------+
| COUNT(aggregate_test_100.c9) |
+------------------------------+
Expand All @@ -116,7 +116,7 @@ These names are used to refer to the columns in both subqueries as well as inter
to another. For example:

```text
select "COUNT(aggregate_test_100.c9)" + 1 from (select count(c9) from aggregate_test_100) as sq;
> select "COUNT(aggregate_test_100.c9)" + 1 from (select count(c9) from aggregate_test_100) as sq;
+--------------------------------------------+
| sq.COUNT(aggregate_test_100.c9) + Int64(1) |
+--------------------------------------------+
Expand All @@ -134,7 +134,7 @@ Here is a simple example of such a rewrite. The expression `1 + 2` can be intern
displayed the same as `1 + 2`:

```text
select 1 + 2;
> select 1 + 2;
+---------------------+
| Int64(1) + Int64(2) |
+---------------------+
Expand All @@ -146,7 +146,7 @@ Looking at the `EXPLAIN` output we can see that the optimizer has effectively re
`3 as "1 + 2"`:

```text
explain select 1 + 2;
> explain select 1 + 2;
+---------------+-------------------------------------------------+
| plan_type | plan |
+---------------+-------------------------------------------------+
Expand Down Expand Up @@ -289,7 +289,7 @@ The `EXPLAIN VERBOSE` command can be used to show the effect of each optimizatio
In the following example, the `type_coercion` and `simplify_expressions` passes have simplified the plan so that it returns the constant `"3.2"` rather than doing a computation at execution time.

```text
explain verbose select cast(1 + 2.2 as string) as foo;
> explain verbose select cast(1 + 2.2 as string) as foo;
+------------------------------------------------------------+---------------------------------------------------------------------------+
| plan_type | plan |
+------------------------------------------------------------+---------------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion docs/source/library-user-guide/adding-udfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ Because we're returning a `TableProvider`, in this example we'll use the `MemTab
While this is a simple example for illustrative purposes, UDTFs have a lot of potential use cases. And can be particularly useful for reading data from external sources and interactive analysis. For example, see the [example][4] for a working example that reads from a CSV file. As another example, you could use the built-in UDTF `parquet_metadata` in the CLI to read the metadata from a Parquet file.

```console
select filename, row_group_id, row_group_num_rows, row_group_bytes, stats_min, stats_max from parquet_metadata('./benchmarks/data/hits.parquet') where column_id = 17 limit 10;
> select filename, row_group_id, row_group_num_rows, row_group_bytes, stats_min, stats_max from parquet_metadata('./benchmarks/data/hits.parquet') where column_id = 17 limit 10;
+--------------------------------+--------------+--------------------+-----------------+-----------+-----------+
| filename | row_group_id | row_group_num_rows | row_group_bytes | stats_min | stats_max |
+--------------------------------+--------------+--------------------+-----------------+-----------+-----------+
Expand Down
20 changes: 10 additions & 10 deletions docs/source/user-guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Query that single file (the CLI also supports parquet, compressed csv, avro, jso
```shell
$ datafusion-cli
DataFusion CLI v17.0.0
select * from 'data.csv';
> select * from 'data.csv';
+---+---+
| a | b |
+---+---+
Expand All @@ -184,7 +184,7 @@ data.csv data2.csv
```shell
$ datafusion-cli
DataFusion CLI v16.0.0
select * from 'data_dir';
> select * from 'data_dir';
+---+---+
| a | b |
+---+---+
Expand Down Expand Up @@ -335,9 +335,9 @@ $ export AWS_ACCESS_KEY_ID=******

$ datafusion-cli
DataFusion CLI v21.0.0
create external table test stored as parquet location 's3://bucket/path/file.parquet';
> create external table test stored as parquet location 's3://bucket/path/file.parquet';
0 rows in set. Query took 0.374 seconds.
select * from test;
> select * from test;
+----------+----------+
| column_1 | column_2 |
+----------+----------+
Expand Down Expand Up @@ -429,9 +429,9 @@ $ export GOOGLE_SERVICE_ACCOUNT=/tmp/gcs.json

$ datafusion-cli
DataFusion CLI v21.0.0
create external table test stored as parquet location 'gs://bucket/path/file.parquet';
> create external table test stored as parquet location 'gs://bucket/path/file.parquet';
0 rows in set. Query took 0.374 seconds.
select * from test;
> select * from test;
+----------+----------+
| column_1 | column_2 |
+----------+----------+
Expand Down Expand Up @@ -619,7 +619,7 @@ appropriately:
```shell
$ DATAFUSION_EXECUTION_BATCH_SIZE=1024 datafusion-cli
DataFusion CLI v12.0.0
show all;
> show all;
+-------------------------------------------------+---------+
| name | value |
+-------------------------------------------------+---------+
Expand All @@ -639,18 +639,18 @@ You can change the configuration options using `SET` statement as well
```shell
$ datafusion-cli
DataFusion CLI v13.0.0
show datafusion.execution.batch_size;
> show datafusion.execution.batch_size;
+---------------------------------+---------+
| name | value |
+---------------------------------+---------+
| datafusion.execution.batch_size | 8192 |
+---------------------------------+---------+
1 row in set. Query took 0.011 seconds.
set datafusion.execution.batch_size to 1024;
> set datafusion.execution.batch_size to 1024;
0 rows in set. Query took 0.000 seconds.
show datafusion.execution.batch_size;
> show datafusion.execution.batch_size;
+---------------------------------+---------+
| name | value |
+---------------------------------+---------+
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user-guide/example-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Set environment [variables](https://doc.rust-lang.org/std/backtrace/index.html#e
```bash
RUST_BACKTRACE=1 ./target/debug/datafusion-cli
DataFusion CLI v31.0.0
select row_numer() over (partition by a order by a) from (select 1 a);
> select row_numer() over (partition by a order by a) from (select 1 a);
Error during planning: Invalid function 'row_numer'.
Did you mean 'ROW_NUMBER'?

Expand Down
Loading

0 comments on commit feb9100

Please sign in to comment.