Skip to content

v0.11.0

Choose a tag to compare

@kenshaw kenshaw released this 06 Oct 22:27
· 51 commits to main since this release

This release adds the driver druid, for Apache Druid. No other driver changes for a caller.

New

  • Apache Druid. The package druid runs SQL on Apache Druid through POST /druid/v2/sql on the Router, measured on Druid 36.0.0 and 37.0.0. The DSN is druid://user:password@host:8888, with the keys tls, timezone and timeout and no path (D164).
  • Read only. The SQL API of Druid refuses INSERT, UPDATE and DELETE, and runs INSERT and REPLACE only as tasks that end later. The driver sends no task, so each write fails with the refusal of the server (D163).
  • Reading. A query reads arrayLines with the three rows of the header, one line at a time. An error after some rows ends the answer with HTTP 200 and no text, so an answer that ends with no empty line was cut short. The error then wraps dbimp.ErrIncomplete and druid.ErrCut.
  • Cancel. Druid runs a query on when its client leaves. Each query carries a sqlQueryId, and the driver sends DELETE /druid/v2/sql/{id} when the context ends and when the caller closes the rows before the end.
  • Types. A DECIMAL is a float64, because the server computes it as a double. A multi-value string with more than one value is a []any, and a plain string whose text is a JSON array of two or more strings is a []any too. A time is a time.Time in the zone of the key timezone, a date is a dbimp.Date, and an ARRAY is a []any (D164).
  • Options. WithTimeout, WithParameter and WithTimeZone apply to one statement. WithDatabase fails, because Druid has no database to choose.

Tests of Druid

The integration tests of Druid passed on Druid 36.0.0 and 37.0.0 on the machine of the author. In CI, the integration jobs of Druid had not finished when this release was tagged, so no CI run of Druid backs it yet. A push runs the round trip of three types, because each write is a task of the server that takes 5 to 12 seconds, and the run of the schedule, or a manual run, sets DBIMP_FULL and runs every type (D172).

What a caller must know

  • BeginTx fails with dbimp.ErrNotSupported, because Druid has no transactions.
  • The ordinary user of dbmeta cannot read the version: GET /status and sys.servers answer HTTP 403.
  • A named argument fails. The server binds each ? as a typed value, from the Go type of the argument, and a []byte argument fails.

Fixes

  • Neo4j, ArangoDB and Druid. When the context of a query ends, Go closes its done channel before it starts the function that sends the cancel. The transport could see the end in that window, and the driver then never stopped the statement on the server. The watch of each driver now sends the stop itself in that case. This fault is in v0.10.2 and earlier for Neo4j and ArangoDB.
  • Databend tests. A test expected dbimp.ErrIncomplete after an error that the server could send before any row. It now expects the wrap only after a row (D107).

Other changes

  • Six targets are measured and decided (D162 to D169): Druid, Drill, Solr, Elasticsearch, OpenSearch and DynamoDB. Only Druid has a driver in this release.
  • QuestDB and GreptimeDB get no driver, because usql reaches each one on a wire protocol that it ships already (D170). The drivers write no DDL (D171).
  • The workflow pins dbmeta at its release v0.1.0, and gives -timeout 150m to the integration tests of every driver.