node-s3tables 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -20,9 +20,9 @@ interface ManifestListRecord {
20
20
  sequence_number: bigint;
21
21
  min_sequence_number: bigint;
22
22
  added_snapshot_id: bigint;
23
- added_data_files_count: number;
24
- existing_data_files_count: number;
25
- deleted_data_files_count: number;
23
+ added_files_count: number;
24
+ existing_files_count: number;
25
+ deleted_files_count: number;
26
26
  added_rows_count: bigint;
27
27
  existing_rows_count: bigint;
28
28
  deleted_rows_count: bigint;
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var node_crypto = require('node:crypto');
6
6
  var avsc = require('avsc');
7
+ var zlib = require('node:zlib');
7
8
  var clientS3 = require('@aws-sdk/client-s3');
8
9
  var clientS3tables = require('@aws-sdk/client-s3tables');
9
10
  var libStorage = require('@aws-sdk/lib-storage');
@@ -32,6 +33,7 @@ function _interopNamespaceDefault(e) {
32
33
  }
33
34
 
34
35
  var avsc__namespace = /*#__PURE__*/_interopNamespaceDefault(avsc);
36
+ var zlib__namespace = /*#__PURE__*/_interopNamespaceDefault(zlib);
35
37
  var LosslessJson__namespace = /*#__PURE__*/_interopNamespaceDefault(LosslessJson);
36
38
 
37
39
  function fixupMetadata(metadata) {
@@ -55,6 +57,7 @@ async function avroToBuffer(params) {
55
57
  const buffers = [];
56
58
  const opts = {
57
59
  writeHeader: true,
60
+ codecs: { deflate: zlib__namespace.deflateRaw },
58
61
  codec: 'deflate',
59
62
  metadata,
60
63
  };
@@ -120,7 +123,12 @@ function _icebergToAvroField(field, schema) {
120
123
  }
121
124
  throw new Error(`Unsupported transform: ${field.transform} for type`);
122
125
  }
123
- return { name: field.name, type: ['null', avroType], default: null };
126
+ return {
127
+ name: field.name,
128
+ type: ['null', avroType],
129
+ default: null,
130
+ 'field-id': field['field-id'],
131
+ };
124
132
  }
125
133
  function _mapPrimitiveToAvro(type) {
126
134
  switch (type) {
@@ -166,7 +174,9 @@ var ListContent;
166
174
  ListContent[ListContent["DELETES"] = 1] = "DELETES";
167
175
  })(ListContent || (ListContent = {}));
168
176
  const BigIntType = avsc__namespace.types.LongType.__with({
169
- fromBuffer: (buf) => buf.readBigInt64LE(),
177
+ fromBuffer(uint_array) {
178
+ return Buffer.from(uint_array).readBigInt64LE();
179
+ },
170
180
  toBuffer(n) {
171
181
  const buf = Buffer.alloc(8);
172
182
  buf.writeBigInt64LE(n);
@@ -531,19 +541,19 @@ const ManifestListType = avsc__namespace.Type.forSchema({
531
541
  'field-id': 503,
532
542
  },
533
543
  {
534
- name: 'added_data_files_count',
544
+ name: 'added_files_count',
535
545
  type: 'int',
536
546
  doc: 'Added entry count',
537
547
  'field-id': 504,
538
548
  },
539
549
  {
540
- name: 'existing_data_files_count',
550
+ name: 'existing_files_count',
541
551
  type: 'int',
542
552
  doc: 'Existing entry count',
543
553
  'field-id': 505,
544
554
  },
545
555
  {
546
- name: 'deleted_data_files_count',
556
+ name: 'deleted_files_count',
547
557
  type: 'int',
548
558
  doc: 'Deleted entry count',
549
559
  'field-id': 506,
@@ -837,10 +847,12 @@ async function updateManifestList(params) {
837
847
  }
838
848
  const passthrough = new node_stream.PassThrough();
839
849
  const decoder = new avsc__namespace.streams.BlockDecoder({
850
+ codecs: { deflate: zlib__namespace.inflateRaw },
840
851
  parseHook: () => ManifestListType,
841
852
  });
842
853
  const encoder = new avsc__namespace.streams.BlockEncoder(ManifestListType, {
843
854
  codec: 'deflate',
855
+ codecs: { deflate: zlib__namespace.deflateRaw },
844
856
  metadata,
845
857
  });
846
858
  encoder.pipe(passthrough);
@@ -961,9 +973,9 @@ async function addManifest(params) {
961
973
  sequence_number: params.sequenceNumber,
962
974
  min_sequence_number: params.sequenceNumber,
963
975
  added_snapshot_id: params.snapshotId,
964
- added_data_files_count: params.files.length,
965
- existing_data_files_count: 0,
966
- deleted_data_files_count: 0,
976
+ added_files_count: params.files.length,
977
+ existing_files_count: 0,
978
+ deleted_files_count: 0,
967
979
  added_rows_count,
968
980
  existing_rows_count: 0n,
969
981
  deleted_rows_count: 0n,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-s3tables",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "node api for dealing with s3tables",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@aws-sdk/client-s3": "^3.901.0",
29
29
  "@aws-sdk/client-s3tables": "^3.901.0",
30
30
  "@aws-sdk/lib-storage": "^3.901.0",
31
- "avsc": "^5.7.9",
31
+ "avsc": "https://github.com/jim-lake/avsc.git#66bc46724a6db2e55123a94532aca318a133a8ee",
32
32
  "lossless-json": "^4.2.0"
33
33
  },
34
34
  "devDependencies": {