t8y2/dbx · error
unsupported IoTDB SQL dialect: %s
Error message
unsupported IoTDB SQL dialect: %s
What it means
parseConnectionConfig reads the sql_dialect (or dialect) query parameter, lowercases it, and only accepts client.TreeSqlDialect (tree) or client.TableSqlDialect (table). Any other value aborts connection setup with 'unsupported IoTDB SQL dialect: %s'.
Source
Thrown at agents/drivers/iotdb/driver.go:160
}
query = parsed.Query()
}
if raw := strings.TrimSpace(params.URLParams); raw != "" {
values, err := url.ParseQuery(strings.TrimPrefix(raw, "?"))
if err != nil {
return connectionConfig{}, fmt.Errorf("parse IoTDB URL parameters: %w", err)
}
for key, entries := range values {
query[key] = entries
}
}
if dialect := strings.ToLower(strings.TrimSpace(firstQueryValue(query, "sql_dialect", "dialect"))); dialect != "" {
switch dialect {
case client.TreeSqlDialect, client.TableSqlDialect:
config.Dialect = dialect
default:
return connectionConfig{}, fmt.Errorf("unsupported IoTDB SQL dialect: %s", dialect)
}
}
if database := strings.TrimSpace(firstQueryValue(query, "database", "db")); database != "" {
config.Database = database
}
if value := firstQueryValue(query, "fetch_size", "fetchSize"); value != "" {
parsed, err := positiveInt(value, "fetch_size")
if err != nil {
return connectionConfig{}, err
}
config.FetchSize = int32(parsed)
}
if value := firstQueryValue(query, "time_zone", "timezone", "zone_id"); value != "" {
config.TimeZone = value
}
if value := firstQueryValue(query, "connect_retry_max", "connectRetryMax"); value != "" {
parsed, err := positiveInt(value, "connect_retry_max")
if err != nil {View on GitHub (pinned to c0390bff16)
Solutions
- Use exactly 'tree' or 'table' (case-insensitive) as the sql_dialect/dialect value.
- Remove the dialect parameter to fall back to the default tree dialect.
- Verify your IoTDB server version supports the chosen dialect (table model requires 2.x).
- Compare against the client constants client.TreeSqlDialect / client.TableSqlDialect.
Example fix
// before "iotdb://root:root@127.0.0.1:6667?sql_dialect=treemodel" // after "iotdb://root:root@127.0.0.1:6667?sql_dialect=table"
Defensive patterns
Strategy: validation
Validate before calling
func validDialect(params connectParams) error {
for _, v := range []string{params.URLParams} {
q, err := url.ParseQuery(strings.TrimPrefix(v, "?"))
if err != nil {
continue
}
for _, key := range []string{"sql_dialect", "dialect"} {
if d := strings.ToLower(strings.TrimSpace(q.Get(key))); d != "" && d != "tree" && d != "table" {
return fmt.Errorf("dialect %q must be tree or table", d)
}
}
}
return nil
} Try / catch
_, err := newServer(params)
if err != nil && strings.Contains(err.Error(), "unsupported IoTDB SQL dialect") {
params.URLParams = stripParam(params.URLParams, "sql_dialect") // fall back to default tree dialect
_, err = newServer(params)
} Prevention
- Only use the literals 'tree' or 'table' for sql_dialect.
- Omit the parameter when the default (tree) dialect is fine.
- Centralize connection-string construction in one validated helper.
When it happens
Trigger: Passing sql_dialect=tree_model, dialect=TREE-MODEL, dialect=relational, or any typo'd/unknown value in the connection string query or URLParams.
Common situations: Users coming from JDBC docs write dialect values the IoTDB Go client doesn't recognize; server versions with different dialect naming; users assume the value matches the server-side config property name.
Related errors
- Hive host is required
- Hive endpoint is empty
- Hive JWT authentication requires jwt or the JWT environment
- Hive delegation token authentication requires delegationToke
- ZooKeeper server list is empty
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/e41b8e27222e593b.
Report an issue: GitHub.