Skip to content

Commit c9e5e39

Browse files
authored
Issue 402 reconstruct layouts (#407)
1 parent fef7449 commit c9e5e39

File tree

92 files changed

+1957
-1722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1957
-1722
lines changed

docs/automq-kafka-source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ Click **Next**. Timeplus will connect to the server and list all topics. Choose
2828
In the next step, confirm the schema of the Timeplus stream and specify a name. At the end of the wizard, an external stream will be created in Timeplus. You can query data or even write data to the AutoMQ topic with SQL.
2929

3030
See also:
31-
* [Kafka External Stream](/proton-kafka)
31+
* [Kafka External Stream](/kafka-source)
3232
* [Tutorial: Streaming ETL from Kafka to ClickHouse](/tutorial-sql-etl-kafka-to-ch)

docs/bigquery-external.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# BigQuery
2+
3+
Leveraging HTTP external stream, you can write / materialize data to BigQuery directly from Timeplus.
4+
5+
## Write to BigQuery {#example-write-to-bigquery}
6+
7+
Assume you have created a table in BigQuery with 2 columns:
8+
```sql
9+
create table `PROJECT.DATASET.http_sink_t1`(
10+
num int,
11+
str string);
12+
```
13+
14+
Follow [the guide](https://cloud.google.com/bigquery/docs/authentication) to choose the proper authentication to Google Cloud, such as via the gcloud CLI `gcloud auth application-default print-access-token`.
15+
16+
Create the HTTP external stream in Timeplus:
17+
```sql
18+
CREATE EXTERNAL STREAM http_bigquery_t1 (num int,str string)
19+
SETTINGS
20+
type = 'http',
21+
http_header_Authorization='Bearer $OAUTH_TOKEN',
22+
url = 'https://bigquery.googleapis.com/bigquery/v2/projects/$PROJECT/datasets/$DATASET/tables/$TABLE/insertAll',
23+
data_format = 'Template',
24+
format_template_resultset_format='{"rows":[${data}]}',
25+
format_template_row_format='{"json":{"num":${num:JSON},"str":${str:JSON}}}',
26+
format_template_rows_between_delimiter=','
27+
```
28+
29+
Replace the `OAUTH_TOKEN` with the output of `gcloud auth application-default print-access-token` or other secure way to obtain OAuth token. Replace `PROJECT`, `DATASET` and `TABLE` to match your BigQuery table path. Also change `format_template_row_format` to match the table schema.
30+
31+
Then you can insert data via a materialized view or just via `INSERT` command:
32+
```sql
33+
INSERT INTO http_bigquery_t1 VALUES(10,'A'),(11,'B');
34+
```

docs/changelog-stream.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ Debezium also read all existing rows and generate messages like this
403403

404404
### Load data to Timeplus
405405

406-
You can follow this [guide](/proton-kafka) to add 2 external streams to load data from Kafka or Redpanda. For example:
406+
You can follow this [guide](/kafka-source) to add 2 external streams to load data from Kafka or Redpanda. For example:
407407

408408
* Data source name `s1` to load data from topic `doc.public.dim_products` and put in a new stream `rawcdc_dim_products`
409409
* Data source name `s2` to load data from topic `doc.public.orders` and put in a new stream `rawcdc_orders`

docs/cli-migrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This tool is available in Timeplus Enterprise 2.5. It supports [Timeplus Enterpr
88

99
## How It Works
1010

11-
The migration is done via capturing the SQL DDL from the source deployment and rerunning those SQL DDL in the target deployment. Data are read from source Timeplus via [Timeplus External Streams](/timeplus-external-stream) and write to the target Timeplus via `INSERT INTO .. SELECT .. FROM table(tp_ext_stream)`. The data files won't be copied among the source and target Timeplus, but you need to ensure the target Timeplus can access to the source Timeplus, so that it can read data via Timeplus External Streams.
11+
The migration is done via capturing the SQL DDL from the source deployment and rerunning those SQL DDL in the target deployment. Data are read from source Timeplus via [Timeplus External Streams](/timeplus-source) and write to the target Timeplus via `INSERT INTO .. SELECT .. FROM table(tp_ext_stream)`. The data files won't be copied among the source and target Timeplus, but you need to ensure the target Timeplus can access to the source Timeplus, so that it can read data via Timeplus External Streams.
1212

1313

1414
## Supported Resources
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ClickHouse External Table
22

3+
## Overview
4+
35
Timeplus can read or write ClickHouse tables directly. This unlocks a set of new use cases, such as
46

57
- Use Timeplus to efficiently process real-time data in Kafka/Redpanda, apply flat transformation or stateful aggregation, then write the data to the local or remote ClickHouse for further analysis or visualization.
@@ -41,7 +43,7 @@ The required settings are type and address. For other settings, the default valu
4143

4244
The `config_file` setting is available since Timeplus Enterprise 2.7. You can specify the path to a file that contains the configuration settings. The file should be in the format of `key=value` pairs, one pair per line. You can set the ClickHouse user and password in the file.
4345

44-
Please follow the example in [Kafka External Stream](/proton-kafka#config_file).
46+
Please follow the example in [Kafka External Stream](/kafka-source#config_file).
4547

4648
You don't need to specify the columns, since the table schema will be fetched from the ClickHouse server.
4749

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Getting Data In
1+
# Connect Data In
22

33
Timeplus supports multiple ways to load data into the system, or access the external data without copying them in Timeplus:
44

55
- [External Stream for Apache Kafka](/external-stream), Confluent, Redpanda, and other Kafka API compatible data streaming platform. This feature is also available in Timeplus Proton.
6-
- [External Stream for Apache Pulsar](/pulsar-external-stream) is available in Timeplus Enterprise 2.5 and above.
6+
- [External Stream for Apache Pulsar](/pulsar-source) is available in Timeplus Enterprise 2.5 and above.
77
- Source for extra wide range of data sources. This is only available in Timeplus Enterprise. This integrates with [Redpanda Connect](https://redpanda.com/connect), supporting 200+ connectors.
88
- On Timeplus web console, you can also [upload CSV files](#csv) and import them into streams.
99
- For Timeplus Enterprise, [REST API](/ingest-api) and SDKs are provided to push data to Timeplus programmatically.
@@ -15,12 +15,12 @@ Timeplus supports multiple ways to load data into the system, or access the exte
1515
Choose "Data Collection" from the navigation menu to setup data access to other systems. There are two categories:
1616
* Timeplus Connect: directly supported by Timeplus Inc, with easy-to-use setup wizards.
1717
* Demo Stream: generate random data for various use cases. [Learn more](#streamgen)
18-
* Timeplus: read data from another Timeplus deployment. [Learn more](/timeplus-external-stream)
18+
* Timeplus: read data from another Timeplus deployment. [Learn more](/timeplus-source)
1919
* Apache Kafka: setup external streams to read from Apache Kafka. [Learn more](#kafka)
2020
* Confluent Cloud: setup external streams to read from Confluent Cloud
2121
* Redpanda: setup external streams to read from Redpanda
2222
* Apache Pulsar: setup external streams to read from Apache Pulsar. [Learn more](#pulsar)
23-
* ClickHouse: setup external tables to read from ClickHouse, without duplicating data in Timeplus. [Learn more](/proton-clickhouse-external-table)
23+
* ClickHouse: setup external tables to read from ClickHouse, without duplicating data in Timeplus. [Learn more](/clickhouse-external-table)
2424
* NATS: load data from NATS to Timeplus streams
2525
* WebSocket: load data from WebSocket to Timeplus streams
2626
* HTTP Stream: load data from HTTP stream to Timeplus streams
@@ -29,19 +29,17 @@ Choose "Data Collection" from the navigation menu to setup data access to other
2929
* Stream Ingestion: a wizard to guide you to push data to Timeplus via Ingest REST API. [Learn more](/ingest-api)
3030
* Redpanda Connect: available since Timeplus Enterprise 2.5 or above. Set up data access to other systems by editing a YAML file. Powered by Redpanda Connect, supported by Redpanda Data Inc. or Redpanda Community.
3131

32-
33-
3432
### Load streaming data from Apache Kafka {#kafka}
3533

3634
As of today, Kafka is the primary data integration for Timeplus. With our strong partnership with Confluent, you can load your real-time data from Confluent Cloud, Confluent Platform, or Apache Kafka into the Timeplus streaming engine. You can also create [external streams](/external-stream) to analyze data in Confluent/Kafka/Redpanda without moving data.
3735

38-
[Learn more.](/proton-kafka)
36+
[Learn more.](/kafka-source)
3937

4038
### Load streaming data from Apache Pulsar {#pulsar}
4139

4240
Apache® Pulsar™ is a cloud-native, distributed, open source messaging and streaming platform for real-time workloads. Since Timeplus Enterprise 2.5, Pulsar External Streams can be created to read or write data for Pulsar.
4341

44-
[Learn more.](/pulsar-external-stream)
42+
[Learn more.](/pulsar-source)
4543

4644
### Upload local files {#csv}
4745

docs/databricks-external.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Databricks
2+
3+
Leveraging HTTP external stream, you can write / materialize data to Databricks directly from Timeplus.
4+
5+
## Write to Databricks {#example-write-to-databricks}
6+
7+
Follow [the guide](https://docs.databricks.com/aws/en/dev-tools/auth/pat) to create an access token for your Databricks workspace.
8+
9+
Assume you have created a table in Databricks SQL warehouse with 2 columns:
10+
```sql
11+
CREATE TABLE sales (
12+
product STRING,
13+
quantity INT
14+
);
15+
```
16+
17+
Create the HTTP external stream in Timeplus:
18+
```sql
19+
CREATE EXTERNAL STREAM http_databricks_t1 (product string, quantity int)
20+
SETTINGS
21+
type = 'http',
22+
http_header_Authorization='Bearer $TOKEN',
23+
url = 'https://$HOST.cloud.databricks.com/api/2.0/sql/statements/',
24+
data_format = 'Template',
25+
format_template_resultset_format='{"warehouse_id":"$WAREHOUSE_ID","statement": "INSERT INTO sales (product, quantity) VALUES (:product, :quantity)", "parameters": [${data}]}',
26+
format_template_row_format='{ "name": "product", "value": ${product:JSON}, "type": "STRING" },{ "name": "quantity", "value": ${quantity:JSON}, "type": "INT" }',
27+
format_template_rows_between_delimiter=''
28+
```
29+
30+
Replace the `TOKEN`, `HOST`, and `WAREHOUSE_ID` to match your Databricks settings. Also change `format_template_row_format` and `format_template_row_format` to match the table schema.
31+
32+
Then you can insert data via a materialized view or just via `INSERT` command:
33+
```sql
34+
INSERT INTO http_databricks_t1(product, quantity) VALUES('test',95);
35+
```
36+
37+
This will insert one row per request. We plan to support batch insert and Databricks specific format to support different table schemas in the future.
38+
39+

docs/datadog-external.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Datadog
2+
3+
Leveraging HTTP external stream, you can write / materialize data to Datadog directly from Timeplus.
4+
5+
## Write to Datadog {#example-write-to-datadog}
6+
7+
Create or use an existing API key with the proper permission for sending data.
8+
9+
Create the HTTP external stream in Timeplus:
10+
```sql
11+
CREATE EXTERNAL STREAM datadog_t1 (event string)
12+
SETTINGS
13+
type = 'http',
14+
data_format = 'JSONEachRow',
15+
output_format_json_array_of_rows = 1,
16+
http_header_DD_API_KEY = 'THE_API_KEY',
17+
http_header_Content_Type = 'application/json',
18+
url = 'https://http-intake.logs.us3.datadoghq.com/api/v2/logs' --make sure you set the right region
19+
```
20+
21+
Then you can insert data via a materialized view or just
22+
```sql
23+
INSERT INTO datadog_t1(message, hostname) VALUES('test message','a.test.com'),('test2','a.test.com');
24+
```

docs/elastic-external.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Elastic Search
2+
3+
Leveraging HTTP external stream, you can write data to Elastic Search or Open Search directly from Timeplus.
4+
5+
## Write to OpenSearch / ElasticSearch {#example-write-to-es}
6+
7+
Assuming you have created an index `students` in a deployment of OpenSearch or ElasticSearch, you can create the following external stream to write data to the index.
8+
9+
```sql
10+
CREATE EXTERNAL STREAM opensearch_t1 (
11+
name string,
12+
gpa float32,
13+
grad_year int16
14+
) SETTINGS
15+
type = 'http',
16+
data_format = 'OpenSearch', --can also use the alias "ElasticSearch"
17+
url = 'https://opensearch.company.com:9200/students/_bulk',
18+
username='admin',
19+
password='..'
20+
```
21+
22+
Then you can insert data via a materialized view or just
23+
```sql
24+
INSERT INTO opensearch_t1(name,gpa,grad_year) VALUES('Jonathan Powers',3.85,2025);
25+
```

0 commit comments

Comments
 (0)