Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sql doc #6025

Merged
merged 2 commits into from
Apr 17, 2023
Merged

Update sql doc #6025

merged 2 commits into from
Apr 17, 2023

Conversation

Jefffrey
Copy link
Contributor

@Jefffrey Jefffrey commented Apr 16, 2023

Which issue does this PR close?

Related to #3058

Rationale for this change

Update sql doc and do some touching up

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the logical-expr Logical plan and expressions label Apr 16, 2023
"min" => AggregateFunction::Min,
"max" => AggregateFunction::Max,
"count" => AggregateFunction::Count,
// general
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just reorganizing, to be similar to how it looks in the sql doc, and group them together here a bit better

"acosh" => BuiltinScalarFunction::Acosh,
"asin" => BuiltinScalarFunction::Asin,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -153,6 +153,20 @@ either side of the join where there is not a match.
+----------+----------+----------+----------+
```

### NATURAL JOIN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR @Jefffrey.
@alamb I think going fwd we need to check doc update as part of review, to keep documentation in sync.
To be honest I cant' even imagine how hard it was to sync the code and documentation!

@comphead
Copy link
Contributor

Thanks for PR @Jefffrey.
@alamb I think going fwd we need to check doc update as part of review, to keep documentation in sync.
To be honest I cant' even imagine how hard it was to sync the code and documentation!

@alamb
Copy link
Contributor

alamb commented Apr 17, 2023

@alamb I think going fwd we need to check doc update as part of review, to keep documentation in sync.
To be honest I cant' even imagine how hard it was to sync the code and documentation!

Yes I agree -- thank you @Jefffrey

I don't have a good story for keeping the docs in sync. I will try and remember to verify the docs / ask for changes, but if we rely on a human process we'll likely always be behind -- automation is our best hope I think.

Here is one idea to keep the function reference more in sync: #3092

There probably needs to be more too

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Jefffrey -- very nice 👏

```sql
-- create schema emu under catalog cat
CREATE SCHEMA cat.emu;
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know this worked ❤️ but I tried it out

8 rows in set. Query took 0.014 seconds.
❯ create table cat.emu.dog(x int);
0 rows in set. Query took 0.000 seconds.
❯ show tables;
+---------------+--------------------+-------------+------------+
| table_catalog | table_schema       | table_name  | table_type |
+---------------+--------------------+-------------+------------+
| cat           | emu                | dog         | BASE TABLE |
| cat           | information_schema | tables      | VIEW       |
| cat           | information_schema | views       | VIEW       |
| cat           | information_schema | columns     | VIEW       |
| cat           | information_schema | df_settings | VIEW       |
| datafusion    | information_schema | tables      | VIEW       |
| datafusion    | information_schema | views       | VIEW       |
| datafusion    | information_schema | columns     | VIEW       |
| datafusion    | information_schema | df_settings | VIEW       |
+---------------+--------------------+-------------+------------+
9 rows in set. Query took 0.001 seconds.

@@ -83,7 +83,7 @@ SELECT a FROM table WHERE a > 10

## JOIN clause

DataFusion supports `INNER JOIN`, `LEFT OUTER JOIN`, `RIGHT OUTER JOIN`, `FULL OUTER JOIN`, and `CROSS JOIN`.
DataFusion supports `INNER JOIN`, `LEFT OUTER JOIN`, `RIGHT OUTER JOIN`, `FULL OUTER JOIN`, `NATURAL JOIN` and `CROSS JOIN`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also support SEMI JOIN and ANTI Join (can be documented in some other PR)

❯ create table foo(x int) as values (1);
0 rows in set. Query took 0.009 seconds.
❯ create table bar(x int) as values (1);
0 rows in set. Query took 0.001 seconds.
❯ select foo.x from foo left semi join bar using (x);
+---+
| x |
+---+
| 1 |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants