CREATE EXTERNAL TABLE `baseall_oracle` (`k1` decimal(9, 3) NOT NULL COMMENT "",`k2` char(10) NOT NULL COMMENT "",`k3` datetime NOT NULL COMMENT "",`k5` varchar(20) NOT NULL COMMENT "",`k6` double NOT NULL COMMENT "") ENGINE=ODBCCOMMENT "ODBC"PROPERTIES ("host" = "192.168.0.1","port" = "8086","user" = "test","password" = "test","database" = "test","table" = "baseall","driver" = "Oracle 19 ODBC driver","odbc_type" = "oracle");
CREATE EXTERNAL RESOURCE `oracle_odbc`PROPERTIES ("type" = "odbc_catalog","host" = "192.168.0.1","port" = "8086","user" = "test","password" = "test","database" = "test","odbc_type" = "oracle","driver" = "Oracle 19 ODBC driver");CREATE EXTERNAL TABLE `baseall_oracle` (`k1` decimal(9, 3) NOT NULL COMMENT "",`k2` char(10) NOT NULL COMMENT "",`k3` datetime NOT NULL COMMENT "",`k5` varchar(20) NOT NULL COMMENT "",`k6` double NOT NULL COMMENT "") ENGINE=ODBCCOMMENT "ODBC"PROPERTIES ("odbc_catalog_resource" = "oracle_odbc","database" = "test","table" = "baseall");
Parameter | Description |
hosts | IP address of the external table database. |
driver | Driver name of the ODBC external table. The name must be consistent with the Driver name in be/conf/odbcinst.ini. |
odbc_type | Type of the external table database, currently supports Oracle, MySQL, and PostgreSQL. |
user | Username of the external table database. |
password | Cipher information for the application |
charset | Character set used for the database connection. |
PROPERTIES
also supports the special parameters implemented by the ODBC Driver of each database, such as MySQL's sslverify
, etc.[MySQL Driver]Description = ODBC for MySQLDriver = /usr/lib64/libmyodbc8w.soFileUsage = 1
[]
corresponds to the Driver name. When establishing an external table, you must ensure that the Driver name of the external table is consistent with that in the configuration file.Driver=
should be filled in according to the actual installation path of Driver on the BE node, which is essentially a path of dynamic library. Here, the pre-dependency of this dynamic library must be met.select * from oracle_table where k1 > 1000 and k3 ='term' or k4 like '%doris';
insert into oracle_table values(1, "doris");insert into oracle_table select * from postgre_table;
enable_odbc_transcation
.set enable_odbc_transcation = true;
MySQL Version | MySQL ODBC Version |
8.0.27 | 8.0.27, 8.026 |
5.7.36 | 5.3.11, 5.3.13 |
5.6.51 | 5.3.11, 5.3.13 |
5.5.62 | 5.3.11, 5.3.13 |
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
PostgreSQL Version | PostgreSQL ODBC Version |
12.9 | postgresql12-odbc-13.02.0000 |
13.5 | postgresql13-odbc-13.02.0000 |
14.1 | postgresql14-odbc-13.02.0000 |
9.6.24 | postgresql96-odbc-13.02.0000 |
10.6 | postgresql10-odbc-13.02.0000 |
11.6 | postgresql11-odbc-13.02.0000 |
Oracle Version | Oracle ODBC Version |
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production | oracle-instantclient19.13-odbc-19.13.0.0.0 |
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production | oracle-instantclient19.13-odbc-19.13.0.0.0 |
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production | oracle-instantclient19.13-odbc-19.13.0.0.0 |
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production | oracle-instantclient19.13-odbc-19.13.0.0.0 |
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production | oracle-instantclient19.13-odbc-19.13.0.0.0 |
https://download.oracle.com/otn_software/linux/instantclient/1913000/oracle-instantclient19.13-sqlplus-19.13.0.0.0-2.x86_64.rpmhttps://download.oracle.com/otn_software/linux/instantclient/1913000/oracle-instantclient19.13-devel-19.13.0.0.0-2.x86_64.rpmhttps://download.oracle.com/otn_software/linux/instantclient/1913000/oracle-instantclient19.13-odbc-19.13.0.0.0-2.x86_64.rpmhttps://download.oracle.com/otn_software/linux/instantclient/1913000/oracle-instantclient19.13-basic-19.13.0.0.0-2.x86_64.rpm
MySQL Version | MySQL ODBC Version |
8.0.27 | 8.0.11, 5.3.13 |
PostgreSQL Version | PostgreSQL ODBC Version |
12.9 | psqlodbc-12.02.0000 |
sudo apt-get install alien
sudo alien -i oracle-instantclient19.13-basic-19.13.0.0.0-2.x86_64.rpmsudo alien -i oracle-instantclient19.13-devel-19.13.0.0.0-2.x86_64.rpmsudo alien -i oracle-instantclient19.13-odbc-19.13.0.0.0-2.x86_64.rpmsudo alien -i oracle-instantclient19.13-sqlplus-19.13.0.0.0-2.x86_64.rpm
MySQL | Doris | Replacement Scheme |
BOOLEAN | BOOLEAN | - |
CHAR | CHAR | Only UTF8 encoding is currently supported. |
VARCHAR | VARCHAR | Only UTF8 encoding is currently supported. |
DATE | DATE | - |
FLOAT | FLOAT | - |
TINYINT | TINYINT | - |
SMALLINT | SMALLINT | - |
INT | INT | - |
BIGINT | BIGINT | - |
DOUBLE | DOUBLE | - |
DATETIME | DATETIME | - |
DECIMAL | DECIMAL | - |
PostgreSQL | Doris | Replacement Scheme |
BOOLEAN | BOOLEAN | - |
CHAR | CHAR | Only UTF8 encoding is currently supported. |
VARCHAR | VARCHAR | Only UTF8 encoding is currently supported. |
DATE | DATE | - |
REAL | FLOAT | - |
SMALLINT | SMALLINT | - |
INT | INT | - |
BIGINT | BIGINT | - |
DOUBLE | DOUBLE | - |
TIMESTAMP | DATETIME | - |
DECIMAL | DECIMAL | - |
Oracle | Doris | Replacement Scheme |
Not supported | BOOLEAN | Oracle can use number(1) in replace of boolean. |
CHAR | CHAR | - |
VARCHAR | VARCHAR | - |
DATE | DATE | - |
FLOAT | FLOAT | - |
No | TINYINT | Oracle can be replaced by NUMBER |
SMALLINT | SMALLINT | - |
INT | INT | - |
No | BIGINT | Oracle can be replaced by NUMBER |
No | DOUBLE | Oracle can be replaced by NUMBER |
DATETIME | DATETIME | - |
NUMBER | DECIMAL | - |
SQLServer | Doris | Replacement Scheme |
BOOLEAN | BOOLEAN | - |
CHAR | CHAR | Only UTF8 encoding is currently supported. |
VARCHAR | VARCHAR | Only UTF8 encoding is currently supported. |
DATE | DATE | - |
REAL | FLOAT | - |
TINYINT | TINYINT | - |
SMALLINT | SMALLINT | - |
INT | INT | - |
BIGINT | BIGINT | - |
FLOAT | DOUBLE | - |
DATETIME/DATETIME2 | DATETIME | - |
DECIMAL/NUMERIC | DECIMAL | - |
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
, and restart all BEs.driver connect Err: 01000 [unixODBC][Driver Manager]Can't open lib 'Xxx' : file not found (0)
.
The corresponding data Driver is not properly installed on each BE, or the incorrect path is configured in be/conf/odbcinst.ini, or the Driver name is different from be/conf/odbcinst.ini when the table is created.Fail to convert odbc value 'PALO ' TO INT on column:'A'
?
The column A type conversion of the ODBC external table fails, which indicates the data type of the actual column of the external table differs from that of the mapped column of ODBC. The mapping of the column must be modified.explain
query statement to confirm whether Doris push down the required filtering condition.driver connect Err: xxx
occur?
This is usually because of a failure to connect to the database. Err section indicates the connection errors of different databases. It is usually because error occurs in the configuration. You can check whether an incorrect IP address, port, or password have been configured.charset
=utf8mb4
to create a mysql external table, so as to read and write emoji expressions normally.
Was this page helpful?