Skip to content

Commit

Permalink
Merge branch 'main' into demo-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emile-00 authored Dec 17, 2024
2 parents 40dacf4 + 0509fac commit f3d40b4
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 44 deletions.
2 changes: 1 addition & 1 deletion delivery/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ File sink currently supports only append-only mode, so please change the query t
## Batching strategy for file sink

<Note>
Batching strategy for file sink is available since version 2.1.
Added in version 2.1.
</Note>

RisingWave implements batching strategies for file sinks to optimize file management by preventing the generation of numerous small files. The batching strategy is available for Parquet, JSON, and CSV encode.
Expand Down
2 changes: 1 addition & 1 deletion ingestion/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ RisingWave supports reading data from file sources including AWS S3, GCS, and Az
### Batch reading from file source

<Note>
Batch reading from file source is available since version 2.1.
Added in version 2.1.
</Note>

To read data in batch from file sources, you need to create a materialized view from the source or create a table with the appropriate connector. You can also directly query the file source. Below are examples using AWS S3.
Expand Down
4 changes: 2 additions & 2 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,18 +424,18 @@
"pages": [
"processing/overview",
{
"group": "SQL",
"group": "SQL patterns",
"pages": [
"processing/sql/dynamic-filters",
"processing/sql/temporal-filters",
"processing/sql/joins",
"processing/sql/time-windows",
"processing/sql/top-n-by-group",
"processing/sql/transactions",
"processing/sql/sql-references"
]
},
"processing/deletes-and-updates",
"processing/transactions",
"processing/maintain-wide-table-with-table-sinks",
"processing/watermarks",
"processing/emit-on-window-close",
Expand Down
32 changes: 0 additions & 32 deletions operate/meta-backup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,35 +147,3 @@ Parameters to `risectl meta restore-meta` should be:
* `--hummock-storage-url s3://state_bucket`. Note that the `hummock+` prefix is stripped.
* `--hummock-storage-directory state_data`.
4. Configure meta service to use the new meta store.

## Access historical data backed up by meta snapshot

Meta snapshot is used to support historical data access, also known as time travel query.

Use the following steps to perform a time travel query.

1. List all valid historical point-in-time (i.e., epoch) for a table. For example to query the table of id 6:
```sql
SELECT state_table_info->'6'->>'safeEpoch' as safe_epoch,state_table_info->'6'->>'committedEpoch' committed_epoch from rw_meta_snapshot;
```
Example output:
```bash
safe_epoch | committed_epoch
-----------------+------------------
7039353459507200 | 7039354678542336
7039354678542346 | 7039622397886464
```
Choose an epoch to query. Valid epochs are within range \[`safe_epoch`,`committed_epoch`\], e.g. \[7039353459507200, 7039354678542336\] or \[7039354678542346, 7039622397886464\].
2. Set session config `QUERY_EPOCH`. By default, it's 0, which means disabling historical query.
```sql
SET QUERY_EPOCH=[chosen epoch];
```
Then, batch queries in this session return data as of this epoch instead of the latest one.
3. Disable historical query.
```sql
SET QUERY_EPOCH=0;
```

<Note>
RisingWave only supports historical data access at a specific point in time backed up by at least one meta snapshot.
</Note>
2 changes: 1 addition & 1 deletion processing/sql/sql-references.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
title: SQL references
title: Full SQL references
url: /sql/overview
---
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Transactions in databases refer to logical units of work that consist of one or

RisingWave supports read-only transactions, where all reads within a transaction are executed against the consistent Hummock snapshot. Hummock is the LSM-Tree-based storage engine in RisingWave that is specifically optimized for streaming workloads.

To initiate a transaction, use either the `START TRANSACTION READ ONLY` or `BEGIN READ ONLY` command. Subsequently, you can execute queries to read data from the consistent snapshot. To finalize the transaction and submit the queries as a single unit, use the `COMMIT` command.
To initiate a transaction, use either the [`START TRANSACTION READ ONLY`](/sql/commands/sql-start-transaction) or [`BEGIN READ ONLY`](/sql/commands/sql-begin) command. Subsequently, you can execute queries to read data from the consistent snapshot. To finalize the transaction and submit the queries as a single unit, use the [`COMMIT`](/sql/commands/sql-commit) command.

Please note that data modifications are not allowed while a transaction is initiated but not yet committed. The statements listed below are not allowed within a transaction:

Expand Down
4 changes: 2 additions & 2 deletions sql/commands/sql-begin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "BEGIN"
description: "RisingWave supports read-only transactions. You can use the `BEGIN READ ONLY` command to start a read-only transaction."
---

For more information about transactions in RisingWave, see [Transactions](/processing/sql/transactions).
For more information about transactions in RisingWave, see [Transactions](/processing/transactions).

The `BEGIN` command starts the read-write transaction mode, which is not supported yet in RisingWave. For compatibility reasons, this command will still succeed but no transaction is actually started. That is why you need to specify the `READ ONLY` option to start a transaction in read-only mode.

Expand All @@ -23,7 +23,7 @@ BEGIN
## Related topics

<CardGroup>
<Card title="Transactions" icon="rotate" href="/processing/sql/transactions"
<Card title="Transactions" icon="rotate" href="/processing/transactions"
iconType="solid" horizontal/>
<Card title="START TRANSACTION" icon="play" href="/sql/commands/sql-start-transaction" iconType="solid"horizontal/>
<Card title="COMMIT" icon="check" href="/sql/commands/sql-commit"iconType="solid"horizontal/>
Expand Down
4 changes: 2 additions & 2 deletions sql/commands/sql-commit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "COMMIT"
description: "RisingWave supports read-only transactions. You can use the `COMMIT` command to commit the current transaction."
---

For more information about transactions in RisingWave, see [Transactions](/processing/sql/transactions).
For more information about transactions in RisingWave, see [Transactions](/processing/transactions).

You can start a read-only transaction by using the `BEGIN READ ONLY` or `START TRANSACTION READ ONLY` command.

Expand All @@ -28,7 +28,7 @@ COMMIT
title="Transactions"
icon="rotate"
iconType="solid"
href="/processing/sql/transactions"
href="/processing/transactions"
horizontal
/>
<Card
Expand Down
4 changes: 2 additions & 2 deletions sql/commands/sql-start-transaction.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "START TRANSACTION"
description: "RisingWave supports read-only transactions. You can use the `START TRANSACTION READ ONLY` command to start a read-only transaction. For more information about transactions in RisingWave, see [Transactions](/processing/sql/transactions)."
description: "RisingWave supports read-only transactions. You can use the `START TRANSACTION READ ONLY` command to start a read-only transaction. For more information about transactions in RisingWave, see [Transactions](/processing/transactions)."
---

The `START TRANSACTION` command starts the read-write transaction mode, which is not supported yet in RisingWave. For compatibility reasons, this command will still succeed but no transaction is actually started. That is why you need to specify the `READ ONLY` option to start a transaction in read-only mode.
Expand Down Expand Up @@ -36,7 +36,7 @@ START_TRANSACTION
title="Transactions"
icon="exchange"
iconType="solid"
href="/processing/sql/transactions"
href="/processing/transactions"
horizontal
/>

Expand Down

0 comments on commit f3d40b4

Please sign in to comment.