{"record":{"id":"63f4d3b9812326d3","repo":"lancedb/lancedb","slug":"unsupported-data-type","errorCode":null,"errorMessage":"Unsupported data type","messagePattern":"Unsupported data type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/lancedb/arrow.ts","lineNumber":1357,"sourceCode":"    }\n    case Type.Duration: {\n      const duration = dataType as Duration;\n      return { type: `duration:${duration.unit}` };\n    }\n    case Type.FixedSizeBinary: {\n      const byteWidth = (dataType as FixedSizeBinary).byteWidth;\n      return { type: `fixed_size_binary:${byteWidth}` };\n    }\n    case Type.Dictionary: {\n      const dict = dataType as Dictionary;\n      const indexType = dataTypeToJson(dict.indices);\n      const valueType = dataTypeToJson(dict.valueType);\n      return {\n        type: `dict:${valueType.type}:${indexType.type}:false`,\n      };\n    }\n  }\n  throw new Error(\"Unsupported data type\");\n}\n\nfunction fieldToJson(field: Field): JsonField {\n  return {\n    name: field.name,\n    type: dataTypeToJson(field.type),\n    nullable: field.nullable,\n    metadata: field.metadata,\n  };\n}\n\nfunction alignTableToSchema(\n  table: ArrowTable,\n  targetSchema: Schema,\n): ArrowTable {\n  const existingColumns = new Map<string, Vector>();\n\n  // Map existing columns","sourceCodeStart":1339,"sourceCodeEnd":1375,"githubUrl":"https://github.com/lancedb/lancedb/blob/c7b051aff7039333a3f61b79217246c27676806a/nodejs/lancedb/arrow.ts#L1339-L1375","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nschema with column of type new Union([...])\n// after\nflatten the union into explicit columns or encode it as a Utf8 JSON string","handlingStrategy":"validation","validationCode":"for (const field of table.schema.fields) {\n  if (field.type instanceof Union) {\n    throw new Error(`unsupported column type for remote: ${field.name} (${field.type})`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await db.tableName('t').add(data);\n} catch (e) {\n  if (e.message === 'Unsupported data type') {\n    // convert the offending column to a supported type\n  }\n}","preventionTips":["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."],"tags":["arrow","serialization","typescript"],"backgroundTag":"unsupported-dtype","analyzedSha":"c7b051aff7039333a3f61b79217246c27676806a","analyzedAt":"2026-09-08T23:42:37.579Z","contentChangedAt":"2026-09-08T23:42:37.579Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}