@@ -55,7 +55,7 @@ A driver dependency is also required to connect to a specified database. Here ar
55
55
| CrateDB | ` io.crate ` | ` crate-jdbc ` | [ Download] ( https://repo1.maven.org/maven2/io/crate/crate-jdbc/ ) |
56
56
| Db2 | ` com.ibm.db2.jcc ` | ` db2jcc ` | [ Download] ( https://www.ibm.com/support/pages/download-db2-fix-packs-version-db2-linux-unix-and-windows ) |
57
57
| Trino | ` io.trino ` | ` trino-jdbc ` | [ Download] ( https://repo1.maven.org/maven2/io/trino/trino-jdbc/ ) |
58
-
58
+ | Elasticsearch | ` org.elasticsearch.plugin ` | ` x-pack-sql-jdbc ` | [ Download ] ( https://www.elastic.co/downloads/jdbc-client ) |
59
59
60
60
JDBC connector and drivers are not part of Flink's binary distribution. See how to link with them for cluster execution [ here] ({{< ref "docs/dev/configuration/overview" >}}).
61
61
@@ -647,7 +647,7 @@ SELECT * FROM `custom_schema.test_table2`;
647
647
648
648
Data Type Mapping
649
649
----------------
650
- Flink supports connect to several databases which uses dialect like MySQL, Oracle, PostgreSQL, CrateDB, Derby, SQL Server, Db2. The Derby dialect usually used for testing purpose. The field data type mappings from relational databases data types to Flink SQL data types are listed in the following table, the mapping table can help define JDBC table in Flink easily.
650
+ Flink supports connect to several databases which uses dialect like MySQL, Oracle, PostgreSQL, CrateDB, Derby, SQL Server, Db2, Elasticsearch . The Derby dialect usually used for testing purpose. The field data type mappings from relational databases data types to Flink SQL data types are listed in the following table, the mapping table can help define JDBC table in Flink easily.
651
651
652
652
<table class =" table table-bordered " >
653
653
<thead>
@@ -659,6 +659,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
659
659
<th class="text-left"><a href="https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql?view=sql-server-ver16">SQL Server type</a></th>
660
660
<th class="text-left"><a href="https://www.ibm.com/docs/en/db2-for-zos/12?topic=columns-data-types">Db2</a></th>
661
661
<th class="text-left"><a href="https://trino.io/docs/current/language/types.html">Trino type</a></th>
662
+ <th class="text-left"><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-data-types.html">Elastic SQL type</a></th>
662
663
<th class="text-left"><a href="{{< ref "docs/dev/table/types" >}}">Flink SQL type</a></th>
663
664
</tr>
664
665
</thead>
@@ -671,6 +672,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
671
672
<td><code>TINYINT</code></td>
672
673
<td></td>
673
674
<td><code>TINYINT</code></td>
675
+ <td><code>BYTE</code></td>
674
676
<td><code>TINYINT</code></td>
675
677
</tr>
676
678
<tr>
@@ -689,6 +691,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
689
691
<td><code>SMALLINT</code></td>
690
692
<td><code>SMALLINT</code></td>
691
693
<td><code>SMALLINT</code></td>
694
+ <td><code>SHORT</code></td>
692
695
<td><code>SMALLINT</code></td>
693
696
</tr>
694
697
<tr>
@@ -706,6 +709,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
706
709
<td><code>INT</code></td>
707
710
<td><code>INTEGER</code></td>
708
711
<td><code>INTEGER</code></td>
712
+ <td><code>INTEGER</code></td>
709
713
<td><code>INT</code></td>
710
714
</tr>
711
715
<tr>
@@ -722,6 +726,9 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
722
726
<td><code>BIGINT</code></td>
723
727
<td></td>
724
728
<td><code>BIGINT</code></td>
729
+ <td>
730
+ <code>LONG</code><br>
731
+ <code>UNSIGNED_LONG</code></td>
725
732
<td><code>BIGINT</code></td>
726
733
</tr>
727
734
<tr >
@@ -731,6 +738,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
731
738
<td></td>
732
739
<td></td>
733
740
<td></td>
741
+ <td></td>
734
742
<td></td>
735
743
<td><code>DECIMAL(20, 0)</code></td>
736
744
</tr>
@@ -747,6 +755,9 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
747
755
<td><code>REAL</code></td>
748
756
<td><code>REAL</code></td>
749
757
<td><code>FLOAT</code></td>
758
+ <td>
759
+ <code>FLOAT</code><br>
760
+ <code>HALF_FLOAT</code></td>
750
761
<td><code>FLOAT</code></td>
751
762
</tr>
752
763
<tr>
@@ -762,6 +773,9 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
762
773
<code>DOUBLE PRECISION</code></td>
763
774
<td><code>FLOAT</code></td>
764
775
<td><code>DOUBLE</code></td>
776
+ <td>
777
+ <code>DOUBLE</code><br>
778
+ <code>SCALED_FLOAT</code></td>
765
779
<td><code>DOUBLE</code></td>
766
780
</tr>
767
781
<tr>
@@ -784,6 +798,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
784
798
<code>DECIMAL(p, s)</code>
785
799
</td>
786
800
<td><code>DECIMAL(p, s)</code></td>
801
+ <td></td>
787
802
<td><code>DECIMAL(p, s)</code></td>
788
803
</tr>
789
804
<tr>
@@ -797,6 +812,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
797
812
<td><code>BOOLEAN</code></td>
798
813
<td></td>
799
814
<td><code>BOOLEAN</code></td>
815
+ <td><code>BOOLEAN</code></td>
800
816
</tr>
801
817
<tr>
802
818
<td><code>DATE</code></td>
@@ -806,6 +822,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
806
822
<td><code>DATE</code></td>
807
823
<td><code>DATE</code></td>
808
824
<td><code>DATE</code></td>
825
+ <td></td>
809
826
<td><code>DATE</code></td>
810
827
</tr>
811
828
<tr>
@@ -816,6 +833,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
816
833
<td><code>TIME(0)</code></td>
817
834
<td><code>TIME</code></td>
818
835
<td><code>TIME_WITHOUT_TIME_ZONE</code></td>
836
+ <td></td>
819
837
<td><code>TIME [(p)] [WITHOUT TIMEZONE]</code></td>
820
838
</tr>
821
839
<tr>
@@ -829,6 +847,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
829
847
</td>
830
848
<td><code>TIMESTAMP [(p)]</code></td>
831
849
<td><code>TIMESTAMP_WITHOUT_TIME_ZONE</code></td>
850
+ <td><code>DATETIME</code></td>
832
851
<td><code>TIMESTAMP [(p)] [WITHOUT TIMEZONE]</code></td>
833
852
</tr>
834
853
<tr>
@@ -868,6 +887,11 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
868
887
<code>CHAR</code>
869
888
<code>VARCHAR</code>
870
889
</td>
890
+ <td>
891
+ <code>KEYWORD</code><br>
892
+ <code>IP</code><br>
893
+ <code>TEXT</code><br>
894
+ <code>VERSION</code></td>
871
895
<td><code>STRING</code></td>
872
896
</tr>
873
897
<tr>
@@ -886,6 +910,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
886
910
</td>
887
911
<td></td>
888
912
<td><code>VARBINARY</code></td>
913
+ <td><code>BINARY</code></td>
889
914
<td><code>BYTES</code></td>
890
915
</tr>
891
916
<tr>
@@ -895,6 +920,7 @@ Flink supports connect to several databases which uses dialect like MySQL, Oracl
895
920
<td><code>ARRAY</code></td>
896
921
<td></td>
897
922
<td></td>
923
+ <td></td>
898
924
<td><code>ARRAY</code></td>
899
925
<td><code>ARRAY</code></td>
900
926
</tr>
0 commit comments