Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypercore API ref #3699

Draft
wants to merge 31 commits into
base: latest
Choose a base branch
from

Conversation

billy-the-fish
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Jan 9, 2025

Allow 10 minutes from last push for the staging site to build. If the link doesn't work, try using incognito mode instead. For internal reviewers, check web-documentation repo actions for staging build status. Link to build for this PR: http://docs-dev.timescale.com/docs-235-docs-rfc-update-the-api-ref-for-hyperstore-and-compression-for-any-changes-due-to-the-hyperstore

Copy link

github-actions bot commented Jan 9, 2025

Oh no, the docs build failed! To see why visit the failing build (link only accessible to Timescalers).

Copy link

github-actions bot commented Jan 9, 2025

Oh no, the docs build failed! To see why visit the failing build (link only accessible to Timescalers).

@billy-the-fish billy-the-fish marked this pull request as draft January 9, 2025 15:07
@billy-the-fish billy-the-fish requested review from mkindahl, esclymeTS, philkra and LeeHampton and removed request for esclymeTS January 10, 2025 13:22
…tore-and-compression-for-any-changes-due-to-the-hyperstore
…tore-and-compression-for-any-changes-due-to-the-hyperstore
@philkra
Copy link
Contributor

philkra commented Jan 15, 2025

@billy-the-fish the changes look good to me. One thing, I would look like to add is a reference from the deprecated functions / parameters to the new ones. For example:
compress_chunk is deprecated in favour of convert_to_columnstore. As user, I would love to know if there is a replacement for the deprecated function, having a reference to the replacement would be handy.

Copy link
Contributor

@erimatnor erimatnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a quick pass and added some suggestions.

_partials/_hypercore_policy_workflow.md Outdated Show resolved Hide resolved
_partials/_hypercore_policy_workflow.md Outdated Show resolved Hide resolved
api/hypercore/add_columnstore_policy.md Outdated Show resolved Hide resolved
api/hypercore/add_columnstore_policy.md Outdated Show resolved Hide resolved
api/hypercore/add_columnstore_policy.md Outdated Show resolved Hide resolved
api/hypercore/page-index/page-index.js Outdated Show resolved Hide resolved
api/hypercore/page-index/page-index.js Outdated Show resolved Hide resolved
api/hypercore/page-index/page-index.js Outdated Show resolved Hide resolved
api/hypercore/remove_columnstore_policy.md Outdated Show resolved Hide resolved
api/hypercore/remove_columnstore_policy.md Outdated Show resolved Hide resolved
@@ -30,6 +31,8 @@ Compressed chunks have the following limitations:
after constraint creation.
* [Timescale SkipScan][skipscan] does not currently work on compressed chunks.

<Deprecated2180 /> Replaced by <a href="https://docs.timescale.com/api/latest/hypercore/">Hypercore</a>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may emphasize that compression works in the new version.

Copy link

Oh no, the docs build failed! To see why visit the failing build (link only accessible to Timescalers).

Copy link

Oh no, the docs build failed! To see why visit the failing build (link only accessible to Timescalers).

Copy link
Contributor

@mkindahl mkindahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noted that many entries are noted as required while they are not.

Comment on lines +46 to +48
|Column| Type | Description |
|-|-------------------------------------------------|-------------------------------------------------|
| `convert_to_columnstore` | REGCLASS | The name of the chunk added to the columnstore. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result set here does not have a name, so not sure how you want to handle this. We have two different cases: 1) return a table-like result set with zero or more rows, and 2) return a single value of a specific type. This one just returns a regclass with no name.

|----------------------|--|---------|--|----------------------------------------------------------------------------------------------------------------|
| `chunk` | REGCLASS | - |✔| Name of the chunk to add to the columnstore. |
| `if_not_columnstore` | BOOLEAN | `true` |✖| Set to `false` so this job fails with an error rather than a warning if `chunk` is already in the columnstore. |
| `recompress` | BOOLEAN | `false` |✖| Set to `true` to add a chunk that had more data inserted after being added to the columnstore. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter requires a more elaborate description. How do we add that to the reference documentation? Do we have it after the table with the short description?

