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

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

TheNeuralBit commented on a change in pull request #1294: ARROW-1693: [JS] Fix 
reading C++ dictionary-encoded vectors
URL: https://github.com/apache/arrow/pull/1294#discussion_r150558328
 
 

 ##########
 File path: js/src/vector/arrow.ts
 ##########
 @@ -0,0 +1,245 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+import * as Schema_ from '../format/Schema_generated';
+import * as Message_ from '../format/Message_generated';
+import Field = Schema_.org.apache.arrow.flatbuf.Field;
+import FieldNode = Message_.org.apache.arrow.flatbuf.FieldNode;
+
+import { Vector } from './vector';
+import { Utf8Vector as Utf8VectorBase } from './utf8';
+import { StructVector as StructVectorBase } from './struct';
+import { DictionaryVector as DictionaryVectorBase } from './dictionary';
+import {
+    ListVector as ListVectorBase,
+    BinaryVector as BinaryVectorBase,
+    FixedSizeListVector as FixedSizeListVectorBase
+} from './list';
+
+import {
+    BoolVector as BoolVectorBase,
+    Int8Vector as Int8VectorBase,
+    Int16Vector as Int16VectorBase,
+    Int32Vector as Int32VectorBase,
+    Int64Vector as Int64VectorBase,
+    Uint8Vector as Uint8VectorBase,
+    Uint16Vector as Uint16VectorBase,
+    Uint32Vector as Uint32VectorBase,
+    Uint64Vector as Uint64VectorBase,
+    Float16Vector as Float16VectorBase,
+    Float32Vector as Float32VectorBase,
+    Float64Vector as Float64VectorBase,
+    Date32Vector as Date32VectorBase,
+    Date64Vector as Date64VectorBase,
+    Time32Vector as Time32VectorBase,
+    Time64Vector as Time64VectorBase,
+    DecimalVector as DecimalVectorBase,
+    TimestampVector as TimestampVectorBase,
+} from './numeric';
+
+import { nullableMixin, fieldMixin } from './traits';
+
+function MixinArrowTraits<T extends Vector<any>, TArgv>(
+    Base: new (argv: TArgv) => T,
+    Field: new (argv: TArgv & { field: Field, fieldNode: FieldNode }) => T,
+    Nullable: new (argv: TArgv & { validity: Uint8Array }) => T,
+    NullableField: new (argv: TArgv & { validity: Uint8Array, field: Field, 
fieldNode: FieldNode }) => T,
+) {
 
 Review comment:
   Why move the calls to `nullableMixin` and `fieldMixin` from here and out to 
each individual call? Are there some subtle differences in some vectors that 
I'm missing?

----------------------------------------------------------------
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:
us...@infra.apache.org


> [JS] Error reading dictionary-encoded integration test files
> ------------------------------------------------------------
>
>                 Key: ARROW-1693
>                 URL: https://issues.apache.org/jira/browse/ARROW-1693
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: JavaScript
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>              Labels: pull-request-available
>             Fix For: 0.8.0
>
>         Attachments: dictionary-cpp.arrow, dictionary-java.arrow, 
> dictionary.json
>
>
> The JS implementation crashes when reading the dictionary test case from the 
> integration tests.
> To replicate, first generate the test files with java and cpp impls:
> {code}
> $ cd ${ARROW_HOME}/integration/
> $ python -c 'from integration_test import generate_dictionary_case; 
> generate_dictionary_case().write("dictionary.json")'
> $ ../cpp/debug/debug/json-integration-test --integration 
> --json=dictionary.json --arrow=dictionary-cpp.arrow --mode=JSON_TO_ARROW
> $ java -cp 
> ../java/tools/target/arrow-tools-0.8.0-SNAPSHOT-jar-with-dependencies.jar 
> org.apache.arrow.tools.Integration -c JSON_TO_ARROW -a dictionary-java.arrow 
> -j dictionary.json
> {code}
> Attempt to read the files with the JS impl:
> {code}
> $ cd ${ARROW_HOME}/js/
> $ ./bin/arrow2csv.js -s dict1_0 -f ../integration/dictionary-{java,cpp}.arrow
> {code}
> Both files result in an error for me on 
> [a8f51858|https://github.com/apache/arrow/commit/a8f518588fda471b2e3cc8e0f0064e7c4bb99899]:
> {{TypeError: Cannot read property 'buffer' of undefined}}



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

Reply via email to