Skip to content
News briefDT-2026-0197

SQL table functions, written in Java

DuckDB's Java client can now register table functions in pure Java, so any JVM-reachable source becomes a SQL table without a C++ extension.

3 minBig Data & Vector DBs

Geertjan Wielenga and Alex Kasko described the addition on 25 August. Table functions, the things that make a query treat something that is not a table as one, can now be written in Java and registered from the DuckDB Java client, without writing or shipping a C++ extension.

The shape of it

Registration goes through a builder, DuckDBFunctions.tableFunction, which declares the name, the parameters and the implementing class. The function itself has three callbacks: bind runs at prepare time, reads the parameters and settles the output schema; init runs once before execution and sets up shared state; apply is called repeatedly to fill output chunks until the source is exhausted.

The pitch, in the authors' words, is that any data source reachable from Java can be exposed as a SQL table, reusing the streaming and asynchronous client libraries an organisation already runs.

Why the language matters here

The previous route was a native extension, which meant a C++ toolchain in the build and a crash in that code taking the process with it. A table function in Java is an ordinary Maven dependency and cannot segfault the host. It also works from Kotlin, Scala or Clojure, since the requirement is the JVM rather than Java specifically. For a shop whose connectors are already written against JVM client libraries, this removes the export step between the source and the query.

What is not there yet

  • These functions cannot yet be packaged as DuckDB extensions.
  • Bind and init objects need their lifecycle managed by hand, although AutoCloseable is supported.
  • No composite types: no STRUCT, no LIST.

Retold from DuckDB. This is a summary in our own words; follow the link for the original reporting.

Read next

Across the network

Desks that share a zone with this one on the BITBRIEF coverage map.

Terms defined