Skip to content

bug(node): Looks like Map fields are not supported on empty LanceDB table creation #2337

Description

@FominArtmind

LanceDB version

0.18.2

What happened?

If to add Map field to the schema like in the code below:

const mapField = new Map_(
      new Field("entries", 
        new Struct<{ key: Utf8; value: Int32 }>([
          new Field("key", new Utf8(), false),
          new Field("value", new Int32(), true)
        ])
      )
    );

    const docsSchema = new Schema([
      new Field("id", new Utf8()),
      new Field("vector", new FixedSizeList<Float32>(1024, new Field("value", new Float32()))),
      new Field("bubble", mapField),
    ]);

    let table = await this._db.createEmptyTable(tableName, docsSchema);

The following runtime error is returned:

TypeError: Cannot read properties of undefined (reading 'children')
    at generateDictionaryMap (...\apache-arrow\schema.js:135:18)
    at generateDictionaryMap (...\apache-arrow\schema.js:136:13)
    at new Schema (...\node_modules\apache-arrow\schema.js:27:28)
    at sanitizeSchema (...\node_modules\@lancedb\lancedb\dist\sanitize.js:380:12)
    at makeArrowTable (...\node_modules\@lancedb\lancedb\dist\arrow.js:293:48)
    at makeEmptyTable (...\node_modules\@lancedb\lancedb\dist\arrow.js:575:12)

Are there known steps to reproduce?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtypescriptTypescript / javascript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions