Starting from version 2.1, Doris can support multiple SQL dialects, such as Presto, Trino, Hive, PostgreSQL, Spark, Oracle, Clickhouse, and more. Through this feature, users can directly use the corresponding SQL dialect to query data in Doris, which facilitates users to smoothly migrate their original business to Doris.
This function is currently an experimental function. If you encounter any problems during use, you are welcome to provide feedback through the mail group, Github issue, etc. .
This function only supports query statements and does not support other DDL and DML statements including Explain.
Download latest SQL Transform Tool.
On any FE node, start the service through the following command:
nohup ./transform-doris-tool-1.0.0-bin-x86 run --host=0.0.0.0 --port=5001 &
This service is a stateless service and can be started and stopped at any time.
5001is the service port and can be arbitrarily specified as an available port.
It is recommended to start a separate service on each FE node.
Start the Doris cluster (version 2.1 or higher)
Set the URL of the SQL Dialect Conversion Service with the following command in Doris:
MySQL> set global sql_converter_service_url = "http://127.0.0.1:5001/api/v1/convert"
127.0.0.1:5001is the deployment node IP and port of the SQL dialect conversion service.
Use SQL dialect
Here we take the Presto/Trino SQL dialect as an example:
set sql_dialect = "presto";
- Execute any Presto/Trino SQL syntax for data query.
Currently supported dialect types include: