Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Map type #61

Merged
merged 5 commits into from
Jan 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into kyle/map-type
kylebarron committed Jan 31, 2024
commit 1131edb258c86f5253f19e59360bc95610f61e82
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -174,9 +174,9 @@ Most of the unsupported types should be pretty straightforward to implement; the
- [x] Fixed-size List
- [x] Struct
- [x] Map
- [ ] Dense Union
- [ ] Sparse Union
- [ ] Dictionary-encoded arrays
- [x] Dense Union
- [x] Sparse Union
- [x] Dictionary-encoded arrays

### Extension Types

14 changes: 14 additions & 0 deletions src/field.ts
Original file line number Diff line number Diff line change
@@ -229,6 +229,20 @@ function parseFieldContent({
return new arrow.Field(name, type, flags.nullable, metadata);
}

// Dense union
if (formatString.slice(0, 4) === "+ud:") {
const typeIds = formatString.slice(4).split(",").map(Number);
const type = new arrow.DenseUnion(typeIds, childrenFields);
return new arrow.Field(name, type, flags.nullable, metadata);
}

// Sparse union
if (formatString.slice(0, 4) === "+us:") {
const typeIds = formatString.slice(4).split(",").map(Number);
const type = new arrow.SparseUnion(typeIds, childrenFields);
return new arrow.Field(name, type, flags.nullable, metadata);
}

throw new Error(`Unsupported format: ${formatString}`);
}

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.