You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2023/04/16 10:40:17 UTC

[GitHub] [arrow-datafusion] Jefffrey opened a new pull request, #6025: Update sql doc

Jefffrey opened a new pull request, #6025:
URL: https://github.com/apache/arrow-datafusion/pull/6025

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   # Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   Update sql doc and do some touching up
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb merged pull request #6025: Update sql doc

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6025:
URL: https://github.com/apache/arrow-datafusion/pull/6025


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on pull request #6025: Update sql doc

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #6025:
URL: https://github.com/apache/arrow-datafusion/pull/6025#issuecomment-1511082422

   > @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: https://github.com/apache/arrow-datafusion/issues/3092
   
   There probably needs to be more too


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] Jefffrey commented on a diff in pull request #6025: Update sql doc

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on code in PR #6025:
URL: https://github.com/apache/arrow-datafusion/pull/6025#discussion_r1167817065


##########
datafusion/expr/src/aggregate_function.rs:
##########
@@ -77,30 +77,34 @@ impl FromStr for AggregateFunction {
     type Err = DataFusionError;
     fn from_str(name: &str) -> Result<AggregateFunction> {
         Ok(match name {
-            "min" => AggregateFunction::Min,
-            "max" => AggregateFunction::Max,
-            "count" => AggregateFunction::Count,
+            // general

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



##########
datafusion/expr/src/built_in_function.rs:
##########
@@ -313,12 +313,13 @@ impl FromStr for BuiltinScalarFunction {
             // math functions
             "abs" => BuiltinScalarFunction::Abs,
             "acos" => BuiltinScalarFunction::Acos,
-            "asin" => BuiltinScalarFunction::Asin,
-            "atan" => BuiltinScalarFunction::Atan,
             "acosh" => BuiltinScalarFunction::Acosh,
+            "asin" => BuiltinScalarFunction::Asin,

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] comphead commented on pull request #6025: Update sql doc

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on PR #6025:
URL: https://github.com/apache/arrow-datafusion/pull/6025#issuecomment-1510445898

   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!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] comphead commented on a diff in pull request #6025: Update sql doc

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #6025:
URL: https://github.com/apache/arrow-datafusion/pull/6025#discussion_r1167988576


##########
docs/source/user-guide/sql/select.md:
##########
@@ -153,6 +153,20 @@ either side of the join where there is not a match.
 +----------+----------+----------+----------+
 ```
 
+### NATURAL JOIN

Review Comment:
   +1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6025: Update sql doc

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6025:
URL: https://github.com/apache/arrow-datafusion/pull/6025#discussion_r1168491345


##########
docs/source/user-guide/sql/select.md:
##########
@@ -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`.

Review Comment:
   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 |
   ```



##########
docs/source/user-guide/sql/ddl.md:
##########
@@ -19,6 +19,32 @@
 
 # DDL
 
+## CREATE DATABASE
+
+Create catalog with specified name.
+
+<pre>
+CREATE DATABASE [ IF NOT EXISTS ] <i><b>catalog</i></b>
+</pre>
+
+```sql
+-- create catalog cat
+CREATE DATABASE cat;
+```
+
+## CREATE SCHEMA
+
+Create schema under specified catalog, or the default DataFusion catalog if not specified.
+
+<pre>
+CREATE SCHEMA [ IF NOT EXISTS ] [ <i><b>catalog.</i></b> ] <b><i>schema_name</i></b>
+</pre>
+
+```sql
+-- create schema emu under catalog cat
+CREATE SCHEMA cat.emu;
+```

Review Comment:
   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.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org