| `schedule_interval` |INTERVAL| 12 hours when [chunk_time_interval][chunk_time_interval] >= `1 day` for `hypertable`. Otherwise `chunk_time_interval` / `2`. | ✖ | Set the interval between the finish time of the last execution of this policy and the next start.|
| `initial_start` |TIMESTAMPTZ| The interval from the finish time of the last execution to the [next_start][next-start].| ✖| Set the time this job is first run. This is also the time that `next_start` is calculated from.|
| `timezone` |TEXT| UTC. However, daylight savings time(DST) changes may shift this alignment. | ✖ | Set to a valid time zone to mitigate DST shifting. If `initial_start` is set, subsequent executions of this policy are aligned on `initial_start`.|
| `if_not_exists` |BOOLEAN| `false` | ✖ | Set to `true` so this job fails with a warning rather than an error if a columnstore policy already exists on `hypertable` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required

Suggested change
| `if_not_exists` |BOOLEAN| `false` | | Set to `true` so this job fails with a warning rather than an error if a columnstore policy already exists on `hypertable` |
| `if_not_exists` |BOOLEAN| `false` | | Set to `true` so this job fails with a warning rather than an error if a columnstore policy already exists on `hypertable` |

| `created_before` |INTERVAL| NULL | ✖ | Add chunks with a creation time of `now() - created_before` to the columnstore. <br/> `created_before` is <ul><li>Not supported for continuous aggregates.</li><li>Mutually exclusive with `after`.</li></ul> |
| `schedule_interval` |INTERVAL| 12 hours when [chunk_time_interval][chunk_time_interval] >= `1 day` for `hypertable`. Otherwise `chunk_time_interval` / `2`. | ✖ | Set the interval between the finish time of the last execution of this policy and the next start.|
| `initial_start` |TIMESTAMPTZ| The interval from the finish time of the last execution to the [next_start][next-start].| ✖| Set the time this job is first run. This is also the time that `next_start` is calculated from.|
| `timezone` |TEXT| UTC. However, daylight savings time(DST) changes may shift this alignment. | ✖ | Set to a valid time zone to mitigate DST shifting. If `initial_start` is set, subsequent executions of this policy are aligned on `initial_start`.|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required:

Suggested change
| `timezone` |TEXT| UTC. However, daylight savings time(DST) changes may shift this alignment. | | Set to a valid time zone to mitigate DST shifting. If `initial_start` is set, subsequent executions of this policy are aligned on `initial_start`.|
| `timezone` |TEXT| UTC. However, daylight savings time(DST) changes may shift this alignment. | | Set to a valid time zone to mitigate DST shifting. If `initial_start` is set, subsequent executions of this policy are aligned on `initial_start`.|

| `hypertable` |REGCLASS| - | ✔ | Name of the hypertable or continuous aggregate to run this [job][job] on.|
| `after` |INTERVAL or INTEGER|- | ✖ | Add chunks containing data older than `now - {after}::interval` to the columnstore. <br/> Use an object type that matchs the time column type in `hypertable`: <ul><li><b><code>TIMESTAMP</code>, <code>TIMESTAMPTZ</code>, or <code>DATE</code></b>: use an <code>INTERVAL</code> type.</li><li><b> Integer-based timestamps </b>: set an integer type using the [integer_now_func][set_integer_now_func].</li></ul> `after` is mutually exclusive with `created_before`. |
| `created_before` |INTERVAL| NULL | ✖ | Add chunks with a creation time of `now() - created_before` to the columnstore. <br/> `created_before` is <ul><li>Not supported for continuous aggregates.</li><li>Mutually exclusive with `after`.</li></ul> |
| `schedule_interval` |INTERVAL| 12 hours when [chunk_time_interval][chunk_time_interval] >= `1 day` for `hypertable`. Otherwise `chunk_time_interval` / `2`. | ✖ | Set the interval between the finish time of the last execution of this policy and the next start.|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required:

Suggested change
| `schedule_interval` |INTERVAL| 12 hours when [chunk_time_interval][chunk_time_interval] >= `1 day` for `hypertable`. Otherwise `chunk_time_interval` / `2`. | | Set the interval between the finish time of the last execution of this policy and the next start.|
| `schedule_interval` |INTERVAL| 12 hours when [chunk_time_interval][chunk_time_interval] >= `1 day` for `hypertable`. Otherwise `chunk_time_interval` / `2`. | | Set the interval between the finish time of the last execution of this policy and the next start.|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants