You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "timspro (via GitHub)" <gi...@apache.org> on 2024/09/16 19:39:51 UTC
[I] Can't create table if it contains an array of strings ("Unable to infer Vector type") [arrow]
timspro opened a new issue, #44136:
URL: https://github.com/apache/arrow/issues/44136
### Describe the bug, including details regarding any error messages, version, and platform.
When using `tableFromArrays()`, I'm seeing the error "Unable to infer Vector type from input values, explicit type declaration expected." for the following code:
```
const data = {
word: [["a"], ["b"]],
}
const table = tableFromArrays(data)
```
For some reason, `tableFromArrays()` infers the type of each string as a dictionary. Then it compares the IDs of the two dictionaries which are not the same: https://github.com/apache/arrow/blob/main/js/src/visitor/typecomparator.ts#L199.
A more complex example that also produces the error:
```
const data = {
customers: [{names: ["joe"]}, {names: ["bob"]}],
}
const table = tableFromArrays(data)
```
I would prefer not having the type inferred at all and instead explicitly passing a schema or field type as an argument, but I can't seem to find any documentation on how to do that.
### Component(s)
JavaScript
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [JavaScript] Can't create table if it contains an array of strings ("Unable to infer Vector type") [arrow]
Posted by "timspro (via GitHub)" <gi...@apache.org>.
timspro commented on issue #44136:
URL: https://github.com/apache/arrow/issues/44136#issuecomment-2459561114
I did ultimately figure out a workaround for this:
https://github.com/kylebarron/parquet-wasm/issues/606.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [JavaScript] Can't create table if it contains an array of strings ("Unable to infer Vector type") [arrow]
Posted by "chrsan (via GitHub)" <gi...@apache.org>.
chrsan commented on issue #44136:
URL: https://github.com/apache/arrow/issues/44136#issuecomment-2459145056
I just stumbled upon this. I can't really wrap my head around why the `id` is included when using the `is` operator since a new `id` is generated in the `Dictionary` constructor of one isn't explicitly specified.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org