Skip to content

Commit 2639fe0

Browse files
authored
Add documentation for SHOW FUNCTIONS (#13868)
1 parent 8c48a8c commit 2639fe0

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

docs/source/user-guide/sql/information_schema.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
DataFusion supports showing metadata about the tables and views available. This information can be accessed using the
2323
views of the ISO SQL `information_schema` schema or the DataFusion specific `SHOW TABLES` and `SHOW COLUMNS` commands.
2424

25-
To show tables in the DataFusion catalog, use the `SHOW TABLES` command or the `information_schema.tables` view:
25+
## `SHOW TABLES`
26+
27+
To show tables in the DataFusion catalog, use the `SHOW TABLES` command or the
28+
`information_schema.tables` view:
2629

2730
```sql
2831
> show tables;
@@ -39,7 +42,10 @@ or
3942

4043
```
4144

42-
To show the schema of a table in DataFusion, use the `SHOW COLUMNS` command or the `information_schema.columns` view:
45+
## `SHOW COLUMNS`
46+
47+
To show the schema of a table in DataFusion, use the `SHOW COLUMNS` command or
48+
the `information_schema.columns` view.
4349

4450
```sql
4551
> show columns from t;
@@ -52,7 +58,10 @@ or
5258
+---------------+--------------+------------+-------------+-----------+-------------+
5359
```
5460

55-
To show the current session configuration options, use the `SHOW ALL` command or the `information_schema.df_settings` view:
61+
## `SHOW ALL` (configuration options)
62+
63+
To show the current session configuration options, use the `SHOW ALL` command or
64+
the `information_schema.df_settings` view:
5665

5766
```sql
5867
select * from information_schema.df_settings;
@@ -65,7 +74,48 @@ select * from information_schema.df_settings;
6574
| datafusion.execution.time_zone | UTC |
6675
| datafusion.explain.logical_plan_only | false |
6776
| datafusion.explain.physical_plan_only | false |
77+
...
6878
| datafusion.optimizer.filter_null_join_keys | false |
6979
| datafusion.optimizer.skip_failed_rules | true |
7080
+-------------------------------------------------+---------+
7181
```
82+
83+
## `SHOW FUNCTIONS`
84+
85+
To show the list of functions available, use the `SHOW FUNCTIONS` command or the
86+
87+
- `information_schema.information_schema.routines` view: functions and descriptions
88+
- `information_schema.information_schema.parameters` view: parameters and descriptions
89+
90+
Syntax:
91+
92+
```sql
93+
SHOW FUNCTIONS [ LIKE <pattern> ];
94+
```
95+
96+
Example output
97+
98+
```sql
99+
> show functions like '%datetrunc';
100+
+---------------+-------------------------------------+-------------------------+-------------------------------------------------+---------------+-------------------------------------------------------+-----------------------------------+
101+
| function_name | return_type | parameters | parameter_types | function_type | description | syntax_example |
102+
+---------------+-------------------------------------+-------------------------+-------------------------------------------------+---------------+-------------------------------------------------------+-----------------------------------+
103+
| datetrunc | Timestamp(Microsecond, Some("+TZ")) | [precision, expression] | [Utf8, Timestamp(Microsecond, Some("+TZ"))] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
104+
| datetrunc | Timestamp(Nanosecond, None) | [precision, expression] | [Utf8View, Timestamp(Nanosecond, None)] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
105+
| datetrunc | Timestamp(Second, Some("+TZ")) | [precision, expression] | [Utf8View, Timestamp(Second, Some("+TZ"))] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
106+
| datetrunc | Timestamp(Microsecond, None) | [precision, expression] | [Utf8View, Timestamp(Microsecond, None)] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
107+
| datetrunc | Timestamp(Second, None) | [precision, expression] | [Utf8View, Timestamp(Second, None)] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
108+
| datetrunc | Timestamp(Microsecond, None) | [precision, expression] | [Utf8, Timestamp(Microsecond, None)] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
109+
| datetrunc | Timestamp(Second, None) | [precision, expression] | [Utf8, Timestamp(Second, None)] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
110+
| datetrunc | Timestamp(Microsecond, Some("+TZ")) | [precision, expression] | [Utf8View, Timestamp(Microsecond, Some("+TZ"))] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
111+
| datetrunc | Timestamp(Nanosecond, Some("+TZ")) | [precision, expression] | [Utf8, Timestamp(Nanosecond, Some("+TZ"))] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
112+
| datetrunc | Timestamp(Millisecond, None) | [precision, expression] | [Utf8, Timestamp(Millisecond, None)] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
113+
| datetrunc | Timestamp(Millisecond, Some("+TZ")) | [precision, expression] | [Utf8, Timestamp(Millisecond, Some("+TZ"))] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
114+
| datetrunc | Timestamp(Second, Some("+TZ")) | [precision, expression] | [Utf8, Timestamp(Second, Some("+TZ"))] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
115+
| datetrunc | Timestamp(Nanosecond, None) | [precision, expression] | [Utf8, Timestamp(Nanosecond, None)] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
116+
| datetrunc | Timestamp(Millisecond, None) | [precision, expression] | [Utf8View, Timestamp(Millisecond, None)] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
117+
| datetrunc | Timestamp(Millisecond, Some("+TZ")) | [precision, expression] | [Utf8View, Timestamp(Millisecond, Some("+TZ"))] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
118+
| datetrunc | Timestamp(Nanosecond, Some("+TZ")) | [precision, expression] | [Utf8View, Timestamp(Nanosecond, Some("+TZ"))] | SCALAR | Truncates a timestamp value to a specified precision. | date_trunc(precision, expression) |
119+
+---------------+-------------------------------------+-------------------------+-------------------------------------------------+---------------+-------------------------------------------------------+-----------------------------------+
120+
16 row(s) fetched.
121+
```

0 commit comments

Comments
 (0)