Skip to content

Commit 4df5318

Browse files
authored
Merge branch 'duckdb:main' into main
2 parents 042990f + 31fdb54 commit 4df5318

File tree

16 files changed

+57
-39
lines changed

16 files changed

+57
-39
lines changed

_posts/2024-09-25-changing-data-with-confidence-and-acid.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The great quote “Everything changes and nothing stays the same” from [Heracl
1212

1313
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.
1414

15+
## ACID Guarantees
16+
1517
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.
1618

1719
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.

docs/stable/clients/odbc/windows.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ redirect_from:
88
title: ODBC API on Windows
99
---
1010

11+
## Setup
12+
1113
Using the DuckDB ODBC API on Windows requires the following steps:
1214

1315
1. The Microsoft Windows requires an ODBC Driver Manager to manage communication between applications and the ODBC drivers.

docs/stable/core_extensions/iceberg/iceberg_rest_catalogs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ To see the available tables run
4545
SHOW ALL TABLES;
4646
```
4747

48-
### ATTACH OPTIONS
48+
## `ATTACH` Options
4949

5050
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.
5151

docs/stable/data/json/format_settings.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SELECT *
1616
FROM filename.json;
1717
```
1818

19-
#### Format: `newline_delimited`
19+
## Format: `newline_delimited`
2020

2121
With `format = 'newline_delimited'` newline-delimited JSON can be parsed.
2222
Each line is a JSON.
@@ -42,7 +42,7 @@ FROM read_json('records.json', format = 'newline_delimited');
4242
| value2 | value2 |
4343
| value3 | value3 |
4444

45-
#### Format: `array`
45+
## Format: `array`
4646

4747
If the JSON file contains a JSON array of objects (pretty-printed or not), `array_of_objects` may be used.
4848
To demonstrate its use, we use the example file [`records-in-array.json`]({% link data/records-in-array.json %}):
@@ -68,7 +68,7 @@ FROM read_json('records-in-array.json', format = 'array');
6868
| value2 | value2 |
6969
| value3 | value3 |
7070

71-
#### Format: `unstructured`
71+
## Format: `unstructured`
7272

7373
If the JSON file contains JSON that is not newline-delimited or an array, `unstructured` may be used.
7474
To demonstrate its use, we use the example file [`unstructured.json`]({% link data/unstructured.json %}):
@@ -101,7 +101,7 @@ FROM read_json('unstructured.json', format = 'unstructured');
101101
| value2 | value2 |
102102
| value3 | value3 |
103103

104-
### Records Settings
104+
## `records` Options
105105

106106
The JSON extension can attempt to determine whether a JSON file contains records when setting `records = auto`.
107107
When `records = true`, the JSON extension expects JSON objects, and will unpack the fields of JSON objects into individual columns.

docs/stable/data/json/sql_to_and_from_json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you run the `json_execute_serialized_sql(varchar)` table function inside of a
2020

2121
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.
2222

23-
### Examples
23+
## Examples
2424

2525
Simple example:
2626

docs/stable/operations_manual/installing_duckdb/install_script.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ To use the [DuckDB install script](https://install.duckdb.org) on Linux and macO
1313
curl https://install.duckdb.org | sh
1414
```
1515

16+
<!-- markdownlint-disable MD040 MD046 -->
17+
1618
<details markdown='1'>
1719
<summary markdown='span'>
1820
Click to see the output of the install script.
@@ -49,6 +51,8 @@ To launch DuckDB now, type
4951
```
5052
</details>
5153

54+
<!-- markdownlint-enable MD040 MD046 -->
55+
5256
By default, this installs the latest stable version of DuckDB to `~/.duckdb/cli/latest/duckdb`.
5357
To add the DuckDB binary to your path, append the following line to your shell profile or RC file (e.g., `~/.bashrc`, `~/.zshrc`):
5458

docs/stable/sql/data_types/enum.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,4 @@ DROP TYPE ⟨enum_name⟩;
242242

243243
Currently, it is possible to drop enums that are used in tables without affecting the tables.
244244

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.

docs/stable/sql/data_types/struct.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Conceptually, a `STRUCT` column contains an ordered list of columns called “en
1313

1414
See the [data types overview]({% link docs/stable/sql/data_types/overview.md %}) for a comparison between nested data types.
1515

16-
### Creating Structs
16+
## Creating Structs
1717

1818
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.
1919

@@ -63,7 +63,7 @@ SELECT {
6363
} AS s;
6464
```
6565

66-
### Adding or Updating Fields of Structs
66+
## Adding or Updating Fields of Structs
6767

6868
To add new fields or update existing ones, you can use `struct_update`:
6969

@@ -73,7 +73,7 @@ SELECT struct_update({'a': 1, 'b': 2}, b := 3, c := 4) AS s;
7373

7474
Alternatively, `struct_insert` also allows adding new fields but not updating existing ones.
7575

76-
### Retrieving from Structs
76+
## Retrieving from Structs
7777

7878
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`.
7979

@@ -101,7 +101,7 @@ The `struct_extract` function is also equivalent. This returns 1:
101101
SELECT struct_extract({'x space': 1, 'y': 2, 'z': 3}, 'x space');
102102
```
103103

104-
#### `unnest` / `STRUCT.*`
104+
### `unnest` / `STRUCT.*`
105105

106106
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.
107107
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);
128128

129129
> Warning The star notation is currently limited to top-level struct columns and non-aggregate expressions.
130130
131-
### Dot Notation Order of Operations
131+
## Dot Notation Order of Operations
132132

133133
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:
134134

135-
#### No Dots
135+
### No Dots
136136

137137
```sql
138138
SELECT part1
@@ -141,7 +141,7 @@ FROM tbl;
141141

142142
1. `part1` is a column
143143

144-
#### One Dot
144+
### One Dot
145145

146146
```sql
147147
SELECT part1.part2
@@ -151,7 +151,7 @@ FROM tbl;
151151
1. `part1` is a table, `part2` is a column
152152
2. `part1` is a column, `part2` is a property of that column
153153

154-
#### Two (or More) Dots
154+
### Two (or More) Dots
155155

156156
```sql
157157
SELECT part1.part2.part3
@@ -164,7 +164,7 @@ FROM tbl;
164164

165165
Any extra parts (e.g., `.part4.part5`, etc.) are always treated as properties
166166

167-
### Creating Structs with the `row` Function
167+
## Creating Structs with the `row` Function
168168

169169
The `row` function can be used to automatically convert multiple columns to a single struct column.
170170
When using `row` the keys will be empty strings allowing for easy insertion into a table with a struct column.

docs/stable/sql/expressions/logical_operators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: Logical Operators
1010

1111
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.
1212

13-
### Binary Operators: `AND` and `OR`
13+
## Binary Operators: `AND` and `OR`
1414

1515
<div class="monospace_table"></div>
1616

@@ -23,7 +23,7 @@ The following logical operators are available: `AND`, `OR` and `NOT`. SQL uses a
2323
| false | NULL | false | NULL |
2424
| NULL | NULL | NULL | NULL|
2525

26-
### Unary Operator: NOT
26+
## Unary Operator: `NOT`
2727

2828
<div class="monospace_table"></div>
2929

docs/stable/sql/functions/aggregates.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,14 @@ The table below shows the available general aggregate functions.
228228

229229
| **Description** | Returns the bitwise `OR` of all bits in a given expression. |
230230
| **Example** | `bit_or(A)` |
231+
231232
#### `bit_xor(arg)`
232233

233234
<div class="nostroke_table"></div>
234235

235236
| **Description** | Returns the bitwise `XOR` of all bits in a given expression. |
236237
| **Example** | `bit_xor(A)` |
238+
237239
#### `bitstring_agg(arg)`
238240

239241
<div class="nostroke_table"></div>

0 commit comments

Comments
 (0)