Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-30702] Add Elasticsearch dialect #136

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
49 changes: 38 additions & 11 deletions docs/content.zh/docs/connectors/table/jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@ JDBC 连接器不是二进制发行版的一部分,请查阅[这里]({{< ref "

在连接到具体数据库时,也需要对应的驱动依赖,目前支持的驱动如下:

| Driver | Group Id | Artifact Id | JAR |
|:-----------|:---------------------------|:-----------------------|:----------------------------------------------------------------------------------------------------------------------------|
| MySQL | `mysql` | `mysql-connector-java` | [下载](https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/) |
| Oracle | `com.oracle.database.jdbc` | `ojdbc8` | [下载](https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc8) |
| PostgreSQL | `org.postgresql` | `postgresql` | [下载](https://jdbc.postgresql.org/download/) |
| Derby | `org.apache.derby` | `derby` | [下载](http://db.apache.org/derby/derby_downloads.html) |
| SQL Server | `com.microsoft.sqlserver` | `mssql-jdbc` | [下载](https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver16) |
| CrateDB | `io.crate` | `crate-jdbc` | [下载](https://repo1.maven.org/maven2/io/crate/crate-jdbc/) |
| Db2 | `com.ibm.db2.jcc` | `db2jcc` | [下载](https://www.ibm.com/support/pages/download-db2-fix-packs-version-db2-linux-unix-and-windows) |
| Trino | `io.trino` | `trino-jdbc` | [下载](https://repo1.maven.org/maven2/io/trino/trino-jdbc/) |
| OceanBase | `com.oceanbase` | `oceanbase-client` | [下载](https://repo1.maven.org/maven2/com/oceanbase/oceanbase-client/) |
| Driver | Group Id | Artifact Id | JAR |
|:--------------|:---------------------------|:-----------------------|:----------------------------------------------------------------------------------------------------------------------------|
| MySQL | `mysql` | `mysql-connector-java` | [下载](https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/) |
| Oracle | `com.oracle.database.jdbc` | `ojdbc8` | [下载](https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc8) |
| PostgreSQL | `org.postgresql` | `postgresql` | [下载](https://jdbc.postgresql.org/download/) |
| Derby | `org.apache.derby` | `derby` | [下载](http://db.apache.org/derby/derby_downloads.html) |
| SQL Server | `com.microsoft.sqlserver` | `mssql-jdbc` | [下载](https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver16) |
| CrateDB | `io.crate` | `crate-jdbc` | [下载](https://repo1.maven.org/maven2/io/crate/crate-jdbc/) |
| Db2 | `com.ibm.db2.jcc` | `db2jcc` | [下载](https://www.ibm.com/support/pages/download-db2-fix-packs-version-db2-linux-unix-and-windows) |
| Trino | `io.trino` | `trino-jdbc` | [下载](https://repo1.maven.org/maven2/io/trino/trino-jdbc/) |
| OceanBase | `com.oceanbase` | `oceanbase-client` | [下载](https://repo1.maven.org/maven2/com/oceanbase/oceanbase-client/) |
| Elasticsearch | `org.elasticsearch.plugin` | `x-pack-sql-jdbc` | [下载](https://www.elastic.co/downloads/jdbc-client) |

当前,JDBC 连接器和驱动不在 Flink 二进制发布包中,请参阅[这里]({{< ref "docs/dev/configuration/overview" >}})了解在集群上执行时如何连接它们。

Expand Down Expand Up @@ -723,6 +724,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<th class="text-left"><a href="https://trino.io/docs/current/language/types.html">Trino type</a></th>
<th class="text-left"><a href="https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000222199">OceanBase MySQL mode type</a></th>
<th class="text-left"><a href="https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000222012">OceanBase Oracle mode type</a></th>
<th class="text-left"><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-data-types.html">Elastic SQL type</a></th>
<th class="text-left"><a href="{{< ref "docs/dev/table/types" >}}">Flink SQL type</a></th>
</tr>
</thead>
Expand All @@ -737,6 +739,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td><code>TINYINT</code></td>
<td><code>TINYINT</code></td>
<td></td>
<td><code>BYTE</code></td>
<td><code>TINYINT</code></td>
</tr>
<tr>
Expand All @@ -759,6 +762,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<code>SMALLINT</code><br>
<code>TINYINT UNSIGNED</code></td>
<td></td>
<td><code>SHORT</code></td>
<td><code>SMALLINT</code></td>
</tr>
<tr>
Expand All @@ -781,6 +785,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<code>MEDIUMINT</code><br>
<code>SMALLINT UNSIGNED</code></td>
<td></td>
<td><code>INTEGER</code></td>
<td><code>INT</code></td>
</tr>
<tr>
Expand All @@ -801,6 +806,9 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<code>BIGINT</code><br>
<code>INT UNSIGNED</code></td>
<td></td>
<td>
<code>LONG</code><br>
<code>UNSIGNED_LONG</code></td>
<td><code>BIGINT</code></td>
</tr>
<tr>
Expand All @@ -813,6 +821,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td></td>
<td><code>BIGINT UNSIGNED</code></td>
<td></td>
<td></td>
<td><code>DECIMAL(20, 0)</code></td>
</tr>
<tr>
Expand All @@ -831,6 +840,9 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td><code>FLOAT</code></td>
<td>
<code>BINARY_FLOAT</code></td>
<td>
<code>FLOAT</code><br>
<code>HALF_FLOAT</code></td>
<td><code>FLOAT</code></td>
</tr>
<tr>
Expand All @@ -849,6 +861,9 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td><code>DOUBLE</code></td>
<td><code>DOUBLE</code></td>
<td><code>BINARY_DOUBLE</code></td>
<td>
<code>DOUBLE</code><br>
<code>SCALED_FLOAT</code></td>
<td><code>DOUBLE</code></td>
</tr>
<tr>
Expand Down Expand Up @@ -877,6 +892,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td>
<code>FLOAT(s)</code><br>
<code>NUMBER(p, s)</code></td>
<td></td>
<td><code>DECIMAL(p, s)</code></td>
</tr>
<tr>
Expand All @@ -894,6 +910,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<code>TINYINT(1)</code></td>
<td></td>
<td><code>BOOLEAN</code></td>
<td><code>BOOLEAN</code></td>
</tr>
<tr>
<td><code>DATE</code></td>
Expand All @@ -905,6 +922,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td><code>DATE</code></td>
<td><code>DATE</code></td>
<td><code>DATE</code></td>
<td></td>
<td><code>DATE</code></td>
</tr>
<tr>
Expand All @@ -917,6 +935,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td><code>TIME_WITHOUT_TIME_ZONE</code></td>
<td><code>TIME [(p)]</code></td>
<td><code>DATE</code></td>
<td></td>
<td><code>TIME [(p)] [WITHOUT TIMEZONE]</code></td>
</tr>
<tr>
Expand All @@ -932,6 +951,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td><code>TIMESTAMP_WITHOUT_TIME_ZONE</code></td>
<td><code>DATETIME [(p)]</code></td>
<td><code>TIMESTAMP [(p)] [WITHOUT TIMEZONE]</code></td>
<td><code>DATETIME</code></td>
<td><code>TIMESTAMP [(p)] [WITHOUT TIMEZONE]</code></td>
</tr>
<tr>
Expand Down Expand Up @@ -980,6 +1000,11 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<code>NCHAR(n)</code><br>
<code>VARCHAR2(n)</code><br>
<code>CLOB</code></td>
<td>
<code>KEYWORD</code><br>
<code>IP</code><br>
<code>TEXT</code><br>
<code>VERSION</code></td>
<td><code>STRING</code></td>
</tr>
<tr>
Expand All @@ -1005,6 +1030,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td>
<code>RAW(s)</code><br>
<code>BLOB</code></td>
<td><code>BINARY</code></td>
<td><code>BYTES</code></td>
</tr>
<tr>
Expand All @@ -1017,6 +1043,7 @@ Flink 支持连接到多个使用方言(dialect)的数据库,如 MySQL、O
<td><code>ARRAY</code></td>
<td></td>
<td></td>
<td></td>
<td><code>ARRAY</code></td>
</tr>
</tbody>
Expand Down
10 changes: 10 additions & 0 deletions docs/content/docs/connectors/datastream/jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,4 +529,14 @@ Please also take Oracle connection pooling into account.

Please refer to the `JdbcXaSinkFunction` documentation for more details.

## License of JDBC driver for Elasticsearch

Flink's JDBC connector defines a Maven dependency on the "JDBC driver for Elasticsearch", which is licensed under
the Elastic License 2.0.
Flink itself neither reuses source code from the "JDBC driver for Elasticsearch"
nor packages binaries from the "JDBC driver for Elasticsearch".
Users that create and publish derivative work based on Flink's JDBC connector (thereby re-distributing
the "JDBC driver for Elasticsearch") must be aware that this may be subject to conditions declared in
the Elastic License 2.0.

{{< top >}}
Loading