[ 
https://issues.apache.org/jira/browse/ARROW-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16234387#comment-16234387
 ] 

ASF GitHub Bot commented on ARROW-1652:
---------------------------------------

trxcllnt commented on a change in pull request #1273: ARROW-1652: [JS] 
housekeeping, vector cleanup
URL: https://github.com/apache/arrow/pull/1273#discussion_r148320507
 
 

 ##########
 File path: js/src/reader/arrow.ts
 ##########
 @@ -47,22 +48,27 @@ export function* readBuffers(...bytes: Array<Uint8Array | 
Buffer | string>) {
     const dictionaries: Dictionaries = {};
     const byteBuffers = bytes.map(toByteBuffer);
     for (let { schema, batch } of readRecords(...byteBuffers)) {
-        let vectors: Vector<any>[] = [];
+        let vectors: Column<any>[] = [];
         let state = { nodeIndex: 0, bufferIndex: 0 };
-        let index = -1, fieldsLength = schema.fieldsLength();
+        let fieldsLength = schema.fieldsLength();
+        let index = -1, field: Field, vector: Vector<any>;
         if (batch.id) {
             // A dictionary batch only contain a single vector. Traverse each
             // field and its children until we find one that uses this 
dictionary
             while (++index < fieldsLength) {
-                let vector = readDictionary(schema.fields(index), batch, 
state, dictionaries);
-                if (vector) {
-                    dictionaries[batch.id] = dictionaries[batch.id] && 
dictionaries[batch.id].concat(vector) || vector;
-                    break;
+                if (field = schema.fields(index)!) {
 
 Review comment:
   Yeah. The bang notation forces the type checker to drop nulls, but at 
runtime it can still be null

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [JS] Separate Vector into BatchVector and CompositeVector
> ---------------------------------------------------------
>
>                 Key: ARROW-1652
>                 URL: https://issues.apache.org/jira/browse/ARROW-1652
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: JavaScript
>            Reporter: Brian Hulette
>            Assignee: Paul Taylor
>            Priority: Major
>              Labels: Performance, pull-request-available
>
> CompositeVector should have a {{batch(..)}} function that returns a 
> BatchVector



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to