|
21 | 21 | "## Overview\n", |
22 | 22 | "\n", |
23 | 23 | "[V3IO Frames](https://github.com/v3io/frames) (**\"Frames\"**) is a multi-model open-source data-access library, developed by Iguazio, which provides a unified high-performance DataFrame API for working with data in the data store of the Iguazio Data Science Platform (**\"the platform\"**).\n", |
24 | | - "Frames currently supports the NoSQL (key/value), stream, and time-series (TSDB) data models via its `kv`, `stream`, and `tsdb` backends.\n", |
| 24 | + "Frames currently supports the NoSQL (key/value) and time-series (TSDB) data models via its `kv` and `tsdb` backends.\n", |
25 | 25 | "\n", |
26 | 26 | "To use Frames, you first need to import the **v3io_frames** library and create and initialize a client object — an instance of the`Client` class.<br>\n", |
27 | | - "The `Client` class features the following object methods for supporting basic data operations; the type of data is derived from the backend type (`tsdb` — TSDB table / `kv` — NoSQL table / `stream` — data stream):\n", |
| 27 | + "The `Client` class features the following object methods for supporting basic data operations; the type of data is derived from the backend type (`kv` — NoSQL table / `tsdb` — TSDB table):\n", |
28 | 28 | "\n", |
29 | | - "- `create` — creates a new TSDB table or stream (\"backend data\").\n", |
30 | | - "- `delete` — deletes a table or stream.\n", |
31 | | - "- `read` — reads data from a table or stream into pandas DataFrames.\n", |
32 | | - "- `write` — writes data from pandas DataFrames to a table or stream.\n", |
33 | | - "- `execute` — executes a command on a table or stream.\n", |
| 29 | + "- `create` — creates a new TSDB table (\"backend data\").\n", |
| 30 | + "- `delete` — deletes a table.\n", |
| 31 | + "- `read` — reads data from a table into pandas DataFrames.\n", |
| 32 | + "- `write` — writes data from pandas DataFrames to a table.\n", |
| 33 | + "- `execute` — executes a command on a table.\n", |
34 | 34 | " Each backend may support multiple commands.\n", |
35 | 35 | "\n", |
36 | 36 | "For a detailed description of the Frames API, see the [Frames API reference](https://www.iguazio.com/docs/reference/latest-release/api-reference/frames/).<br>\n", |
|
1087 | 1087 | "#### Overview and Basic Examples\n", |
1088 | 1088 | "\n", |
1089 | 1089 | "Use the `read` method of the Frames client with the `tsdb` backend to read data from your TSDB table (i.e., query the database).<br>\n", |
1090 | | - "Note that you cannot mix raw sample-data queries and aggregation queries:\n", |
| 1090 | + "Note that you cannot mix raw sample-data queries and aggregation queries.\n", |
1091 | 1091 | "\n", |
1092 | | - "**Parameters** — set the `table` parameter to the path to the TSDB table, and optionally set additional method parameters to configure the query.\n", |
1093 | | - " `columns` defines the query metrics (default = all); `aggregators` defines aggregation functions (\"aggregators\") to execute for all the configured metrics; `filter` restricts the query by using a platform [filter expression](https://www.iguazio.com/docs/reference/latest-release/expressions/condition-expression/#filter-expression); \n", |
| 1092 | + "You must set the `table` parameter to the path to the TSDB table.<br>\n", |
| 1093 | + "You can optionally set additional method parameters to configure the query:\n", |
| 1094 | + "\n", |
| 1095 | + "- `columns` defines the query metrics (default = all).\n", |
| 1096 | + "- `aggregators` defines aggregation functions (\"aggregators\") to execute for all the configured metrics.\n", |
| 1097 | + "- `filter` restricts the query by using a platform [filter expression](https://www.iguazio.com/docs/reference/latest-release/expressions/condition-expression/#filter-expression).\n", |
| 1098 | + "- `start` and `end` define the query's time range — the metric-sample timestamps to which to apply the query.\n", |
| 1099 | + " The default `end` time is `\"now\"` and the default `start` time is 1 hour before the end time (`<end> - 1h`).\n", |
| 1100 | + "- `step` defines the interval for aggregation or raw-data downsampling (default = the query's time range).\n", |
| 1101 | + "- `multi_index` casn be set to `True` to return labels as index columns, as demonstrated in the following examples.\n", |
| 1102 | + " By default, only the metric sample-time primary-key attribute is returned as an index column.\n", |
1094 | 1103 | "\n", |
1095 | | - "You can also optionally set additional parameters.\n", |
1096 | | - "`start` and `end` define the query's time range — the metric-sample timestamps to which to apply the query (the default end time is `\"now\"` and the default start time is 1 hour before the end time); `step` defines the interval for aggregation or raw-data downsampling (default = the query's time range);<br>\n", |
1097 | | - "You can set the optional `multi_index` parameter to `True` to return labels as index columns, as demonstrated in the following examples.\n", |
1098 | | - "By default, only the metric sample-time primary-key attribute is returned as an index column.<br>\n", |
1099 | 1104 | "See the [Frames API reference](https://www.iguazio.com/docs/reference/latest-release/api-reference/frames/tsdb/read/) for more information about the `read` parameters that are supported for the `tsdb` backend." |
1100 | 1105 | ] |
1101 | 1106 | }, |
|
1241 | 1246 | "<a id=\"frames-tsdb-read-conditional\"></a>\n", |
1242 | 1247 | "#### Conditional Read\n", |
1243 | 1248 | "\n", |
1244 | | - "The following examples demonstrate how to use a query filter to conditionally read only a subset of the data from a TSDB table.<br>\n", |
1245 | | - "\n", |
1246 | | - "- In non-SQL queries, this is done by setting the value of the `filter` parameter to a [platform filter expression](https://www.iguazio.com/docs/reference/latest-release/expressions/condition-expression/#filter-expression).\n", |
1247 | | - "- In SQL queries, this is done by setting the `query` parameter to a query string that includes a `FROM` clause with a platform filter expression expressed as an SQL expression.\n", |
1248 | | - " Note that the comparison operator for such queries is `=`, as opposed to `==` in non-SQL queries." |
| 1249 | + "The following example demonstrates how to use a query filter to conditionally read only a subset of the data from a TSDB table.\n", |
| 1250 | + "This is done by setting the value of the `filter` parameter to a [platform filter expression](https://www.iguazio.com/docs/reference/latest-release/expressions/condition-expression/#filter-expression)." |
1249 | 1251 | ] |
1250 | 1252 | }, |
1251 | 1253 | { |
1252 | 1254 | "cell_type": "code", |
1253 | | - "execution_count": 18, |
| 1255 | + "execution_count": 15, |
1254 | 1256 | "metadata": {}, |
1255 | 1257 | "outputs": [ |
1256 | 1258 | { |
|
1437 | 1439 | }, |
1438 | 1440 | { |
1439 | 1441 | "cell_type": "code", |
1440 | | - "execution_count": 20, |
| 1442 | + "execution_count": 16, |
1441 | 1443 | "metadata": {}, |
1442 | 1444 | "outputs": [], |
1443 | 1445 | "source": [ |
|
1459 | 1461 | }, |
1460 | 1462 | { |
1461 | 1463 | "cell_type": "code", |
1462 | | - "execution_count": 27, |
| 1464 | + "execution_count": 17, |
1463 | 1465 | "metadata": {}, |
1464 | 1466 | "outputs": [], |
1465 | 1467 | "source": [ |
|
0 commit comments