fdb opened a new issue, #41099:
URL: https://github.com/apache/arrow/issues/41099
### Describe the bug, including details regarding any error messages,
version, and platform.
When creating a table using regular JavaScript Array syntax, the resulting
`Vector` gives unexpected results:
```js
import { tableFromArrays } from
'https://cdn.skypack.dev/[email protected]';
const table = tableFromArrays({
a: new Float64Array([100, 200, 300]),
b: [100, 200, 300],
});
console.log('Table rows:', table.numRows);
const vectorA = table.getChild('a');
const vectorB = table.getChild('b');
console.log('Length of "a":', vectorA.length);
console.log('Length of "b":', vectorB.length);
console.log('Element "a" at index 3:', vectorA.get(3));
console.log('Element "b" at index 3:', vectorB.get(3));
console.log('Element "a" at index 100:', vectorA.get(100));
console.log('Element "b" at index 100:', vectorB.get(100));
console.log('Vector "a" internal data length:',
vectorA.data[0].values.length);
console.log('Vector "b" internal data length:',
vectorB.data[0].values.length);
```
The output is:
```
Table rows: 3
Length of "a": 3
Length of "b": 3
Vector "a" at index 3: undefined
Vector "b" at index 3: 0
Vector "a" at index 100: undefined
Vector "b" at index 100: undefined
Vector "a" internal data length: 3
Vector "b" internal data length: 8
```
I would expect "b" to also return `undefined` for elements outside of its
length. Instead it returns zero.
I noticed that the internal length of the `Float64Array` is 8 instead of 3,
I suspect this has something to do with it?
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]