lancedb/lancedb · error
Unsupported data type
Error message
Unsupported data type
What it means
Thrown by dataTypeToJson in nodejs/lancedb/arrow.ts when it encounters an Arrow DataType it cannot map to the JSON type descriptor used to communicate with the remote/Lance server. Only the supported set (numeric, string, binary, temporal, list, struct, fixed-size-list, dictionary, etc.) is handled.
Solutions
- Remove or convert the unsupported column to a supported type (e.g. store as struct, list, or encoded string).
- Upgrade nodejs lancedb to the latest version, which supports more Arrow types.
- Inspect the exact offending type with console.log(field.type) and map it manually.
- If the type should be supported, file an issue upstream.
Example fix
// before schema with column of type new Union([...]) // after flatten the union into explicit columns or encode it as a Utf8 JSON string
Defensive patterns
Strategy: validation
Validate before calling
for (const field of table.schema.fields) {
if (field.type instanceof Union) {
throw new Error(`unsupported column type for remote: ${field.name} (${field.type})`);
}
} Try / catch
try {
await db.tableName('t').add(data);
} catch (e) {
if (e.message === 'Unsupported data type') {
// convert the offending column to a supported type
}
} Prevention
- Stick to the documented supported Arrow types for columns sent to remote tables.
- Check supported types when upgrading apache-arrow versions.
- Prefer struct/list/plain types over union and extension types.
When it happens
Trigger: Creating a table or sending schema metadata containing an unsupported Arrow type (e.g. certain union types, dense unions, or exotic extensions) through the JSON serialization path.
Common situations: Using newer or unusual Arrow types from apache-arrow that the binding's serializer predates; storing union/extension columns; passing a type added in a newer apache-arrow version than lancedb supports.
Related errors
- Type's typeId property was not a function or number
- At least one record or a schema needs to be provided
- Expected a Date type to have a `unit` property
- Expected a Decimal Type to have `scale`, `precision`, and…
- Expected a DenseUnion/SparseUnion type to have a `typeIds`…
AI-assisted analysis of lancedb/lancedb@c7b051aff7 (2026-09-08).
Data as JSON: /api/errors/63f4d3b9812326d3.
Report an issue: GitHub.
Appendix: source
Thrown at nodejs/lancedb/arrow.ts:1357
}
case Type.Duration: {
const duration = dataType as Duration;
return { type: `duration:${duration.unit}` };
}
case Type.FixedSizeBinary: {
const byteWidth = (dataType as FixedSizeBinary).byteWidth;
return { type: `fixed_size_binary:${byteWidth}` };
}
case Type.Dictionary: {
const dict = dataType as Dictionary;
const indexType = dataTypeToJson(dict.indices);
const valueType = dataTypeToJson(dict.valueType);
return {
type: `dict:${valueType.type}:${indexType.type}:false`,
};
}
}
throw new Error("Unsupported data type");
}
function fieldToJson(field: Field): JsonField {
return {
name: field.name,
type: dataTypeToJson(field.type),
nullable: field.nullable,
metadata: field.metadata,
};
}
function alignTableToSchema(
table: ArrowTable,
targetSchema: Schema,
): ArrowTable {
const existingColumns = new Map<string, Vector>();
// Map existing columnsView on GitHub (pinned to c7b051aff7)