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
Copy file name to clipboardExpand all lines: _posts/2024-09-25-changing-data-with-confidence-and-acid.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ The great quote “Everything changes and nothing stays the same” from [Heracl
12
12
13
13
Static datasets are split-second snapshots of whatever the world looked like at one moment. But very quickly, the world moves on, and the dataset needs to catch up to remain useful. In the world of tables, new rows can be added, old rows may be deleted and sometimes rows have to be changed to reflect a new situation. Often, changes are interconnected. A row in a table that maps orders to customers is not very useful without the corresponding entry in the `orders` table. Most, if not all, datasets eventually get changed. As a data management system, managing change is thus not optional. However, managing changes properly is difficult.
14
14
15
+
## ACID Guarantees
16
+
15
17
Early data management systems researchers invented a concept called “transactions”, the notions of which were [first formalized](https://dl.acm.org/doi/abs/10.5555/48751.48761)[in the 1980s](https://dl.acm.org/doi/10.1145/289.291). In essence, transactionality and the well-known ACID principles describe a set of guarantees that a data management system has to provide in order to be considered safe. ACID is an acronym that stands for Atomicity, Consistency, Isolation and Durability.
16
18
17
19
The ACID principles are not a theoretical exercise. Much like the rules governing airplanes or trains, they have been “written in blood” – they are hard-won lessons from decades of data management practice. It is very hard for an application to reason correctly when dealing with non-ACID systems. The end result of such problems is often corrupted data or data that no longer reflects reality accurately. For example, rows can be duplicated or missing.
Copy file name to clipboardExpand all lines: docs/stable/core_extensions/iceberg/iceberg_rest_catalogs.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ To see the available tables run
45
45
SHOW ALL TABLES;
46
46
```
47
47
48
-
### ATTACH OPTIONS
48
+
##`ATTACH` Options
49
49
50
50
A REST Catalog with OAuth2 authorization can also be attached with just an `ATTACH` statement. See the complete list of `ATTACH` options for a REST catalog below.
Copy file name to clipboardExpand all lines: docs/stable/data/json/sql_to_and_from_json.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ If you run the `json_execute_serialized_sql(varchar)` table function inside of a
20
20
21
21
Note that these functions do not preserve syntactic sugar such as `FROM * SELECT ...`, so a statement round-tripped through `json_deserialize_sql(json_serialize_sql(...))` may not be identical to the original statement, but should always be semantically equivalent and produce the same output.
Copy file name to clipboardExpand all lines: docs/stable/sql/data_types/enum.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -242,4 +242,4 @@ DROP TYPE ⟨enum_name⟩;
242
242
243
243
Currently, it is possible to drop enums that are used in tables without affecting the tables.
244
244
245
-
> Warning This behavior of the enum removal feature is subject to change. In future releases, it is expected that any dependent columns must be removed before dropping the enum, or the enum must be dropped with the additional `CASCADE` parameter.
245
+
> Warning This behavior of the enum removal feature is subject to change. In future releases, it is expected that any dependent columns must be removed before dropping the enum, or the enum must be dropped with the additional `CASCADE` parameter.
Copy file name to clipboardExpand all lines: docs/stable/sql/data_types/struct.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Conceptually, a `STRUCT` column contains an ordered list of columns called “en
13
13
14
14
See the [data types overview]({% link docs/stable/sql/data_types/overview.md %}) for a comparison between nested data types.
15
15
16
-
###Creating Structs
16
+
## Creating Structs
17
17
18
18
Structs can be created using the [`struct_pack(name := expr, ...)`]({% link docs/stable/sql/functions/struct.md %}) function, the equivalent array notation `{'name': expr, ...}`, using a row variable, or using the `row` function.
19
19
@@ -63,7 +63,7 @@ SELECT {
63
63
} AS s;
64
64
```
65
65
66
-
###Adding or Updating Fields of Structs
66
+
## Adding or Updating Fields of Structs
67
67
68
68
To add new fields or update existing ones, you can use `struct_update`:
69
69
@@ -73,7 +73,7 @@ SELECT struct_update({'a': 1, 'b': 2}, b := 3, c := 4) AS s;
73
73
74
74
Alternatively, `struct_insert` also allows adding new fields but not updating existing ones.
75
75
76
-
###Retrieving from Structs
76
+
## Retrieving from Structs
77
77
78
78
Retrieving a value from a struct can be accomplished using dot notation, bracket notation, or through [struct functions]({% link docs/stable/sql/functions/struct.md %}) like `struct_extract`.
79
79
@@ -101,7 +101,7 @@ The `struct_extract` function is also equivalent. This returns 1:
Rather than retrieving a single key from a struct, the `unnest` special function can be used to retrieve all keys from a struct as separate columns.
107
107
This is particularly useful when a prior operation creates a struct of unknown shape, or if a query must handle any potential struct keys:
@@ -128,11 +128,11 @@ FROM (SELECT {'x': 1, 'y': 2, 'z': 3} AS a);
128
128
129
129
> Warning The star notation is currently limited to top-level struct columns and non-aggregate expressions.
130
130
131
-
###Dot Notation Order of Operations
131
+
## Dot Notation Order of Operations
132
132
133
133
Referring to structs with dot notation can be ambiguous with referring to schemas and tables. In general, DuckDB looks for columns first, then for struct keys within columns. DuckDB resolves references in these orders, using the first match to occur:
134
134
135
-
####No Dots
135
+
### No Dots
136
136
137
137
```sql
138
138
SELECT part1
@@ -141,7 +141,7 @@ FROM tbl;
141
141
142
142
1.`part1` is a column
143
143
144
-
####One Dot
144
+
### One Dot
145
145
146
146
```sql
147
147
SELECTpart1.part2
@@ -151,7 +151,7 @@ FROM tbl;
151
151
1.`part1` is a table, `part2` is a column
152
152
2.`part1` is a column, `part2` is a property of that column
153
153
154
-
####Two (or More) Dots
154
+
### Two (or More) Dots
155
155
156
156
```sql
157
157
SELECTpart1.part2.part3
@@ -164,7 +164,7 @@ FROM tbl;
164
164
165
165
Any extra parts (e.g., `.part4.part5`, etc.) are always treated as properties
166
166
167
-
###Creating Structs with the `row` Function
167
+
## Creating Structs with the `row` Function
168
168
169
169
The `row` function can be used to automatically convert multiple columns to a single struct column.
170
170
When using `row` the keys will be empty strings allowing for easy insertion into a table with a struct column.
Copy file name to clipboardExpand all lines: docs/stable/sql/expressions/logical_operators.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ title: Logical Operators
10
10
11
11
The following logical operators are available: `AND`, `OR` and `NOT`. SQL uses a three-valuad logic system with `true`, `false` and `NULL`. Note that logical operators involving `NULL` do not always evaluate to `NULL`. For example, `NULL AND false` will evaluate to `false`, and `NULL OR true` will evaluate to `true`. Below are the complete truth tables.
12
12
13
-
###Binary Operators: `AND` and `OR`
13
+
## Binary Operators: `AND` and `OR`
14
14
15
15
<divclass="monospace_table"></div>
16
16
@@ -23,7 +23,7 @@ The following logical operators are available: `AND`, `OR` and `NOT`. SQL uses a
0 commit comments