CREATE CATALOG jdbc_mysql PROPERTIES ("type"="jdbc","user"="root","password"="123456","jdbc_url" = "jdbc:mysql://127.0.0.1:3306/demo","driver_url" = "mysql-connector-java-5.1.47.jar","driver_class" = "com.mysql.jdbc.Driver");
CREATE CATALOG jdbc_postgresql PROPERTIES ("type"="jdbc","user"="root","password"="123456","jdbc_url" = "jdbc:postgresql://127.0.0.1:5449/demo","driver_url" = "postgresql-42.5.1.jar","driver_class" = "org.postgresql.Driver");
Doris | PostgreSQL |
Catalog | Database |
Database | Schema |
Table | Table |
select nspname from pg_namespace where has_schema_privilege('<UserName>', nspname, 'USAGE');
CREATE CATALOG jdbc_oracle PROPERTIES ("type"="jdbc","user"="root","password"="123456","jdbc_url" = "jdbc:oracle:thin:@127.0.0.1:1521:helowin","driver_url" = "ojdbc6.jar","driver_class" = "oracle.jdbc.driver.OracleDriver");
Doris | Oracle |
Catalog | Database |
Database | User |
Table | Table |
CREATE CATALOG jdbc_clickhouse PROPERTIES ("type"="jdbc","user"="root","password"="123456","jdbc_url" = "jdbc:clickhouse://127.0.0.1:8123/demo","driver_url" = "clickhouse-jdbc-0.3.2-patch11-all.jar","driver_class" = "com.clickhouse.jdbc.ClickHouseDriver");
CREATE CATALOG sqlserver_catalog PROPERTIES ("type"="jdbc","user"="SA","password"="Doris123456","jdbc_url" = "jdbc:sqlserver://localhost:1433;DataBaseName=doris_test", "driver_url" = "mssql-jdbc-11.2.3.jre8.jar","driver_class" = "com.microsoft.sqlserver.jdbc.SQLServerDriver");
Doris | SQLServer |
Catalog | Database |
Database | Schema |
Table | Table |
CREATE CATALOG doris_catalog PROPERTIES ("type"="jdbc","user"="root","password"="123456","jdbc_url" = "jdbc:mysql://127.0.0.1:9030?useSSL=false","driver_url" = "mysql-connector-java-5.1.47.jar","driver_class" = "com.mysql.jdbc.Driver");
Parameter | Required | Default Value | Description |
User | Yes | - | Username of the corresponding database |
Password | Yes | - | Password for the corresponding database |
jdbc_url | Yes | - | JDBC connection string |
driver_url | Yes | - | JDBC Driver Jar package name* |
driver_class | Yes | - | JDBC Driver Class name |
only_specified_database | No | "false" | Specify whether to only synchronize the specified database |
lower_case_table_names | No | "false" | Whether to synchronize the table name of the JDBC external data source in lowercase |
include_database_list | No | "" | When only_specified_database=true, specify to synchronize multiple databases, separated by ','. The db name is case-sensitive. |
exclude_database_list | No | "" | When only_specified_database=true, specify multiple databases that don't need to be synchronized, separated by ','. The db name is case-sensitive. |
Driver_url
can be specified in the following three ways:mysql-connector-java-5.1.47.jar
. The Jar package must be stored in the jdbc_drivers/
directory of the FE and BE deployment directory in advance. The system will automatically find the package in this directory. The location of this directory can also be modified by thejdbc_drivers_dir
configuration in fe.conf and be.conf.file:///path/to/mysql-connector-java-5.1.47.jar
. The Jar package must be stored in the path specified by all the FE/BE nodes in advance.https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/jdbc_driver/mysql-connector-java-5.1.47.jar
. The system will download the driver file from this http address. Only unauthenticated http services are supported.only_specified_database
: When connecting to jdbc, you can specify which database/schema to link to, such as: database can be specified in jdbc_url of MySQL, and currentSchema can be specified in jdbc_url of pg.include_database_list
: when only_specified_database=true, specify the databases to be synchronized, separated by ','. The default is '', that is, to synchronize all the databases without filtering. The db name is case-sensitive.exclude_database_list
: When only_specified_database=true, specify multiple databases that don't need to be synchronized, separated by ','. The default is '', that is, to sync all the databases without filtering. The db name is case-sensitive.include_database_list
and exclude_database_list
overlap,exclude_database_list
will take priority to take effect first.select * from mysql_catalog.mysql_database.mysql_table where t1 > 1000 and t2 ='term';
MYSQL Type | Doris Type | Comment |
BOOLEAN | BOOLEAN | - |
TINYINT | TINYINT | - |
SMALLINT | SMALLINT | - |
MEDIUMINT | INT | - |
INT | INT | - |
BIGINT | BIGINT | - |
UNSIGNED TINYINT | SMALLINT | Doris does not have an UNSIGNED data type, so it is enlarged by an order of magnitude. |
UNSIGNED MEDIUMINT | INT | Doris does not have an UNSIGNED data type, so it is enlarged by an order of magnitude. |
UNSIGNED INT | BIGINT | Doris does not have an UNSIGNED data type, so it is enlarged by an order of magnitude. |
UNSIGNED BIGINT | LARGEINT | - |
FLOAT | FLOAT | - |
DOUBLE | DOUBLE | - |
DECIMAL | DECIMAL | - |
DATE | DATE | - |
TIMESTAMP | DATETIME | - |
DATETIME | DATETIME | - |
YEAR | SMALLINT | - |
TIME | STRING | - |
CHAR | CHAR | - |
VARCHAR | VARCHAR | - |
TINYTEXT,TEXT,MEDIUMTEXT,LONGTEXT,TINY blob , blob ,MEDIUM blob ,LONG blob ,TINYSTRING,STRING,MEDIUMSTRING,LONGSTRING,BINARY,VARBINARY,JSON,SET,BIT | STRING | - |
Other | UNSUPPORTED | - |
POSTGRESQL Type | Doris Type | Comment |
boolean | BOOLEAN | - |
smallint/int2 | SMALLINT | - |
integer/int4 | INT | - |
bigint/int8 | BIGINT | - |
decimal/numeric | DECIMAL | - |
real/float4 | FLOAT | - |
double precision | DOUBLE | - |
smallserial | SMALLINT | - |
serial | INT | - |
bigserial | BIGINT | - |
char | CHAR | - |
varchar/text | STRING | - |
timestamp | DATETIME | - |
date | DATE | - |
time | STRING | - |
interval | STRING | - |
point/line/lseg/box/path/polygon/circle | STRING | - |
cidr/inet/macaddr | STRING | - |
bit/bit(n)/bit varying(n) | STRING | The BIT type is mapped to the STRING type of Doris, and the read data is true/false instead of 1/0. |
uuid/JSONB | STRING | - |
Other | UNSUPPORTED | - |
ORACLE Type | Doris Type | Comment |
number(p) / number(p,0) | TINYINT/SMALLINT/INT/BIGINT/LARGEINT | Doris selects the corresponding type based on the size of p: p < 3 -> TINYINT; p < 5 -> SMALLINT; p < 10 -> INT; p < 19 -> BIGINT; p > 19 -> LARGEINT |
number(p,s), [ if(s>0 && p>s) ] | DECIMAL(p,s) | - |
number(p,s), [ if(s>0 && p < s) ] | DECIMAL(s,s) | - |
number(p,s), [ if(s<0) ] | TINYINT/SMALLINT/INT/BIGINT/LARGEINT | When s<0, Doris sets p as p+|s| and maps the same as number(p) / number(p,0). |
number | - | Doris currently does not support Oracle type with unspecified p and s. |
decimal | DECIMAL | - |
float/real | DOUBLE | - |
DATE | DATETIME | - |
TIMESTAMP | DATETIME | - |
CHAR/NCHAR | STRING | - |
VARCHAR2/NVARCHAR2 | STRING | - |
LONG/ RAW/ LONG RAW/ INTERVAL | STRING | - |
Other | UNSUPPORTED | - |
SQLServer Type | Doris Type | Comment |
bit | BOOLEAN | - |
tinyint | SMALLINT | The tinyint of SQLServer is unsigned, so it is mapped to SMALLINT of Doris. |
smallint | SMALLINT | - |
int | INT | - |
bigint | BIGINT | - |
real | FLOAT | - |
float | DOUBLE | - |
money | DECIMAL(19,4) | - |
smallmoney | DECIMAL(10,4) | - |
decimal/numeric | DECIMAL | - |
date | DATE | - |
datetime/datetime2/smalldatetime | DATETIMEV2 | - |
char/varchar/text/nchar/nvarchar/ntext | STRING | - |
binary/varbinary | STRING | - |
time/datetimeoffset | STRING | - |
Other | UNSUPPORTED | - |
ClickHouse Type | Doris Type | Comment |
Bool | BOOLEAN | - |
String | STRING | - |
Date/Date32 | DATEV2 | The Jdbc Catalog uses the DATEV2 type to connect to ClickHouse by default. |
DateTime/DateTime64 | DATETIMEV2 | The Jdbc Catalog uses the DATETIMEV2 type to connect to ClickHouse by default. |
Float32 | FLOAT | - |
Float64 | DOUBLE | - |
Int8 | TINYINT | - |
Int16/UInt8 | SMALLINT | Doris does not have an UNSIGNED data type, so it is enlarged by an order of magnitude. |
Int32/UInt16 | INT | Doris does not have an UNSIGNED data type, so it is enlarged by an order of magnitude. |
Int64/Uint32 | BIGINT | Doris does not have an UNSIGNED data type, so it is enlarged by an order of magnitude. |
Int128/UInt64 | LARGEINT | Doris does not have an UNSIGNED data type, so it is enlarged by an order of magnitude. |
Int256/UInt128/UInt256 | STRING | Doris does not have data type of this magnitude, it is processed with STRING. |
DECIMAL | DECIMAL/DECIMALV3/STRING | The type is decided based on the (precision, scale) of Doris DECIMAL field and the enable_decimal_conversion switch. |
Enum/IPv4/IPv6/UUID | STRING | When displaying, IPv4 and IPv6 will display an extra "/" at the very beginning of the data. You need to handle it using the split_part function. |
Array | ARRAY | The adaptation logic of Array internal types refers to the above types. Nested types are not supported. |
Other | UNSUPPORTED | - |
Was this page helpful?