Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,590 changes: 5,330 additions & 5,260 deletions gt-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ ENGINE = AzureQueue('DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;
SETTINGS mode = 'unordered'
```


## Settings {#settings}

サポートされている設定項目は、ほとんどが `S3Queue` テーブルエンジンと同じですが、`s3queue_` プレフィックスは付きません。[設定の全リスト](../../../engines/table-engines/integrations/s3queue.md#settings)を参照してください。
テーブルに対して構成されている設定の一覧を取得するには、`system.azure_queue_settings` テーブルを使用します。`24.10` 以降で利用可能です。

以下は、AzureQueue にのみ対応し、S3Queue には適用されない設定です。

### `after_processing_move_connection_string` {#after_processing_move_connection_string}
### `after_processing_move_connection_string` {#after_processing_move_connection_string}

宛先が別の Azure コンテナーである場合に、正常に処理されたファイルを移動するための Azure Blob Storage 接続文字列。

Expand All @@ -58,7 +59,7 @@ SETTINGS mode = 'unordered'

デフォルト値: 空文字列。

### `after_processing_move_container` {#after_processing_move_container}
### `after_processing_move_container` {#after_processing_move_container}

移動先が別の Azure コンテナである場合に、正常に処理されたファイルを移動する移動先コンテナ名。

Expand All @@ -84,6 +85,13 @@ SETTINGS
after_processing_move_container = 'dst-container';
```


## AzureQueue テーブルエンジンからの SELECT {#select}

AzureQueue テーブルに対する SELECT クエリは、既定では禁止されています。これは、データを一度読み取ったらキューから削除するという一般的なキューの利用パターンに従うためです。誤ってデータを失わないようにする目的で、SELECT は禁止されています。
ただし、状況によってはこれが必要になる場合もあります。その場合は、SETTING `stream_like_engine_allow_direct_select` を `True` に設定する必要があります。
AzureQueue エンジンには、SELECT クエリ用の特別な SETTING `commit_on_select` があります。これを `False` に設定すると、読み取り後もキュー内のデータを保持し、`True` に設定すると削除します。

## 説明 {#description}

`SELECT` は、各ファイルを 1 回しかインポートできないため(デバッグ用途を除き)ストリーミングインポートにはあまり有用ではありません。代わりに、[マテリアライズドビュー](../../../sql-reference/statements/create/view.md) を使用してリアルタイム処理フローを作成する方が実用的です。これを行うには、次のようにします。
Expand Down Expand Up @@ -111,6 +119,7 @@ CREATE MATERIALIZED VIEW consumer TO stats
SELECT * FROM stats ORDER BY key;
```


## 仮想カラム {#virtual-columns}

* `_path` — ファイルパス。
Expand All @@ -134,32 +143,32 @@ SELECT * FROM stats ORDER BY key;
</azure_queue_log>
```

この永続テーブルは、`system.s3queue` と同様の情報を保持しますが、対象は処理済みおよび失敗したファイルです
この永続テーブルは、`system.s3queue` と同じ情報を保持しますが、処理済みおよび失敗したファイルに関するものです

このテーブルの構造は次のとおりです。

```sql

CREATE TABLE system.azure_queue_log
(
`hostname` LowCardinality(String) COMMENT 'ホスト名',
`event_date` Date COMMENT 'このログ行の書き込みイベント日付',
`event_time` DateTime COMMENT 'このログ行の書き込みイベント時刻',
`database` String COMMENT '現在のS3Queueテーブルが存在するデータベース名。',
`table` String COMMENT 'S3Queueテーブル名。',
`uuid` String COMMENT 'S3QueueテーブルのUUID',
`file_name` String COMMENT '処理対象ファイルのファイル名',
`rows_processed` UInt64 COMMENT '処理された行数',
`status` Enum8('Processed' = 0, 'Failed' = 1) COMMENT 'ファイル処理のステータス',
`processing_start_time` Nullable(DateTime) COMMENT 'ファイル処理の開始時刻',
`processing_end_time` Nullable(DateTime) COMMENT 'ファイル処理の終了時刻',
`exception` String COMMENT '例外が発生した場合の例外メッセージ'
`hostname` LowCardinality(String) COMMENT 'Hostname',
`event_date` Date COMMENT 'Event date of writing this log row',
`event_time` DateTime COMMENT 'Event time of writing this log row',
`database` String COMMENT 'The name of a database where current S3Queue table lives.',
`table` String COMMENT 'The name of S3Queue table.',
`uuid` String COMMENT 'The UUID of S3Queue table',
`file_name` String COMMENT 'File name of the processing file',
`rows_processed` UInt64 COMMENT 'Number of processed rows',
`status` Enum8('Processed' = 0, 'Failed' = 1) COMMENT 'Status of the processing file',
`processing_start_time` Nullable(DateTime) COMMENT 'Time of the start of processing the file',
`processing_end_time` Nullable(DateTime) COMMENT 'Time of the end of processing the file',
`exception` String COMMENT 'Exception message if happened'
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_date, event_time)
SETTINGS index_granularity = 8192
COMMENT 'S3Queueエンジンによって処理されるファイルの情報を含むログエントリを格納する。'
COMMENT 'Contains logging entries with the information files processes by S3Queue engine.'

```

Expand All @@ -171,7 +180,7 @@ FROM system.azure_queue_log
LIMIT 1
FORMAT Vertical

1:
Row 1:
──────
hostname: clickhouse
event_date: 2024-12-16
Expand All @@ -186,6 +195,6 @@ processing_start_time: 2024-12-16 13:42:47
processing_end_time: 2024-12-16 13:42:47
exception:

1行が結果セットに含まれています。経過時間: 0.002秒。
1 row in set. Elapsed: 0.002 sec.

```
Loading