Apache Doris connector¶
Apache Doris is reached through its FE's
MySQL-protocol port with the same adapter as MySQL, and compiled SQL
is generated for the Doris dialect, which keeps FULL OUTER JOIN (unlike MySQL
and TiDB).
Doris also offers Arrow Flight SQL: add one key and result sets are pulled as Arrow batches straight from the BEs instead of being serialized row by row through the FE.
Gated by exec-mysql, plus exec-flightsql for the Arrow path.
Connection profile¶
datasources:
doris:
type: doris
host: doris.internal
port: 9030 # FE MySQL-protocol port
username: dosi
password: ${DORIS_PASSWORD}
database: analytics
With Arrow Flight SQL:
Parameters¶
| Key | Type | Required | Default | Notes |
|---|---|---|---|---|
type |
string | yes | — | doris |
host |
string | yes* | — | *Unless uri: is given. Also the Flight SQL host. |
port |
int | no | 3306 (driver default) |
The FE MySQL port — normally 9030; set it explicitly. |
username |
string | no | — | Also the Flight SQL handshake user, where it defaults to root. |
password |
string | no | — | Prefer ${VAR}. |
database |
string | no | — | On the Flight path it is applied as USE <database> after the handshake. |
arrow_flight_port |
int | no | — | Presence switches the executor. Doris calls this arrow_flight_sql_port in fe.conf (Doris ≥ 2.1.5 recommended); Dosi uses one key name for both engines. |
uri |
string | no | — | A mysql:// DSN. It replaces the discrete host/port/username/password/database keys. |
default |
bool | no | false |
See connection profiles. |
Parsed and ignored on this connector: sslmode, sslrootcert, schema,
catalog, account, role, warehouse, compat_mode.
Arrow-native results¶
The key is the only configuration change; see Arrow. What to watch for:
- BE reachability. The FE hands the client each BE's own address for the
data pull, so that address must be routable from wherever Dosi runs. When it
is not, use the FE proxy settings (
public_host+arrow_flight_sql_proxy_port). - Seed over the MySQL wire. Keep
port:in the profile so schema management and seeding have a path that does not depend on the Flight endpoint.
Without exec-flightsql in the build, the key errors rather than silently
falling back.
Limitations¶
- No
NTH_VALUE— annth_valuewindow is refused at compile time for this dialect.FIRST_VALUE/LAST_VALUEare unaffected. - Degenerate
CORR/COVAR_*windows differ. Over a single-row frame Doris returns0where the standard result is NULL, so those two-argument statistical windows are refused rather than returning a value that disagrees with every other engine. - No 3-argument
DATEDIFF. COUNT(*)is not accepted underOVERin Doris 2.1 — the compiler emitsCOUNT(1)for you, so this one needs no action.- No TLS on either path.
Verify the connection¶
$ dosi query --model model.yaml \
--metrics revenue --group-by orders.status --execute --connection doris
Troubleshooting¶
| Message | Cause and fix |
|---|---|
datasource "x" sets arrow_flight_port but this build lacks the exec-flightsql feature |
Rebuild with --features exec-flightsql (or exec-all), or drop the key. |
flight sql connect: <e> |
The FE Flight port is unreachable, or a BE address is not routable from this client — see the proxy settings above. |
flight sql handshake: <e> |
Credentials rejected by the Flight service. |
cannot reach server: <io error> |
MySQL-wire path: host, port or network. The FE port is 9030. |
server rejected SQL (<code>): <message> |
Doris refused the compiled statement. |
Reference¶
- Official site: https://doris.apache.org/
- Connection configuration: Connect to database and Arrow Flight SQL connect
- Same adapter: StarRocks · MySQL · TiDB
- Arrow · Connection profiles