Skip to content

Commit

Permalink
Overhauled release and database version 4 section
Browse files Browse the repository at this point in the history
  • Loading branch information
jboettcher committed Apr 18, 2024
1 parent 1fc8dff commit 0ff798c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
17 changes: 6 additions & 11 deletions website/docs/hyper-api/hyper_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,13 @@ To create a new Hyper database file with this version, set
`default_database_version=3`.

#### version 4
Database file format version `4` adds support for a new 32-bit floating point type.
Previously, Hyper internally mapped all SQL floating points to 64-bit doubles.
Now, Hyper uses 32-bit floats for the SQL types `real` and `float(p)` with
`p <= 24`.
The types `double precision`, `float`, or `float(p)` with `p >= 25`
still use 64-bit doubles.
Database file format version `4` was introduced to support
persisting and reading the new 32-bit floating point type.

Old queries using the affected types might yield different results when switching
to the new version due to the different underlying rounding behavior and arithmetics
of 32-bit floats.
To preserve the old behavior, the used data types must be explicitly changed
to `double precision`.
Starting with release (#TODO), Hyper uses 32-bit floats for
the SQL types `real` and `float(p)` with `p <= 24`.
The types `double precision`, `float`, and `float(p)` with `p >= 25`
still use 64-bit doubles.

To create a new Hyper database file with this version, set
`default_database_version=4`.
Expand Down
18 changes: 15 additions & 3 deletions website/docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,23 @@ In case you are wondering why all our releases start with `0.0`, read [this FAQ

### Upcoming Release

* We have introduced a new 32-bit floating point data type.
* Persisting it is only supported in the new file format 4.
!!!

TODO: Update release number (#TODO) in database version [database version 4](hyper-api/hyper_process#version-4) when doing this release!!!

!!!

* Announced [database version 3](hyper-api/hyper_process#version-3) that is able to store [`128-bit NUMERICS`](/docs/sql/datatype/numeric#numeric-decimal).
* Introduced a new 32-bit floating point data type for `REAL`.
* Previously, `REAL` was internally mapped to 64-bit `DOUBLE PRECISION`.
* Introduced new [database version 4](hyper-api/hyper_process#version-4) to support reading and persisting the new 32-bit floats.
* A `CAST(… AS double precision)` is needed to store such columns in older file formats.
* We announced file format 3 (bigger 128-bit numerics) and file format 4 (32-bit floating points)

:::warning
Queries using `REAL`, `FLOAT4`, or `FLOAT(p)` with `p <= 24` are now treated as `32 bit` floating points.
This can lead to different results due to the different underlying rounding behavior and arithmetics of 32-bit floats.
To preserve the old behavior, the used data types must be explicitly changed or cast to `DOUBLE PRECISION`.
:::

### 0.0.18825 [March 6, 2024]

Expand Down

0 comments on commit 0ff798c

Please sign in to comment.