Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DBA33200D02 for ; Sat, 9 Sep 2017 00:42:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D9EDF160DB7; Fri, 8 Sep 2017 22:42:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8E3D71609EA for ; Sat, 9 Sep 2017 00:42:18 +0200 (CEST) Received: (qmail 53237 invoked by uid 500); 8 Sep 2017 22:42:17 -0000 Mailing-List: contact commits-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@arrow.apache.org Delivered-To: mailing list commits@arrow.apache.org Received: (qmail 53228 invoked by uid 99); 8 Sep 2017 22:42:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2017 22:42:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BB6CCF5715; Fri, 8 Sep 2017 22:42:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wesm@apache.org To: commits@arrow.apache.org Date: Fri, 08 Sep 2017 22:42:16 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/7] arrow git commit: ARROW-1479: [JS] Expand JavaScript implementation archived-at: Fri, 08 Sep 2017 22:42:21 -0000 Repository: arrow Updated Branches: refs/heads/master 8911a3463 -> 9cab3a2f5 http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/__snapshots__/table-tests.ts.snap ---------------------------------------------------------------------- diff --git a/js/test/__snapshots__/table-tests.ts.snap b/js/test/__snapshots__/table-tests.ts.snap new file mode 100644 index 0000000..a7fb9c5 --- /dev/null +++ b/js/test/__snapshots__/table-tests.ts.snap @@ -0,0 +1,1815 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dictionary file Arrow Table creates a Table from Arrow buffers 1`] = `"example-csv"`; + +exports[`dictionary file Arrow Table creates a Table from Arrow buffers 2`] = `"Struct_"`; + +exports[`dictionary file Arrow Table creates a Table from Arrow buffers 3`] = `3`; + +exports[`dictionary file Arrow Table creates a Table from Arrow buffers 4`] = ` +Array [ + "Hermione", + 25, + Float32Array [ + -53.235599517822266, + 40.231998443603516, + ], +] +`; + +exports[`dictionary file Arrow Table creates a Table from Arrow buffers 5`] = ` +Array [ + "Severus", + 30, + Float32Array [ + -62.22999954223633, + 3, + ], +] +`; + +exports[`dictionary file Arrow Table creates a Table from Arrow buffers 6`] = ` +Array [ + "Harry", + 20, + Float32Array [ + 23, + -100.23652648925781, + ], +] +`; + +exports[`dictionary file Arrow Table enumerates Table rows 1`] = ` +Object { + "example-csv": Array [ + "Hermione", + 25, + Float32Array [ + -53.235599517822266, + 40.231998443603516, + ], + ], +} +`; + +exports[`dictionary file Arrow Table enumerates Table rows 2`] = ` +Object { + "example-csv": Array [ + "Severus", + 30, + Float32Array [ + -62.22999954223633, + 3, + ], + ], +} +`; + +exports[`dictionary file Arrow Table enumerates Table rows 3`] = ` +Object { + "example-csv": Array [ + "Harry", + 20, + Float32Array [ + 23, + -100.23652648925781, + ], + ], +} +`; + +exports[`dictionary file Arrow Table enumerates Table rows compact 1`] = ` +Array [ + Array [ + "Hermione", + 25, + Float32Array [ + -53.235599517822266, + 40.231998443603516, + ], + ], +] +`; + +exports[`dictionary file Arrow Table enumerates Table rows compact 2`] = ` +Array [ + Array [ + "Severus", + 30, + Float32Array [ + -62.22999954223633, + 3, + ], + ], +] +`; + +exports[`dictionary file Arrow Table enumerates Table rows compact 3`] = ` +Array [ + Array [ + "Harry", + 20, + Float32Array [ + 23, + -100.23652648925781, + ], + ], +] +`; + +exports[`dictionary file Arrow Table toString() prints a pretty Table 1`] = ` +" example-csv +Hermione,25,-53.235599517822266,40.231998443603516 + Severus,30,-62.22999954223633,3 + Harry,20,23,-100.23652648925781" +`; + +exports[`dictionary file Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`dictionary file Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, example-csv + 0, Hermione,25,-53.235599517822266,40.231998443603516 + 1, Severus,30,-62.22999954223633,3 + 2, Harry,20,23,-100.23652648925781" +`; + +exports[`dictionary stream Arrow Table creates a Table from Arrow buffers 1`] = `"example-csv"`; + +exports[`dictionary stream Arrow Table creates a Table from Arrow buffers 2`] = `"Struct_"`; + +exports[`dictionary stream Arrow Table creates a Table from Arrow buffers 3`] = `3`; + +exports[`dictionary stream Arrow Table creates a Table from Arrow buffers 4`] = ` +Array [ + "Hermione", + 25, + Float32Array [ + -53.235599517822266, + 40.231998443603516, + ], +] +`; + +exports[`dictionary stream Arrow Table creates a Table from Arrow buffers 5`] = ` +Array [ + "Severus", + 30, + Float32Array [ + -62.22999954223633, + 3, + ], +] +`; + +exports[`dictionary stream Arrow Table creates a Table from Arrow buffers 6`] = ` +Array [ + "Harry", + 20, + Float32Array [ + 23, + -100.23652648925781, + ], +] +`; + +exports[`dictionary stream Arrow Table enumerates Table rows 1`] = ` +Object { + "example-csv": Array [ + "Hermione", + 25, + Float32Array [ + -53.235599517822266, + 40.231998443603516, + ], + ], +} +`; + +exports[`dictionary stream Arrow Table enumerates Table rows 2`] = ` +Object { + "example-csv": Array [ + "Severus", + 30, + Float32Array [ + -62.22999954223633, + 3, + ], + ], +} +`; + +exports[`dictionary stream Arrow Table enumerates Table rows 3`] = ` +Object { + "example-csv": Array [ + "Harry", + 20, + Float32Array [ + 23, + -100.23652648925781, + ], + ], +} +`; + +exports[`dictionary stream Arrow Table enumerates Table rows compact 1`] = ` +Array [ + Array [ + "Hermione", + 25, + Float32Array [ + -53.235599517822266, + 40.231998443603516, + ], + ], +] +`; + +exports[`dictionary stream Arrow Table enumerates Table rows compact 2`] = ` +Array [ + Array [ + "Severus", + 30, + Float32Array [ + -62.22999954223633, + 3, + ], + ], +] +`; + +exports[`dictionary stream Arrow Table enumerates Table rows compact 3`] = ` +Array [ + Array [ + "Harry", + 20, + Float32Array [ + 23, + -100.23652648925781, + ], + ], +] +`; + +exports[`dictionary stream Arrow Table toString() prints a pretty Table 1`] = ` +" example-csv +Hermione,25,-53.235599517822266,40.231998443603516 + Severus,30,-62.22999954223633,3 + Harry,20,23,-100.23652648925781" +`; + +exports[`dictionary stream Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`dictionary stream Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, example-csv + 0, Hermione,25,-53.235599517822266,40.231998443603516 + 1, Severus,30,-62.22999954223633,3 + 2, Harry,20,23,-100.23652648925781" +`; + +exports[`dictionary2 file Arrow Table creates a Table from Arrow buffers 1`] = `"struct"`; + +exports[`dictionary2 file Arrow Table creates a Table from Arrow buffers 2`] = `"Struct_"`; + +exports[`dictionary2 file Arrow Table creates a Table from Arrow buffers 3`] = `2`; + +exports[`dictionary2 file Arrow Table creates a Table from Arrow buffers 4`] = ` +Array [ + "a0fb47f9-f8fb-4403-a64a-786d7611f8ef", + "Airbus", + 1502880750, + Float32Array [ + 32.45663833618164, + 1.8712350130081177, + ], +] +`; + +exports[`dictionary2 file Arrow Table creates a Table from Arrow buffers 5`] = ` +Array [ + "50fb46f4-fefa-42c1-919c-0121974cdd00", + "Boeing", + 1502880750, + Float32Array [ + 38.766666412353516, + -4.181231498718262, + ], +] +`; + +exports[`dictionary2 file Arrow Table enumerates Table rows 1`] = ` +Object { + "struct": Array [ + "a0fb47f9-f8fb-4403-a64a-786d7611f8ef", + "Airbus", + 1502880750, + Float32Array [ + 32.45663833618164, + 1.8712350130081177, + ], + ], +} +`; + +exports[`dictionary2 file Arrow Table enumerates Table rows 2`] = ` +Object { + "struct": Array [ + "50fb46f4-fefa-42c1-919c-0121974cdd00", + "Boeing", + 1502880750, + Float32Array [ + 38.766666412353516, + -4.181231498718262, + ], + ], +} +`; + +exports[`dictionary2 file Arrow Table enumerates Table rows compact 1`] = ` +Array [ + Array [ + "a0fb47f9-f8fb-4403-a64a-786d7611f8ef", + "Airbus", + 1502880750, + Float32Array [ + 32.45663833618164, + 1.8712350130081177, + ], + ], +] +`; + +exports[`dictionary2 file Arrow Table enumerates Table rows compact 2`] = ` +Array [ + Array [ + "50fb46f4-fefa-42c1-919c-0121974cdd00", + "Boeing", + 1502880750, + Float32Array [ + 38.766666412353516, + -4.181231498718262, + ], + ], +] +`; + +exports[`dictionary2 file Arrow Table toString() prints a pretty Table 1`] = ` +" struct + a0fb47f9-f8fb-4403-a64a-786d7611f8ef,Airbus,1502880750,32.45663833618164,1.8712350130081177 +50fb46f4-fefa-42c1-919c-0121974cdd00,Boeing,1502880750,38.766666412353516,-4.181231498718262" +`; + +exports[`dictionary2 file Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`dictionary2 file Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, struct + 0, a0fb47f9-f8fb-4403-a64a-786d7611f8ef,Airbus,1502880750,32.45663833618164,1.8712350130081177 + 1, 50fb46f4-fefa-42c1-919c-0121974cdd00,Boeing,1502880750,38.766666412353516,-4.181231498718262" +`; + +exports[`multi_dictionary file Arrow Table creates a Table from Arrow buffers 1`] = `"struct"`; + +exports[`multi_dictionary file Arrow Table creates a Table from Arrow buffers 2`] = `"Struct_"`; + +exports[`multi_dictionary file Arrow Table creates a Table from Arrow buffers 3`] = `2`; + +exports[`multi_dictionary file Arrow Table creates a Table from Arrow buffers 4`] = ` +Array [ + "a0fb47f9-f8fb-4403-a64a-786d7611f8ef", + "12345", + "Airbus", + 1502880750, + Float32Array [ + 32.45663833618164, + 1.8712350130081177, + ], +] +`; + +exports[`multi_dictionary file Arrow Table creates a Table from Arrow buffers 5`] = ` +Array [ + "50fb46f4-fefa-42c1-919c-0121974cdd00", + "67890", + "Boeing", + 1502880750, + Float32Array [ + 38.766666412353516, + -4.181231498718262, + ], +] +`; + +exports[`multi_dictionary file Arrow Table enumerates Table rows 1`] = ` +Object { + "struct": Array [ + "a0fb47f9-f8fb-4403-a64a-786d7611f8ef", + "12345", + "Airbus", + 1502880750, + Float32Array [ + 32.45663833618164, + 1.8712350130081177, + ], + ], +} +`; + +exports[`multi_dictionary file Arrow Table enumerates Table rows 2`] = ` +Object { + "struct": Array [ + "50fb46f4-fefa-42c1-919c-0121974cdd00", + "67890", + "Boeing", + 1502880750, + Float32Array [ + 38.766666412353516, + -4.181231498718262, + ], + ], +} +`; + +exports[`multi_dictionary file Arrow Table enumerates Table rows compact 1`] = ` +Array [ + Array [ + "a0fb47f9-f8fb-4403-a64a-786d7611f8ef", + "12345", + "Airbus", + 1502880750, + Float32Array [ + 32.45663833618164, + 1.8712350130081177, + ], + ], +] +`; + +exports[`multi_dictionary file Arrow Table enumerates Table rows compact 2`] = ` +Array [ + Array [ + "50fb46f4-fefa-42c1-919c-0121974cdd00", + "67890", + "Boeing", + 1502880750, + Float32Array [ + 38.766666412353516, + -4.181231498718262, + ], + ], +] +`; + +exports[`multi_dictionary file Arrow Table toString() prints a pretty Table 1`] = ` +" struct + a0fb47f9-f8fb-4403-a64a-786d7611f8ef,12345,Airbus,1502880750,32.45663833618164,1.8712350130081177 +50fb46f4-fefa-42c1-919c-0121974cdd00,67890,Boeing,1502880750,38.766666412353516,-4.181231498718262" +`; + +exports[`multi_dictionary file Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`multi_dictionary file Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, struct + 0, a0fb47f9-f8fb-4403-a64a-786d7611f8ef,12345,Airbus,1502880750,32.45663833618164,1.8712350130081177 + 1, 50fb46f4-fefa-42c1-919c-0121974cdd00,67890,Boeing,1502880750,38.766666412353516,-4.181231498718262" +`; + +exports[`multipart count Arrow Table creates a Table from Arrow buffers 1`] = `"row_count"`; + +exports[`multipart count Arrow Table creates a Table from Arrow buffers 2`] = `"Int"`; + +exports[`multipart count Arrow Table creates a Table from Arrow buffers 3`] = `1`; + +exports[`multipart count Arrow Table creates a Table from Arrow buffers 4`] = `10000`; + +exports[`multipart count Arrow Table enumerates Table rows 1`] = ` +Object { + "row_count": 10000, +} +`; + +exports[`multipart count Arrow Table enumerates Table rows compact 1`] = ` +Array [ + 10000, +] +`; + +exports[`multipart count Arrow Table toString() prints a pretty Table 1`] = ` +"row_count + 10000" +`; + +exports[`multipart count Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`multipart count Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, row_count + 0, 10000" +`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 1`] = `"origin_lat"`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 2`] = `"FloatingPoint"`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 3`] = `5`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 4`] = `35.393089294433594`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 5`] = `35.393089294433594`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 6`] = `35.393089294433594`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 7`] = `29.533695220947266`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 8`] = `29.533695220947266`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 9`] = `"origin_lon"`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 10`] = `"FloatingPoint"`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 11`] = `5`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 12`] = `-97.6007308959961`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 13`] = `-97.6007308959961`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 14`] = `-97.6007308959961`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 15`] = `-98.46977996826172`; + +exports[`multipart latlong Arrow Table creates a Table from Arrow buffers 16`] = `-98.46977996826172`; + +exports[`multipart latlong Arrow Table enumerates Table rows 1`] = ` +Object { + "origin_lat": 35.393089294433594, + "origin_lon": -97.6007308959961, +} +`; + +exports[`multipart latlong Arrow Table enumerates Table rows 2`] = ` +Object { + "origin_lat": 35.393089294433594, + "origin_lon": -97.6007308959961, +} +`; + +exports[`multipart latlong Arrow Table enumerates Table rows 3`] = ` +Object { + "origin_lat": 35.393089294433594, + "origin_lon": -97.6007308959961, +} +`; + +exports[`multipart latlong Arrow Table enumerates Table rows 4`] = ` +Object { + "origin_lat": 29.533695220947266, + "origin_lon": -98.46977996826172, +} +`; + +exports[`multipart latlong Arrow Table enumerates Table rows 5`] = ` +Object { + "origin_lat": 29.533695220947266, + "origin_lon": -98.46977996826172, +} +`; + +exports[`multipart latlong Arrow Table enumerates Table rows compact 1`] = ` +Array [ + 35.393089294433594, + -97.6007308959961, +] +`; + +exports[`multipart latlong Arrow Table enumerates Table rows compact 2`] = ` +Array [ + 35.393089294433594, + -97.6007308959961, +] +`; + +exports[`multipart latlong Arrow Table enumerates Table rows compact 3`] = ` +Array [ + 35.393089294433594, + -97.6007308959961, +] +`; + +exports[`multipart latlong Arrow Table enumerates Table rows compact 4`] = ` +Array [ + 29.533695220947266, + -98.46977996826172, +] +`; + +exports[`multipart latlong Arrow Table enumerates Table rows compact 5`] = ` +Array [ + 29.533695220947266, + -98.46977996826172, +] +`; + +exports[`multipart latlong Arrow Table toString() prints a pretty Table 1`] = ` +" origin_lat, origin_lon +35.393089294433594, -97.6007308959961 +35.393089294433594, -97.6007308959961 +35.393089294433594, -97.6007308959961 +29.533695220947266, -98.46977996826172 +29.533695220947266, -98.46977996826172" +`; + +exports[`multipart latlong Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`multipart latlong Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, origin_lat, origin_lon + 0, 35.393089294433594, -97.6007308959961 + 1, 35.393089294433594, -97.6007308959961 + 2, 35.393089294433594, -97.6007308959961 + 3, 29.533695220947266, -98.46977996826172 + 4, 29.533695220947266, -98.46977996826172" +`; + +exports[`multipart origins Arrow Table creates a Table from Arrow buffers 1`] = `"origin_city"`; + +exports[`multipart origins Arrow Table creates a Table from Arrow buffers 2`] = `"Utf8"`; + +exports[`multipart origins Arrow Table creates a Table from Arrow buffers 3`] = `5`; + +exports[`multipart origins Arrow Table creates a Table from Arrow buffers 4`] = `"Oklahoma City"`; + +exports[`multipart origins Arrow Table creates a Table from Arrow buffers 5`] = `"Oklahoma City"`; + +exports[`multipart origins Arrow Table creates a Table from Arrow buffers 6`] = `"Oklahoma City"`; + +exports[`multipart origins Arrow Table creates a Table from Arrow buffers 7`] = `"San Antonio"`; + +exports[`multipart origins Arrow Table creates a Table from Arrow buffers 8`] = `"San Antonio"`; + +exports[`multipart origins Arrow Table enumerates Table rows 1`] = ` +Object { + "origin_city": "Oklahoma City", +} +`; + +exports[`multipart origins Arrow Table enumerates Table rows 2`] = ` +Object { + "origin_city": "Oklahoma City", +} +`; + +exports[`multipart origins Arrow Table enumerates Table rows 3`] = ` +Object { + "origin_city": "Oklahoma City", +} +`; + +exports[`multipart origins Arrow Table enumerates Table rows 4`] = ` +Object { + "origin_city": "San Antonio", +} +`; + +exports[`multipart origins Arrow Table enumerates Table rows 5`] = ` +Object { + "origin_city": "San Antonio", +} +`; + +exports[`multipart origins Arrow Table enumerates Table rows compact 1`] = ` +Array [ + "Oklahoma City", +] +`; + +exports[`multipart origins Arrow Table enumerates Table rows compact 2`] = ` +Array [ + "Oklahoma City", +] +`; + +exports[`multipart origins Arrow Table enumerates Table rows compact 3`] = ` +Array [ + "Oklahoma City", +] +`; + +exports[`multipart origins Arrow Table enumerates Table rows compact 4`] = ` +Array [ + "San Antonio", +] +`; + +exports[`multipart origins Arrow Table enumerates Table rows compact 5`] = ` +Array [ + "San Antonio", +] +`; + +exports[`multipart origins Arrow Table toString() prints a pretty Table 1`] = ` +" origin_city +Oklahoma City +Oklahoma City +Oklahoma City + San Antonio + San Antonio" +`; + +exports[`multipart origins Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`multipart origins Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, origin_city + 0, Oklahoma City + 1, Oklahoma City + 2, Oklahoma City + 3, San Antonio + 4, San Antonio" +`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 1`] = `"foo"`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 2`] = `"Int"`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 3`] = `5`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 4`] = `1`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 5`] = `null`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 6`] = `3`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 7`] = `4`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 8`] = `5`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 9`] = `"bar"`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 10`] = `"FloatingPoint"`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 11`] = `5`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 12`] = `1`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 13`] = `null`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 14`] = `null`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 15`] = `4`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 16`] = `5`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 17`] = `"baz"`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 18`] = `"Utf8"`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 19`] = `5`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 20`] = `"aa"`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 21`] = `null`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 22`] = `null`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 23`] = `"bbb"`; + +exports[`simple file Arrow Table creates a Table from Arrow buffers 24`] = `"cccc"`; + +exports[`simple file Arrow Table enumerates Table rows 1`] = ` +Object { + "bar": 1, + "baz": "aa", + "foo": 1, +} +`; + +exports[`simple file Arrow Table enumerates Table rows 2`] = ` +Object { + "bar": null, + "baz": null, + "foo": null, +} +`; + +exports[`simple file Arrow Table enumerates Table rows 3`] = ` +Object { + "bar": null, + "baz": null, + "foo": 3, +} +`; + +exports[`simple file Arrow Table enumerates Table rows 4`] = ` +Object { + "bar": 4, + "baz": "bbb", + "foo": 4, +} +`; + +exports[`simple file Arrow Table enumerates Table rows 5`] = ` +Object { + "bar": 5, + "baz": "cccc", + "foo": 5, +} +`; + +exports[`simple file Arrow Table enumerates Table rows compact 1`] = ` +Array [ + 1, + 1, + "aa", +] +`; + +exports[`simple file Arrow Table enumerates Table rows compact 2`] = ` +Array [ + null, + null, + null, +] +`; + +exports[`simple file Arrow Table enumerates Table rows compact 3`] = ` +Array [ + 3, + null, + null, +] +`; + +exports[`simple file Arrow Table enumerates Table rows compact 4`] = ` +Array [ + 4, + 4, + "bbb", +] +`; + +exports[`simple file Arrow Table enumerates Table rows compact 5`] = ` +Array [ + 5, + 5, + "cccc", +] +`; + +exports[`simple file Arrow Table toString() prints a pretty Table 1`] = ` +" foo, bar, baz + 1, 1, aa +null, null, null + 3, null, null + 4, 4, bbb + 5, 5, cccc" +`; + +exports[`simple file Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`simple file Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, foo, bar, baz + 0, 1, 1, aa + 1, null, null, null + 2, 3, null, null + 3, 4, 4, bbb + 4, 5, 5, cccc" +`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 1`] = `"foo"`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 2`] = `"Int"`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 3`] = `5`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 4`] = `1`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 5`] = `null`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 6`] = `3`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 7`] = `4`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 8`] = `5`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 9`] = `"bar"`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 10`] = `"FloatingPoint"`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 11`] = `5`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 12`] = `1`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 13`] = `null`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 14`] = `null`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 15`] = `4`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 16`] = `5`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 17`] = `"baz"`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 18`] = `"Utf8"`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 19`] = `5`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 20`] = `"aa"`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 21`] = `null`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 22`] = `null`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 23`] = `"bbb"`; + +exports[`simple stream Arrow Table creates a Table from Arrow buffers 24`] = `"cccc"`; + +exports[`simple stream Arrow Table enumerates Table rows 1`] = ` +Object { + "bar": 1, + "baz": "aa", + "foo": 1, +} +`; + +exports[`simple stream Arrow Table enumerates Table rows 2`] = ` +Object { + "bar": null, + "baz": null, + "foo": null, +} +`; + +exports[`simple stream Arrow Table enumerates Table rows 3`] = ` +Object { + "bar": null, + "baz": null, + "foo": 3, +} +`; + +exports[`simple stream Arrow Table enumerates Table rows 4`] = ` +Object { + "bar": 4, + "baz": "bbb", + "foo": 4, +} +`; + +exports[`simple stream Arrow Table enumerates Table rows 5`] = ` +Object { + "bar": 5, + "baz": "cccc", + "foo": 5, +} +`; + +exports[`simple stream Arrow Table enumerates Table rows compact 1`] = ` +Array [ + 1, + 1, + "aa", +] +`; + +exports[`simple stream Arrow Table enumerates Table rows compact 2`] = ` +Array [ + null, + null, + null, +] +`; + +exports[`simple stream Arrow Table enumerates Table rows compact 3`] = ` +Array [ + 3, + null, + null, +] +`; + +exports[`simple stream Arrow Table enumerates Table rows compact 4`] = ` +Array [ + 4, + 4, + "bbb", +] +`; + +exports[`simple stream Arrow Table enumerates Table rows compact 5`] = ` +Array [ + 5, + 5, + "cccc", +] +`; + +exports[`simple stream Arrow Table toString() prints a pretty Table 1`] = ` +" foo, bar, baz + 1, 1, aa +null, null, null + 3, null, null + 4, 4, bbb + 5, 5, cccc" +`; + +exports[`simple stream Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`simple stream Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, foo, bar, baz + 0, 1, 1, aa + 1, null, null, null + 2, 3, null, null + 3, 4, 4, bbb + 4, 5, 5, cccc" +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 1`] = `"struct_nullable"`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 2`] = `"Struct_"`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 3`] = `17`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 4`] = `null`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 5`] = ` +Array [ + null, + "MhRNxD4", +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 6`] = ` +Array [ + 137773603, + "3F9HBxK", +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 7`] = ` +Array [ + 410361374, + "aVd88fp", +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 8`] = `null`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 9`] = ` +Array [ + null, + "3loZrRf", +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 10`] = `null`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 11`] = `null`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 12`] = ` +Array [ + null, + null, +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 13`] = ` +Array [ + null, + null, +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 14`] = `null`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 15`] = ` +Array [ + null, + "78SLiRw", +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 16`] = `null`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 17`] = `null`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 18`] = ` +Array [ + null, + "0ilsf82", +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 19`] = ` +Array [ + null, + "LjS9MbU", +] +`; + +exports[`struct file Arrow Table creates a Table from Arrow buffers 20`] = ` +Array [ + null, + null, +] +`; + +exports[`struct file Arrow Table enumerates Table rows 1`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct file Arrow Table enumerates Table rows 2`] = ` +Object { + "struct_nullable": Array [ + null, + "MhRNxD4", + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 3`] = ` +Object { + "struct_nullable": Array [ + 137773603, + "3F9HBxK", + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 4`] = ` +Object { + "struct_nullable": Array [ + 410361374, + "aVd88fp", + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 5`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct file Arrow Table enumerates Table rows 6`] = ` +Object { + "struct_nullable": Array [ + null, + "3loZrRf", + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 7`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct file Arrow Table enumerates Table rows 8`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct file Arrow Table enumerates Table rows 9`] = ` +Object { + "struct_nullable": Array [ + null, + null, + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 10`] = ` +Object { + "struct_nullable": Array [ + null, + null, + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 11`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct file Arrow Table enumerates Table rows 12`] = ` +Object { + "struct_nullable": Array [ + null, + "78SLiRw", + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 13`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct file Arrow Table enumerates Table rows 14`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct file Arrow Table enumerates Table rows 15`] = ` +Object { + "struct_nullable": Array [ + null, + "0ilsf82", + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 16`] = ` +Object { + "struct_nullable": Array [ + null, + "LjS9MbU", + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows 17`] = ` +Object { + "struct_nullable": Array [ + null, + null, + ], +} +`; + +exports[`struct file Arrow Table enumerates Table rows compact 1`] = ` +Array [ + null, +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 2`] = ` +Array [ + Array [ + null, + "MhRNxD4", + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 3`] = ` +Array [ + Array [ + 137773603, + "3F9HBxK", + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 4`] = ` +Array [ + Array [ + 410361374, + "aVd88fp", + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 5`] = ` +Array [ + null, +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 6`] = ` +Array [ + Array [ + null, + "3loZrRf", + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 7`] = ` +Array [ + null, +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 8`] = ` +Array [ + null, +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 9`] = ` +Array [ + Array [ + null, + null, + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 10`] = ` +Array [ + Array [ + null, + null, + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 11`] = ` +Array [ + null, +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 12`] = ` +Array [ + Array [ + null, + "78SLiRw", + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 13`] = ` +Array [ + null, +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 14`] = ` +Array [ + null, +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 15`] = ` +Array [ + Array [ + null, + "0ilsf82", + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 16`] = ` +Array [ + Array [ + null, + "LjS9MbU", + ], +] +`; + +exports[`struct file Arrow Table enumerates Table rows compact 17`] = ` +Array [ + Array [ + null, + null, + ], +] +`; + +exports[`struct file Arrow Table toString() prints a pretty Table 1`] = ` +" struct_nullable + null + ,MhRNxD4 +137773603,3F9HBxK +410361374,aVd88fp + null + ,3loZrRf + null + null + , + , + null + ,78SLiRw + null + null + ,0ilsf82 + ,LjS9MbU + ," +`; + +exports[`struct file Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`struct file Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, struct_nullable + 0, null + 1, ,MhRNxD4 + 2, 137773603,3F9HBxK + 3, 410361374,aVd88fp + 4, null + 5, ,3loZrRf + 6, null + 7, null + 8, , + 9, , + 10, null + 11, ,78SLiRw + 12, null + 13, null + 14, ,0ilsf82 + 15, ,LjS9MbU + 16, ," +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 1`] = `"struct_nullable"`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 2`] = `"Struct_"`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 3`] = `17`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 4`] = `null`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 5`] = ` +Array [ + null, + "MhRNxD4", +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 6`] = ` +Array [ + 137773603, + "3F9HBxK", +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 7`] = ` +Array [ + 410361374, + "aVd88fp", +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 8`] = `null`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 9`] = ` +Array [ + null, + "3loZrRf", +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 10`] = `null`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 11`] = `null`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 12`] = ` +Array [ + null, + null, +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 13`] = ` +Array [ + null, + null, +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 14`] = `null`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 15`] = ` +Array [ + null, + "78SLiRw", +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 16`] = `null`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 17`] = `null`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 18`] = ` +Array [ + null, + "0ilsf82", +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 19`] = ` +Array [ + null, + "LjS9MbU", +] +`; + +exports[`struct stream Arrow Table creates a Table from Arrow buffers 20`] = ` +Array [ + null, + null, +] +`; + +exports[`struct stream Arrow Table enumerates Table rows 1`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 2`] = ` +Object { + "struct_nullable": Array [ + null, + "MhRNxD4", + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 3`] = ` +Object { + "struct_nullable": Array [ + 137773603, + "3F9HBxK", + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 4`] = ` +Object { + "struct_nullable": Array [ + 410361374, + "aVd88fp", + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 5`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 6`] = ` +Object { + "struct_nullable": Array [ + null, + "3loZrRf", + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 7`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 8`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 9`] = ` +Object { + "struct_nullable": Array [ + null, + null, + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 10`] = ` +Object { + "struct_nullable": Array [ + null, + null, + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 11`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 12`] = ` +Object { + "struct_nullable": Array [ + null, + "78SLiRw", + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 13`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 14`] = ` +Object { + "struct_nullable": null, +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 15`] = ` +Object { + "struct_nullable": Array [ + null, + "0ilsf82", + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 16`] = ` +Object { + "struct_nullable": Array [ + null, + "LjS9MbU", + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows 17`] = ` +Object { + "struct_nullable": Array [ + null, + null, + ], +} +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 1`] = ` +Array [ + null, +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 2`] = ` +Array [ + Array [ + null, + "MhRNxD4", + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 3`] = ` +Array [ + Array [ + 137773603, + "3F9HBxK", + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 4`] = ` +Array [ + Array [ + 410361374, + "aVd88fp", + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 5`] = ` +Array [ + null, +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 6`] = ` +Array [ + Array [ + null, + "3loZrRf", + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 7`] = ` +Array [ + null, +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 8`] = ` +Array [ + null, +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 9`] = ` +Array [ + Array [ + null, + null, + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 10`] = ` +Array [ + Array [ + null, + null, + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 11`] = ` +Array [ + null, +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 12`] = ` +Array [ + Array [ + null, + "78SLiRw", + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 13`] = ` +Array [ + null, +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 14`] = ` +Array [ + null, +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 15`] = ` +Array [ + Array [ + null, + "0ilsf82", + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 16`] = ` +Array [ + Array [ + null, + "LjS9MbU", + ], +] +`; + +exports[`struct stream Arrow Table enumerates Table rows compact 17`] = ` +Array [ + Array [ + null, + null, + ], +] +`; + +exports[`struct stream Arrow Table toString() prints a pretty Table 1`] = ` +" struct_nullable + null + ,MhRNxD4 +137773603,3F9HBxK +410361374,aVd88fp + null + ,3loZrRf + null + null + , + , + null + ,78SLiRw + null + null + ,0ilsf82 + ,LjS9MbU + ," +`; + +exports[`struct stream Arrow Table toString() prints an empty Table 1`] = `""`; + +exports[`struct stream Arrow Table toString({ index: true }) prints a pretty Table with an Index column 1`] = ` +"Index, struct_nullable + 0, null + 1, ,MhRNxD4 + 2, 137773603,3F9HBxK + 3, 410361374,aVd88fp + 4, null + 5, ,3loZrRf + 6, null + 7, null + 8, , + 9, , + 10, null + 11, ,78SLiRw + 12, null + 13, null + 14, ,0ilsf82 + 15, ,LjS9MbU + 16, ," +`; http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/file/dictionary.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/file/dictionary.arrow b/js/test/arrows/file/dictionary.arrow new file mode 100644 index 0000000..34d41db Binary files /dev/null and b/js/test/arrows/file/dictionary.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/file/dictionary2.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/file/dictionary2.arrow b/js/test/arrows/file/dictionary2.arrow new file mode 100644 index 0000000..1537f54 Binary files /dev/null and b/js/test/arrows/file/dictionary2.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/file/multi_dictionary.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/file/multi_dictionary.arrow b/js/test/arrows/file/multi_dictionary.arrow new file mode 100644 index 0000000..113d30d Binary files /dev/null and b/js/test/arrows/file/multi_dictionary.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/file/simple.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/file/simple.arrow b/js/test/arrows/file/simple.arrow new file mode 100644 index 0000000..838db6d Binary files /dev/null and b/js/test/arrows/file/simple.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/file/struct.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/file/struct.arrow b/js/test/arrows/file/struct.arrow new file mode 100644 index 0000000..3d2c018 Binary files /dev/null and b/js/test/arrows/file/struct.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/multi/count/records.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/multi/count/records.arrow b/js/test/arrows/multi/count/records.arrow new file mode 100644 index 0000000..00d8837 Binary files /dev/null and b/js/test/arrows/multi/count/records.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/multi/count/schema.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/multi/count/schema.arrow b/js/test/arrows/multi/count/schema.arrow new file mode 100644 index 0000000..dfd24e9 Binary files /dev/null and b/js/test/arrows/multi/count/schema.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/multi/latlong/records.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/multi/latlong/records.arrow b/js/test/arrows/multi/latlong/records.arrow new file mode 100644 index 0000000..563d12d Binary files /dev/null and b/js/test/arrows/multi/latlong/records.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/multi/latlong/schema.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/multi/latlong/schema.arrow b/js/test/arrows/multi/latlong/schema.arrow new file mode 100644 index 0000000..638b2ab Binary files /dev/null and b/js/test/arrows/multi/latlong/schema.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/multi/origins/records.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/multi/origins/records.arrow b/js/test/arrows/multi/origins/records.arrow new file mode 100644 index 0000000..49a8c40 Binary files /dev/null and b/js/test/arrows/multi/origins/records.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/multi/origins/schema.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/multi/origins/schema.arrow b/js/test/arrows/multi/origins/schema.arrow new file mode 100644 index 0000000..0d10fb0 Binary files /dev/null and b/js/test/arrows/multi/origins/schema.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/stream/dictionary.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/stream/dictionary.arrow b/js/test/arrows/stream/dictionary.arrow new file mode 100644 index 0000000..17ca48b Binary files /dev/null and b/js/test/arrows/stream/dictionary.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/stream/simple.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/stream/simple.arrow b/js/test/arrows/stream/simple.arrow new file mode 100644 index 0000000..2c68c0e Binary files /dev/null and b/js/test/arrows/stream/simple.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/arrows/stream/struct.arrow ---------------------------------------------------------------------- diff --git a/js/test/arrows/stream/struct.arrow b/js/test/arrows/stream/struct.arrow new file mode 100644 index 0000000..4e97b70 Binary files /dev/null and b/js/test/arrows/stream/struct.arrow differ http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/reader-tests.ts ---------------------------------------------------------------------- diff --git a/js/test/reader-tests.ts b/js/test/reader-tests.ts new file mode 100644 index 0000000..a7f9f41 --- /dev/null +++ b/js/test/reader-tests.ts @@ -0,0 +1,50 @@ +// 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 { readBuffers } from './Arrow'; +import arrowTestConfigurations from './test-config'; + +for (let [name, ...buffers] of arrowTestConfigurations) { + describe(`${name} readBuffers`, () => { + test(`enumerates each batch as an Array of Vectors`, () => { + expect.hasAssertions(); + for (let vectors of readBuffers(...buffers)) { + for (let vector of vectors) { + expect(vector.name).toMatchSnapshot(); + expect(vector.type).toMatchSnapshot(); + expect(vector.length).toMatchSnapshot(); + for (let i = -1, n = vector.length; ++i < n;) { + expect(vector.get(i)).toMatchSnapshot(); + } + } + } + }); + test(`vector iterators report the same values as get`, () => { + expect.hasAssertions(); + for (let vectors of readBuffers(...buffers)) { + for (let vector of vectors) { + let i = -1, n = vector.length; + for (let v of vector) { + expect(++i).toBeLessThan(n); + expect(v).toEqual(vector.get(i)); + } + expect(++i).toEqual(n); + } + } + }); + }); +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/table-tests.ts ---------------------------------------------------------------------- diff --git a/js/test/table-tests.ts b/js/test/table-tests.ts new file mode 100644 index 0000000..c840299 --- /dev/null +++ b/js/test/table-tests.ts @@ -0,0 +1,88 @@ +// 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 { Table, readBuffers } from './Arrow'; +import arrowTestConfigurations from './test-config'; + +for (let [name, ...buffers] of arrowTestConfigurations) { + describe(`${name} Table`, () => { + test(`creates a Table from Arrow buffers`, () => { + expect.hasAssertions(); + const table = Table.from(...buffers); + for (const vector of table.cols()) { + expect(vector.name).toMatchSnapshot(); + expect(vector.type).toMatchSnapshot(); + expect(vector.length).toMatchSnapshot(); + for (let i = -1, n = vector.length; ++i < n;) { + expect(vector.get(i)).toMatchSnapshot(); + } + } + }); + test(`vector iterators report the same values as get`, () => { + expect.hasAssertions(); + const table = Table.from(...buffers); + for (const vector of table.cols()) { + let i = -1, n = vector.length; + for (let v of vector) { + expect(++i).toBeLessThan(n); + expect(v).toEqual(vector.get(i)); + } + expect(++i).toEqual(n); + } + }); + test(`batch and Table Vectors report the same values`, () => { + expect.hasAssertions(); + let rowsTotal = 0, table = Table.from(...buffers); + for (let vectors of readBuffers(...buffers)) { + let rowsNow = Math.max(...vectors.map((v) => v.length)); + for (let vi = -1, vn = vectors.length; ++vi < vn;) { + let v1 = vectors[vi]; + let v2 = table.getColumnAt(vi); + expect(v1.name).toEqual(v2.name); + expect(v1.type).toEqual(v2.type); + for (let i = -1, n = v1.length; ++i < n;) { + expect(v1.get(i)).toEqual(v2.get(i + rowsTotal)); + } + } + rowsTotal += rowsNow; + } + }); + test(`enumerates Table rows`, () => { + expect.hasAssertions(); + const table = Table.from(...buffers); + for (const row of table.rows()) { + expect(row).toMatchSnapshot(); + } + }); + test(`enumerates Table rows compact`, () => { + expect.hasAssertions(); + const table = Table.from(...buffers); + for (const row of table.rows(true)) { + expect(row).toMatchSnapshot(); + } + }); + test(`toString() prints an empty Table`, () => { + expect(Table.from().toString()).toMatchSnapshot(); + }); + test(`toString() prints a pretty Table`, () => { + expect(Table.from(...buffers).toString()).toMatchSnapshot(); + }); + test(`toString({ index: true }) prints a pretty Table with an Index column`, () => { + expect(Table.from(...buffers).toString({ index: true })).toMatchSnapshot(); + }); + }); +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/test-config.ts ---------------------------------------------------------------------- diff --git a/js/test/test-config.ts b/js/test/test-config.ts new file mode 100644 index 0000000..b31ff11 --- /dev/null +++ b/js/test/test-config.ts @@ -0,0 +1,42 @@ +// 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 fs from 'fs'; +import * as path from 'path'; +const arrowFormats = ['file', 'stream']; +const arrowFileNames = ['simple', 'struct', 'dictionary', 'dictionary2', 'multi_dictionary']; +const multipartArrows = ['count', 'latlong', 'origins']; +export let arrowTestConfigurations = []; + +arrowTestConfigurations = arrowFormats.reduce((configs, format) => { + return arrowFileNames.reduce((configs, name) => { + const arrowPath = path.resolve(__dirname, `./arrows/${format}/${name}.arrow`); + try { + const arrowFile = fs.readFileSync(arrowPath); + return [...configs, [`${name} ${format} Arrow`, arrowFile]]; + } catch (e) {} + return configs; + }, configs); +}, arrowTestConfigurations); + +arrowTestConfigurations = multipartArrows.reduce((configs, folder) => { + const schemaPath = path.resolve(__dirname, `./arrows/multi/${folder}/schema.arrow`); + const recordsPath = path.resolve(__dirname, `./arrows/multi/${folder}/records.arrow`); + return [...configs, [`multipart ${folder} Arrow`, fs.readFileSync(schemaPath), fs.readFileSync(recordsPath)]]; +}, arrowTestConfigurations); + +export default arrowTestConfigurations; http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/tsconfig.json ---------------------------------------------------------------------- diff --git a/js/test/tsconfig.json b/js/test/tsconfig.json new file mode 100644 index 0000000..c1ae204 --- /dev/null +++ b/js/test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "include": ["./**/*.ts"], + "compilerOptions": { + "target": "ESNEXT", + "module": "commonjs", + "allowJs": true, + "importHelpers": false, + "noEmitHelpers": false + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/test/vector-tests.ts ---------------------------------------------------------------------- diff --git a/js/test/vector-tests.ts b/js/test/vector-tests.ts new file mode 100644 index 0000000..54d50d1 --- /dev/null +++ b/js/test/vector-tests.ts @@ -0,0 +1,226 @@ +// 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 { vectors } from './Arrow'; +import { flatbuffers } from 'flatbuffers'; +import Long = flatbuffers.Long; +const BitVector = vectors.BitVector; +const TypedVector = vectors.TypedVector; + +const LongVectors = { + Int64Vector: vectors.Int64Vector, + Uint64Vector: vectors.Uint64Vector, +}; + +const ByteVectors = { + Int8Vector: vectors.Int8Vector, + Int16Vector: vectors.Int16Vector, + Int32Vector: vectors.Int32Vector, + Uint8Vector: vectors.Uint8Vector, + Uint16Vector: vectors.Uint16Vector, + Uint32Vector: vectors.Uint32Vector, + Float32Vector: vectors.Float32Vector, + Float64Vector: vectors.Float64Vector, +}; + +const longVectors = toMap(vectors, Object.keys(LongVectors)); +const byteVectors = toMap(vectors, Object.keys(ByteVectors)); +const bytes = Array.from( + { length: 5 }, + () => Uint8Array.from( + { length: 64 }, + () => Math.random() * 255 | 0)); + +describe(`BitVector`, () => { + const vector = new BitVector(new Uint8Array([27, 0, 0, 0, 0, 0, 0, 0])); + const values = [true, true, false, true, true, false, false, false]; + const n = values.length; + vector.length = 1; + test(`gets expected values`, () => { + let i = -1; + while (++i < n) { + expect(vector.get(i)).toEqual(values[i]); + } + }); + test(`iterates expected values`, () => { + let i = -1; + for (let v of vector) { + expect(++i).toBeLessThan(n); + expect(v).toEqual(values[i]); + } + }); + test(`can set values to true and false`, () => { + const v = new BitVector(new Uint8Array([27, 0, 0, 0, 0, 0, 0, 0])); + const expected1 = [true, true, false, true, true, false, false, false]; + const expected2 = [true, true, true, true, true, false, false, false]; + const expected3 = [true, true, false, false, false, false, true, true]; + function validate(expected) { + for (let i = -1; ++i < n;) { + expect(v.get(i)).toEqual(expected[i]); + } + } + validate(expected1); + v.set(2, true); + validate(expected2); + v.set(2, false); + validate(expected1); + v.set(3, false); + v.set(4, false); + v.set(6, true); + v.set(7, true); + validate(expected3); + v.set(3, true); + v.set(4, true); + v.set(6, false); + v.set(7, false); + validate(expected1); + }); + test(`packs 0 values`, () => { + expect(BitVector.pack([])).toEqual( + new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])); + }); + test(`packs 3 values`, () => { + expect(BitVector.pack([ + true, false, true + ])).toEqual(new Uint8Array([5, 0, 0, 0, 0, 0, 0, 0])); + }); + test(`packs 8 values`, () => { + expect(BitVector.pack([ + true, true, false, true, true, false, false, false + ])).toEqual(new Uint8Array([27, 0, 0, 0, 0, 0, 0, 0])); + }); + test(`packs 25 values`, () => { + expect(BitVector.pack([ + true, true, false, true, true, false, false, false, + false, false, false, true, true, false, true, true, + false + ])).toEqual(new Uint8Array([27, 216, 0, 0, 0, 0, 0, 0])); + }); + test(`from with boolean Array packs values`, () => { + expect(BitVector.from([ + true, false, true + ]).slice()).toEqual(new Uint8Array([5, 0, 0, 0, 0, 0, 0, 0])); + }); +}); + +for (const [VectorName, VectorType] of longVectors) { + const ArrayType = VectorType.prototype.arrayType; + describe(`${VectorName}`, () => { + const values = concatTyped(ArrayType, ...bytes); + const bLists = bytes.map((b) => new ArrayType(b.buffer)); + const vector = new VectorType(null, ...bLists); + const n = vector.length = values.length * 0.5; + test(`gets expected values`, () => { + let i = -1; + while (++i < n) { + expect(vector.get(i)).toEqual(new Long( + values[i * 2], values[i * 2 + 1] + )); + } + }); + test(`iterates expected values`, () => { + let i = -1; + for (let v of vector) { + expect(++i).toBeLessThan(n); + expect(v).toEqual(new Long( + values[i * 2], values[i * 2 + 1] + )); + } + }); + test(`slices the entire array`, () => { + expect(vector.slice()).toEqual(values); + }); + test(`slice returns a TypedArray`, () => { + expect(vector.slice()).toBeInstanceOf(ArrayType); + }); + test(`slices from -20 to length`, () => { + expect(vector.slice(-20)).toEqual(values.slice(-40)); + }); + test(`slices from 0 to -20`, () => { + expect(vector.slice(0, -20)).toEqual(values.slice(0, -40)); + }); + test(`slices the array from 0 to length - 20`, () => { + expect(vector.slice(0, n - 20)).toEqual(values.slice(0, values.length - 40)); + }); + test(`slices the array from 0 to length + 20`, () => { + expect(vector.slice(0, n + 20)).toEqual( + concatTyped(ArrayType, values, values.slice(0, 40))); + }); + }); +} + +for (const [VectorName, VectorType] of byteVectors) { + const ArrayType = VectorType.prototype.arrayType; + describe(`${VectorName}`, () => { + const values = concatTyped(ArrayType, ...bytes); + const bLists = bytes.map((b) => new ArrayType(b.buffer)); + const vector = new VectorType(null, ...bLists); + const n = vector.length = values.length; + test(`gets expected values`, () => { + let i = -1; + while (++i < n) { + expect(vector.get(i)).toEqual(values[i]); + } + }); + test(`iterates expected values`, () => { + expect.hasAssertions(); + let i = -1; + for (let v of vector) { + expect(++i).toBeLessThan(n); + expect(v).toEqual(values[i]); + } + }); + test(`slices the entire array`, () => { + expect(vector.slice()).toEqual(values); + }); + test(`slice returns a TypedArray`, () => { + expect(vector.slice()).toBeInstanceOf(ArrayType); + }); + test(`slices from -20 to length`, () => { + expect(vector.slice(-20)).toEqual(values.slice(-20)); + }); + test(`slices from 0 to -20`, () => { + expect(vector.slice(0, -20)).toEqual(values.slice(0, -20)); + }); + test(`slices the array from 0 to length - 20`, () => { + expect(vector.slice(0, n - 20)).toEqual(values.slice(0, n - 20)); + }); + test(`slices the array from 0 to length + 20`, () => { + expect(vector.slice(0, n + 20)).toEqual( + concatTyped(ArrayType, values, values.slice(0, 20))); + }); + }); +} + +function toMap(entries: any, keys: string[]) { + return keys.reduce((map, key) => { + map.set(key, entries[key] as T); + return map; + }, new Map()); +} + +function concatTyped(ArrayType: any, ...bytes: any[]) { + const BPM = ArrayType.BYTES_PER_ELEMENT; + return bytes.reduce((v, bytes) => { + const l = bytes.byteLength / BPM; + const a = new ArrayType(v.length + l); + const b = new ArrayType(bytes.buffer); + a.set(v); + a.set(b, v.length); + return a; + }, new ArrayType(0)) as Array; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig.json ---------------------------------------------------------------------- diff --git a/js/tsconfig.json b/js/tsconfig.json index f2ad0e8..a56166b 100644 --- a/js/tsconfig.json +++ b/js/tsconfig.json @@ -1,14 +1,11 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "lib": ["es2015", "dom"], - "outDir": "lib", - "moduleResolution": "node", - "sourceMap": true, - "declaration": true + "extends": "./tsconfig/tsconfig.base.json", + "formatCodeOptions": { + "tabSize": 4, + "indentSize": 4 }, - "include": [ - "src/*.ts" - ] + "compilerOptions": { + "target": "ESNEXT", + "module": "es2015" + } } http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.base.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.base.json b/js/tsconfig/tsconfig.base.json new file mode 100644 index 0000000..4723854 --- /dev/null +++ b/js/tsconfig/tsconfig.base.json @@ -0,0 +1,25 @@ +{ + "exclude": ["../node_modules"], + "include": ["../src/**/*.ts"], + "compilerOptions": { + "lib": ["dom", "esnext", "esnext.asynciterable"], + "moduleResolution": "node", + "sourceMap": false, + "inlineSources": true, + "inlineSourceMap": true, + "declaration": true, + "skipLibCheck": true, + "importHelpers": true, + "noEmitHelpers": true, + "noImplicitAny": false, + "noEmitOnError": false, + "noImplicitThis": true, + "noUnusedLocals": true, + "removeComments": false, + "downlevelIteration": true, + "noImplicitUseStrict": true, + "preserveConstEnums": false, + "noFallthroughCasesInSwitch": true, + "forceConsistentCasingInFileNames": true + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.es2015.cjs.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.es2015.cjs.json b/js/tsconfig/tsconfig.es2015.cjs.json new file mode 100644 index 0000000..7e92d5d --- /dev/null +++ b/js/tsconfig/tsconfig.es2015.cjs.json @@ -0,0 +1,8 @@ +//Compiler configuaration to build the ES2015 CommonJS target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ES2015", + "module": "commonjs" + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.es2015.cls.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.es2015.cls.json b/js/tsconfig/tsconfig.es2015.cls.json new file mode 100644 index 0000000..11ccc04 --- /dev/null +++ b/js/tsconfig/tsconfig.es2015.cls.json @@ -0,0 +1,10 @@ +//Compiler configuaration to build the ES2015 Closure Compiler target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ES2015", + "module": "es2015", + "noEmitHelpers": true, + "importHelpers": false + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.es2015.esm.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.es2015.esm.json b/js/tsconfig/tsconfig.es2015.esm.json new file mode 100644 index 0000000..a8b3454 --- /dev/null +++ b/js/tsconfig/tsconfig.es2015.esm.json @@ -0,0 +1,8 @@ +//Compiler configuaration to build the ES2015 ESModules target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ES2015", + "module": "es2015" + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.es5.cjs.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.es5.cjs.json b/js/tsconfig/tsconfig.es5.cjs.json new file mode 100644 index 0000000..cab55c1 --- /dev/null +++ b/js/tsconfig/tsconfig.es5.cjs.json @@ -0,0 +1,8 @@ +//Compiler configuaration to build the ES5 CommonJS target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ES5", + "module": "commonjs" + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.es5.cls.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.es5.cls.json b/js/tsconfig/tsconfig.es5.cls.json new file mode 100644 index 0000000..55f7ea5 --- /dev/null +++ b/js/tsconfig/tsconfig.es5.cls.json @@ -0,0 +1,10 @@ +//Compiler configuaration to build the ES5 Closure Compiler target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ES5", + "module": "es2015", + "noEmitHelpers": true, + "importHelpers": false + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.es5.esm.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.es5.esm.json b/js/tsconfig/tsconfig.es5.esm.json new file mode 100644 index 0000000..7780883 --- /dev/null +++ b/js/tsconfig/tsconfig.es5.esm.json @@ -0,0 +1,8 @@ +//Compiler configuaration to build the ES5 ESModules target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ES5", + "module": "es2015" + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.esnext.cjs.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.esnext.cjs.json b/js/tsconfig/tsconfig.esnext.cjs.json new file mode 100644 index 0000000..06b2ee5 --- /dev/null +++ b/js/tsconfig/tsconfig.esnext.cjs.json @@ -0,0 +1,8 @@ +//Compiler configuaration to build the ESNext CommonJS target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ESNEXT", + "module": "commonjs" + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.esnext.cls.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.esnext.cls.json b/js/tsconfig/tsconfig.esnext.cls.json new file mode 100644 index 0000000..009a5ac --- /dev/null +++ b/js/tsconfig/tsconfig.esnext.cls.json @@ -0,0 +1,10 @@ +//Compiler configuaration to build the ESNext Closure Compiler target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ESNEXT", + "module": "es2015", + "noEmitHelpers": true, + "importHelpers": false + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tsconfig/tsconfig.esnext.esm.json ---------------------------------------------------------------------- diff --git a/js/tsconfig/tsconfig.esnext.esm.json b/js/tsconfig/tsconfig.esnext.esm.json new file mode 100644 index 0000000..c614f2e --- /dev/null +++ b/js/tsconfig/tsconfig.esnext.esm.json @@ -0,0 +1,8 @@ +//Compiler configuaration to build the ESNext ESModules target +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "target": "ESNEXT", + "module": "es2015" + } +} http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/tslint.json ---------------------------------------------------------------------- diff --git a/js/tslint.json b/js/tslint.json index 5f2f6cd..705ef8c 100644 --- a/js/tslint.json +++ b/js/tslint.json @@ -1,12 +1,39 @@ { - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "no-bitwise": false, - "max-classes-per-file": false - }, - "rulesDirectory": [] -} + "rules": { + "curly": true, + "eofline": false, + "align": [true, "parameters"], + "class-name": true, + "indent": [true, "spaces"], + "max-line-length": [false, 150], + "no-consecutive-blank-lines": [true], + "no-trailing-whitespace": true, + "no-duplicate-variable": true, + "no-var-keyword": true, + "no-empty": false, + "no-unused-expression": false, + "no-use-before-declare": false, + "no-var-requires": true, + "no-require-imports": true, + "one-line": [true, + "check-else", + "check-whitespace", + "check-open-brace"], + "quotemark": [true, + "single", + "avoid-escape"], + "semicolon": [true, "always"], + "typedef-whitespace": [true, { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }], + "whitespace": [true, + "check-branch", + "check-decl", + "check-operator", + "check-type"] + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/arrow/blob/9cab3a2f/js/webpack.config.js ---------------------------------------------------------------------- diff --git a/js/webpack.config.js b/js/webpack.config.js deleted file mode 100644 index aa123bd..0000000 --- a/js/webpack.config.js +++ /dev/null @@ -1,54 +0,0 @@ -// 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. - -var path = require('path'); -var UglifyJSPlugin = require('uglifyjs-webpack-plugin'); - -module.exports = { - entry: { - 'arrow': './src/arrow.ts', - 'arrow.min': './src/arrow.ts' - }, - output: { - path: path.resolve(__dirname, '_bundles'), - filename: '[name].js', - libraryTarget: 'umd', - library: 'arrow', - umdNamedDefine: true - }, - resolve: { - extensions: ['.ts', '.js'] - }, - devtool: 'source-map', - plugins: [ - new UglifyJSPlugin({ - minimize: true, - sourceMap: true, - include: /\.min\.js$/ - }) - ], - module: { - loaders: [{ - test: /\.ts$/, - loader: 'awesome-typescript-loader', - exclude: /node_modules/, - query: { - declaration: false - } - }] - } -};