You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`DECIMAL(precision,scale)`|`Decimal128(precision,scale)`| Decimal support is currently experimental ([#3523](https://github.com/apache/arrow-datafusion/issues/3523)) |
|`DECIMAL(precision,scale)`|`Decimal128(precision,scale)`| Decimal support is currently experimental ([#3523](https://github.com/apache/arrow-datafusion/issues/3523)) |
Copy file name to clipboardExpand all lines: docs/source/user-guide/sql/ddl.md
+30-4Lines changed: 30 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,32 @@
19
19
20
20
# DDL
21
21
22
+
## CREATE DATABASE
23
+
24
+
Create catalog with specified name.
25
+
26
+
<pre>
27
+
CREATE DATABASE [ IF NOT EXISTS ] <i><b>catalog</i></b>
28
+
</pre>
29
+
30
+
```sql
31
+
-- create catalog cat
32
+
CREATEDATABASEcat;
33
+
```
34
+
35
+
## CREATE SCHEMA
36
+
37
+
Create schema under specified catalog, or the default DataFusion catalog if not specified.
38
+
39
+
<pre>
40
+
CREATE SCHEMA [ IF NOT EXISTS ] [ <i><b>catalog.</i></b> ] <b><i>schema_name</i></b>
41
+
</pre>
42
+
43
+
```sql
44
+
-- create schema emu under catalog cat
45
+
CREATESCHEMAcat.emu;
46
+
```
47
+
22
48
## CREATE EXTERNAL TABLE
23
49
24
50
Parquet data sources can be registered by executing a `CREATE EXTERNAL TABLE` SQL statement. It is not necessary
@@ -67,7 +93,7 @@ When creating an output from a data source that is already ordered by an express
67
93
the data using the `WITH ORDER` clause. This applies even if the expression used for sorting is complex,
68
94
allowing for greater flexibility.
69
95
70
-
Here's an example of how to use `WITH ORDER`query
96
+
Here's an example of how to use `WITH ORDER`clause.
71
97
72
98
```sql
73
99
CREATE EXTERNAL TABLE test (
@@ -91,14 +117,14 @@ WITH ORDER (c2 ASC, c5 + c8 DESC NULL FIRST)
91
117
LOCATION '/path/to/aggregate_test_100.csv';
92
118
```
93
119
94
-
where`WITH ORDER` clause specifies the sort order:
120
+
Where`WITH ORDER` clause specifies the sort order:
95
121
96
122
```sql
97
123
WITH ORDER (sort_expression1 [ASC | DESC] [NULLS { FIRST | LAST }]
98
124
[, sort_expression2 [ASC | DESC] [NULLS { FIRST | LAST }] ...])
99
125
```
100
126
101
-
### Cautions When Using the WITH ORDER Clause
127
+
### Cautions when using the WITH ORDER Clause
102
128
103
129
- It's important to understand that using the `WITH ORDER` clause in the `CREATE EXTERNAL TABLE` statement only specifies the order in which the data should be read from the external file. If the data in the file is not already sorted according to the specified order, then the results may not be correct.
104
130
@@ -153,7 +179,7 @@ DROP TABLE IF EXISTS nonexistent_table;
153
179
View is a virtual table based on the result of a SQL query. It can be created from an existing table or values list.
154
180
155
181
<pre>
156
-
CREATE VIEW <i><b>view_name</b></i> AS statement;
182
+
CREATE [ OR REPLACE ] VIEW <i><b>view_name</b></i> AS statement;
0 commit comments