You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Dominik Moritz (Jira)" <ji...@apache.org> on 2022/01/16 22:34:00 UTC
[jira] [Commented] (ARROW-12863) [JS] Field nullable value is overwritten
[ https://issues.apache.org/jira/browse/ARROW-12863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17476891#comment-17476891 ]
Dominik Moritz commented on ARROW-12863:
----------------------------------------
Seems to work fine in master now
{code:js}
const table = Arrow.makeTable({
a: Float32Array.from({ length: 10 }, () => Math.random()),
c: new Arrow.vectorFromArray([1, 2, 3, null])
});
console.log(table.schema.fields[0].nullable);
console.log(table.schema.fields[1].nullable);
{code}
prints `false, true` as expected.
> [JS] Field nullable value is overwritten
> ----------------------------------------
>
> Key: ARROW-12863
> URL: https://issues.apache.org/jira/browse/ARROW-12863
> Project: Apache Arrow
> Issue Type: Bug
> Components: JavaScript
> Affects Versions: 4.0.0
> Reporter: Nick Rabinowitz
> Priority: Minor
>
> I cannot find a way to manually create a table with non-nullable fields in JS. When I create the fields and pass them in via {{Table.new}} the value of {{nullable}} is overwritten.
> Example:
> {code:javascript}
> const type = new Utf8();
> const field = new Field('test', type, false);
> const column = Column.new(field, []);
> console.log(column.nullable); // false
> const table = Table.new(column);
> console.log(table.schema.fields[0].nullable); // true
> {code}
> The issue seems to be the hardcoded value here: https://github.com/apache/arrow/blob/master/js/src/util/args.ts#L184
--
This message was sent by Atlassian Jira
(v8.20.1#820001)