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

  1. Remove or convert the unsupported column to a supported type (e.g. store as struct, list, or encoded string).
  2. Upgrade nodejs lancedb to the latest version, which supports more Arrow types.
  3. Inspect the exact offending type with console.log(field.type) and map it manually.
  4. 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

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


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 columns

View on GitHub (pinned to c7b051aff7)