Skip to main content
Applies to: Embedded ❌, Enterprise ✅ There is no SQL type layer over Lance storage. The table provider hands DataFusion the dataset’s Arrow schema directly, so a column is the same object to the query engine as it is to the format. The consequence is that SQL type names here are spellings of Arrow types, not a system that maps onto them. Data types documents the storage side; this page covers what changes when you reach a column from SQL.

The Arrow types a column can be

Two limits are worth stating because they surface as schema errors rather than as documentation:
  • A map with keys_sorted = true is rejected. Sorted-key maps do not survive the round trip through the Python bindings, so they are refused rather than silently unsorted.
  • Not every type is legal as a fixed_size_list child. The vector case is, which is what matters in practice.

SQL names for Arrow types

DataFusion’s type reference describes the full mapping.

Types SQL has no name for

Some column kinds have no SQL type name.

Vectors

A dense vector column has a fixed dimension, commonly represented as FixedSizeList<Float32, dim>. Other supported vector element types are possible; inspect the column with arrow_typeof rather than assuming Float32. It is selectable and testable for nullness:
A list representation does not imply that ordinary arithmetic operators perform vector arithmetic. Use supported distance functions for similarity calculations. SQL vector search depends on the Enterprise server version and query plan; see SQL.

bfloat16

Sixteen-bit floats in the bfloat16 layout, stored as fixed_size_binary(2). Useful as a vector element type when halving the memory matters more than the precision does.

Pseudo-columns

Availability depends on the SQL table provider. The ordinary table provider exposes the stored dataset schema; naming a Lance scan metadata field does not make it available as a SQL column. The fts() provider adds _score to its schema, so _score is included in SELECT * FROM fts(...). _rowid, _rowaddr, and _rowoffset describe Lance scan metadata, not columns automatically registered on an ordinary SQL table. Select _score from an fts() relation explicitly when you want a projection containing it.

Casting

TRY_CAST yields null rather than failing the query on a value that will not convert. See Operators.