forked from apache/seatunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix [Feature][Connector] New SeaTunnel API Connectors apache#1946 Add…
… Druid Source&Sink
- Loading branch information
bo.guan
authored and
laglangyue
committed
Jan 17, 2023
1 parent
9df0094
commit 455012d
Showing
17 changed files
with
1,176 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Druid | ||
|
||
> Druid sink connector | ||
## Description | ||
|
||
Write data to Apache Druid. | ||
|
||
|
||
## Options | ||
|
||
| name | type | required | default value | | ||
| ----------------------- | -------- | -------- | ------------- | | ||
| coordinator_url | `String` | yes | - | | ||
| datasource | `String` | yes | - | | ||
| columns | `List<String>` | yes| __time | | ||
| timestamp_column | `String` | no | timestamp | | ||
| timestamp_format | `String` | no | auto | | ||
| timestamp_missing_value | `String` | no | - | | ||
|
||
### coordinator_url [`String`] | ||
|
||
The URL of Coordinator service in Apache Druid. | ||
|
||
### datasource [`String`] | ||
|
||
The DataSource name in Apache Druid. | ||
|
||
### columns [`List<String>`] | ||
|
||
These columns that you want to write of Druid. | ||
|
||
### timestamp_column [`String`] | ||
|
||
The timestamp column name in Apache Druid, the default value is `timestamp`. | ||
|
||
### timestamp_format [`String`] | ||
|
||
The timestamp format in Apache Druid, the default value is `auto`, it could be: | ||
|
||
- `iso` | ||
- ISO8601 with 'T' separator, like "2000-01-01T01:02:03.456" | ||
|
||
- `posix` | ||
- seconds since epoch | ||
|
||
- `millis` | ||
- milliseconds since epoch | ||
|
||
- `micro` | ||
- microseconds since epoch | ||
|
||
- `nano` | ||
- nanoseconds since epoch | ||
|
||
- `auto` | ||
- automatically detects ISO (either 'T' or space separator) or millis format | ||
|
||
- any [Joda DateTimeFormat](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html) string | ||
|
||
### timestamp_missing_value [`String`] | ||
|
||
The timestamp missing value in Apache Druid, which is used for input records that have a null or missing timestamp. The value of `timestamp_missing_value` should be in ISO 8601 format, for example `"2022-02-02T02:02:02.222"`. | ||
|
||
## Example | ||
|
||
### Simple | ||
|
||
```hocon | ||
DruidSink { | ||
coordinator_url = "http://localhost:8081/" | ||
datasource = "wikipedia" | ||
columns = ["flags","page"] | ||
} | ||
``` | ||
|
||
### Specified timestamp column and format | ||
|
||
```hocon | ||
DruidSink { | ||
coordinator_url = "http://localhost:8081/" | ||
datasource = "wikipedia" | ||
timestamp_column = "timestamp" | ||
timestamp_format = "auto" | ||
columns = ["flags","page"] | ||
} | ||
``` | ||
|
||
### Specified timestamp column, format and missing value | ||
|
||
```hocon | ||
DruidSink { | ||
coordinator_url = "http://localhost:8081/" | ||
datasource = "wikipedia" | ||
timestamp_column = "timestamp" | ||
timestamp_format = "auto" | ||
timestamp_missing_value = "2022-02-02T02:02:02.222" | ||
columns = ["flags","page"] | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Druid | ||
|
||
> Druid source connector | ||
## Description | ||
|
||
Read data from Apache Druid. | ||
|
||
## Options | ||
|
||
| name | type | required | default value | | ||
| ---------- | -------------- | -------- | ------------- | | ||
| url | `String` | yes | - | | ||
| datasource | `String` | yes | - | | ||
| start_date | `String` | no | - | | ||
| end_date | `String` | no | - | | ||
| columns | `List<String>` | no | `*` | | ||
|
||
### url [`String`] | ||
|
||
The URL of JDBC of Apache Druid. | ||
|
||
### datasource [`String`] | ||
|
||
The DataSource name in Apache Druid. | ||
|
||
### start_date [`String`] | ||
|
||
The start date of DataSource, for example, `'2016-06-27'`, `'2016-06-27 00:00:00'`, etc. | ||
|
||
### end_date [`String`] | ||
|
||
The end date of DataSource, for example, `'2016-06-28'`, `'2016-06-28 00:00:00'`, etc. | ||
|
||
### columns [`List<String>`] | ||
|
||
These columns that you want to write of DataSource. | ||
|
||
### common options [string] | ||
|
||
Source Plugin common parameters, refer to [Source Plugin](common-options.mdx) for details | ||
|
||
|
||
## Example | ||
|
||
```hocon | ||
DruidSource { | ||
url = "jdbc:avatica:remote:url=http://localhost:8082/druid/v2/sql/avatica/" | ||
datasource = "wikipedia" | ||
start_date = "2016-06-27 00:00:00" | ||
end_date = "2016-06-28 00:00:00" | ||
columns = ["flags","page"] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>seatunnel-connectors-v2</artifactId> | ||
<groupId>org.apache.seatunnel</groupId> | ||
<version>${revision}</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>connector-druid</artifactId> | ||
|
||
<properties> | ||
<jackson-datatype-joda.version>2.6.7</jackson-datatype-joda.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.seatunnel</groupId> | ||
<artifactId>connector-common</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-joda</artifactId> | ||
<version>${jackson-datatype-joda.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>httpclient</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.alibaba</groupId> | ||
<artifactId>fastjson</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>joda-time</groupId> | ||
<artifactId>joda-time</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.druid</groupId> | ||
<artifactId>druid-indexing-service</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.druid</groupId> | ||
<artifactId>druid-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.calcite.avatica</groupId> | ||
<artifactId>avatica-core</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
Oops, something went wrong.