@maplibre/mlt 1.1.5 → 1.1.7

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.
Files changed (173) hide show
  1. package/dist/decoding/bigEndianDecode.d.ts +13 -0
  2. package/dist/decoding/bigEndianDecode.js +50 -0
  3. package/dist/decoding/bigEndianDecode.js.map +1 -0
  4. package/dist/decoding/decodingTestUtils.d.ts +1 -1
  5. package/dist/decoding/decodingTestUtils.js.map +1 -1
  6. package/dist/decoding/decodingUtils.js +4 -2
  7. package/dist/decoding/decodingUtils.js.map +1 -1
  8. package/dist/decoding/fastPforDecoder.d.ts +48 -0
  9. package/dist/decoding/fastPforDecoder.js +482 -0
  10. package/dist/decoding/fastPforDecoder.js.map +1 -0
  11. package/dist/decoding/fastPforShared.d.ts +9 -0
  12. package/dist/decoding/fastPforShared.js +29 -0
  13. package/dist/decoding/fastPforShared.js.map +1 -0
  14. package/dist/decoding/fastPforUnpack.d.ts +23 -0
  15. package/dist/decoding/fastPforUnpack.js +910 -0
  16. package/dist/decoding/fastPforUnpack.js.map +1 -0
  17. package/dist/decoding/geometryDecoder.d.ts +2 -2
  18. package/dist/decoding/geometryDecoder.js +11 -8
  19. package/dist/decoding/geometryDecoder.js.map +1 -1
  20. package/dist/decoding/integerDecodingUtils.d.ts +14 -10
  21. package/dist/decoding/integerDecodingUtils.js +44 -22
  22. package/dist/decoding/integerDecodingUtils.js.map +1 -1
  23. package/dist/decoding/integerStreamDecoder.d.ts +1 -1
  24. package/dist/decoding/integerStreamDecoder.js +13 -6
  25. package/dist/decoding/integerStreamDecoder.js.map +1 -1
  26. package/dist/decoding/propertyDecoder.js +10 -14
  27. package/dist/decoding/propertyDecoder.js.map +1 -1
  28. package/dist/decoding/stringDecoder.js +2 -11
  29. package/dist/decoding/stringDecoder.js.map +1 -1
  30. package/dist/encoding/bigEndianEncode.d.ts +7 -0
  31. package/dist/encoding/bigEndianEncode.js +16 -0
  32. package/dist/encoding/bigEndianEncode.js.map +1 -0
  33. package/dist/encoding/constGeometryVectorEncoder.d.ts +19 -0
  34. package/dist/encoding/constGeometryVectorEncoder.js +248 -0
  35. package/dist/encoding/constGeometryVectorEncoder.js.map +1 -0
  36. package/dist/encoding/encodingUtils.d.ts +1 -1
  37. package/dist/encoding/encodingUtils.js +2 -2
  38. package/dist/encoding/encodingUtils.js.map +1 -1
  39. package/dist/encoding/fastPforEncoder.d.ts +19 -0
  40. package/dist/encoding/fastPforEncoder.js +310 -0
  41. package/dist/encoding/fastPforEncoder.js.map +1 -0
  42. package/dist/encoding/integerEncodingUtils.d.ts +7 -7
  43. package/dist/encoding/integerEncodingUtils.js +25 -17
  44. package/dist/encoding/integerEncodingUtils.js.map +1 -1
  45. package/dist/encoding/integerStreamEncoder.d.ts +1 -1
  46. package/dist/encoding/integerStreamEncoder.js +5 -5
  47. package/dist/encoding/integerStreamEncoder.js.map +1 -1
  48. package/dist/encoding/packNullableUtils.d.ts +1 -1
  49. package/dist/encoding/packNullableUtils.js.map +1 -1
  50. package/dist/encoding/propertyEncoder.d.ts +1 -1
  51. package/dist/encoding/propertyEncoder.js +8 -8
  52. package/dist/encoding/propertyEncoder.js.map +1 -1
  53. package/dist/encoding/stringEncoder.js +3 -3
  54. package/dist/encoding/stringEncoder.js.map +1 -1
  55. package/dist/encoding/zOrderCurveEncoder.js +1 -1
  56. package/dist/encoding/zOrderCurveEncoder.js.map +1 -1
  57. package/dist/metadata/tile/logicalStreamType.d.ts +3 -3
  58. package/dist/metadata/tile/logicalStreamType.js.map +1 -1
  59. package/dist/metadata/tileset/embeddedTilesetMetadataDecoder.d.ts +1 -1
  60. package/dist/metadata/tileset/embeddedTilesetMetadataDecoder.js.map +1 -1
  61. package/dist/metadata/tileset/typeMap.d.ts +10 -2
  62. package/dist/metadata/tileset/typeMap.js +25 -15
  63. package/dist/metadata/tileset/typeMap.js.map +1 -1
  64. package/dist/mltDecoder.js +29 -26
  65. package/dist/mltDecoder.js.map +1 -1
  66. package/dist/mltMetadata.js.map +1 -1
  67. package/dist/vector/constant/intConstVector.d.ts +1 -1
  68. package/dist/vector/constant/intConstVector.js +1 -1
  69. package/dist/vector/constant/intConstVector.js.map +1 -1
  70. package/dist/vector/constant/longConstVector.d.ts +1 -1
  71. package/dist/vector/constant/longConstVector.js +1 -1
  72. package/dist/vector/constant/longConstVector.js.map +1 -1
  73. package/dist/vector/dictionary/stringDictionaryVector.d.ts +0 -1
  74. package/dist/vector/dictionary/stringDictionaryVector.js +0 -2
  75. package/dist/vector/dictionary/stringDictionaryVector.js.map +1 -1
  76. package/dist/vector/featureTable.d.ts +4 -5
  77. package/dist/vector/featureTable.js +2 -29
  78. package/dist/vector/featureTable.js.map +1 -1
  79. package/dist/vector/filter/flatSelectionVector.d.ts +1 -1
  80. package/dist/vector/filter/flatSelectionVector.js.map +1 -1
  81. package/dist/vector/filter/selectionVectorUtils.d.ts +1 -1
  82. package/dist/vector/filter/selectionVectorUtils.js.map +1 -1
  83. package/dist/vector/filter/sequenceSelectionVector.d.ts +1 -1
  84. package/dist/vector/filter/sequenceSelectionVector.js.map +1 -1
  85. package/dist/vector/flat/stringFlatVector.d.ts +0 -1
  86. package/dist/vector/flat/stringFlatVector.js +0 -2
  87. package/dist/vector/flat/stringFlatVector.js.map +1 -1
  88. package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.d.ts +0 -2
  89. package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.js +0 -36
  90. package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.js.map +1 -1
  91. package/dist/vector/geometry/constGeometryVector.d.ts +2 -2
  92. package/dist/vector/geometry/constGeometryVector.js +1 -1
  93. package/dist/vector/geometry/constGeometryVector.js.map +1 -1
  94. package/dist/vector/geometry/constGpuVector.d.ts +2 -2
  95. package/dist/vector/geometry/constGpuVector.js +1 -1
  96. package/dist/vector/geometry/constGpuVector.js.map +1 -1
  97. package/dist/vector/geometry/flatGeometryVector.d.ts +1 -1
  98. package/dist/vector/geometry/flatGeometryVector.js.map +1 -1
  99. package/dist/vector/geometry/flatGpuVector.d.ts +1 -1
  100. package/dist/vector/geometry/flatGpuVector.js.map +1 -1
  101. package/dist/vector/geometry/geometryType.js.map +1 -1
  102. package/dist/vector/geometry/geometryVector.d.ts +4 -5
  103. package/dist/vector/geometry/geometryVector.js +0 -8
  104. package/dist/vector/geometry/geometryVector.js.map +1 -1
  105. package/dist/vector/geometry/geometryVectorConverter.d.ts +1 -1
  106. package/dist/vector/geometry/geometryVectorConverter.js +167 -211
  107. package/dist/vector/geometry/geometryVectorConverter.js.map +1 -1
  108. package/dist/vector/geometry/gpuVector.d.ts +2 -2
  109. package/dist/vector/geometry/gpuVector.js.map +1 -1
  110. package/dist/vector/geometry/topologyVector.d.ts +5 -9
  111. package/dist/vector/geometry/topologyVector.js +1 -19
  112. package/dist/vector/geometry/topologyVector.js.map +1 -1
  113. package/dist/vector/geometry/vertexBufferType.js.map +1 -1
  114. package/dist/vector/intVector.d.ts +7 -7
  115. package/dist/vector/intVector.js.map +1 -1
  116. package/dist/vector/vector.js +1 -1
  117. package/dist/vector/vector.js.map +1 -1
  118. package/dist/vector/vectorType.js.map +1 -1
  119. package/package.json +9 -10
  120. package/dist/decoding/decodingUtils.spec.d.ts +0 -1
  121. package/dist/decoding/decodingUtils.spec.js +0 -141
  122. package/dist/decoding/decodingUtils.spec.js.map +0 -1
  123. package/dist/decoding/fsstDecoder.spec.d.ts +0 -1
  124. package/dist/decoding/fsstDecoder.spec.js +0 -57
  125. package/dist/decoding/fsstDecoder.spec.js.map +0 -1
  126. package/dist/decoding/integerDecodingUtils.spec.d.ts +0 -1
  127. package/dist/decoding/integerDecodingUtils.spec.js +0 -300
  128. package/dist/decoding/integerDecodingUtils.spec.js.map +0 -1
  129. package/dist/decoding/integerStreamDecoder.spec.d.ts +0 -1
  130. package/dist/decoding/integerStreamDecoder.spec.js +0 -402
  131. package/dist/decoding/integerStreamDecoder.spec.js.map +0 -1
  132. package/dist/decoding/propertyDecoder.spec.d.ts +0 -1
  133. package/dist/decoding/propertyDecoder.spec.js +0 -448
  134. package/dist/decoding/propertyDecoder.spec.js.map +0 -1
  135. package/dist/decoding/stringDecoder.spec.d.ts +0 -1
  136. package/dist/decoding/stringDecoder.spec.js +0 -387
  137. package/dist/decoding/stringDecoder.spec.js.map +0 -1
  138. package/dist/decoding/unpackNullableUtils.spec.d.ts +0 -1
  139. package/dist/decoding/unpackNullableUtils.spec.js +0 -71
  140. package/dist/decoding/unpackNullableUtils.spec.js.map +0 -1
  141. package/dist/metadata/tileset/embeddedTilesetMetadataDecoder.spec.d.ts +0 -1
  142. package/dist/metadata/tileset/embeddedTilesetMetadataDecoder.spec.js +0 -142
  143. package/dist/metadata/tileset/embeddedTilesetMetadataDecoder.spec.js.map +0 -1
  144. package/dist/mltDecoder.spec.d.ts +0 -1
  145. package/dist/mltDecoder.spec.js +0 -152
  146. package/dist/mltDecoder.spec.js.map +0 -1
  147. package/dist/vector/filter/flatSelectionVector.spec.d.ts +0 -1
  148. package/dist/vector/filter/flatSelectionVector.spec.js +0 -51
  149. package/dist/vector/filter/flatSelectionVector.spec.js.map +0 -1
  150. package/dist/vector/filter/selectionVectorUtil.spec.d.ts +0 -1
  151. package/dist/vector/filter/selectionVectorUtil.spec.js +0 -154
  152. package/dist/vector/filter/selectionVectorUtil.spec.js.map +0 -1
  153. package/dist/vector/filter/sequenceSelectionVector.spec.d.ts +0 -1
  154. package/dist/vector/filter/sequenceSelectionVector.spec.js +0 -115
  155. package/dist/vector/filter/sequenceSelectionVector.spec.js.map +0 -1
  156. package/dist/vector/flat/floatFlatVector.spec.d.ts +0 -1
  157. package/dist/vector/flat/floatFlatVector.spec.js +0 -14
  158. package/dist/vector/flat/floatFlatVector.spec.js.map +0 -1
  159. package/dist/vector/flat/intFlatVector.spec.d.ts +0 -1
  160. package/dist/vector/flat/intFlatVector.spec.js +0 -15
  161. package/dist/vector/flat/intFlatVector.spec.js.map +0 -1
  162. package/dist/vector/flat/longFlatVector.spec.d.ts +0 -1
  163. package/dist/vector/flat/longFlatVector.spec.js +0 -14
  164. package/dist/vector/flat/longFlatVector.spec.js.map +0 -1
  165. package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.spec.d.ts +0 -1
  166. package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.spec.js +0 -28
  167. package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.spec.js.map +0 -1
  168. package/dist/vector/geometry/zOrderCurve.spec.d.ts +0 -1
  169. package/dist/vector/geometry/zOrderCurve.spec.js +0 -25
  170. package/dist/vector/geometry/zOrderCurve.spec.js.map +0 -1
  171. package/dist/vector/sequence/longSequenceVektor.spec.d.ts +0 -1
  172. package/dist/vector/sequence/longSequenceVektor.spec.js +0 -11
  173. package/dist/vector/sequence/longSequenceVektor.spec.js.map +0 -1
@@ -1,387 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import IntWrapper from "./intWrapper";
3
- import { decodeString, decodeSharedDictionary } from "./stringDecoder";
4
- import { encodePlainStrings, encodeDictionaryStrings } from "../encoding/stringEncoder";
5
- import { concatenateBuffers, createColumnMetadataForStruct, createStream, encodeFsstStrings, encodeSharedDictionary, encodeStructField, } from "./decodingTestUtils";
6
- import { StringFlatVector } from "../vector/flat/stringFlatVector";
7
- import { StringDictionaryVector } from "../vector/dictionary/stringDictionaryVector";
8
- import { StringFsstDictionaryVector } from "../vector/fsst-dictionary/stringFsstDictionaryVector";
9
- import { ScalarType } from "../metadata/tileset/tilesetMetadata";
10
- import { PhysicalStreamType } from "../metadata/tile/physicalStreamType";
11
- import { LengthType } from "../metadata/tile/lengthType";
12
- import { LogicalStreamType } from "../metadata/tile/logicalStreamType";
13
- describe("decodeString - Plain String Decoder", () => {
14
- it("should decode plain strings with simple ASCII values", () => {
15
- const expectedStrings = ["hello", "world", "test"];
16
- const encodedStrings = encodePlainStrings(expectedStrings);
17
- const offset = new IntWrapper(0);
18
- const result = decodeString("testColumn", encodedStrings, offset, 2);
19
- expect(result).toBeInstanceOf(StringFlatVector);
20
- const resultVec = result;
21
- for (let i = 0; i < expectedStrings.length; i++) {
22
- expect(resultVec.getValue(i)).toBe(expectedStrings[i]);
23
- }
24
- });
25
- it("should decode plain strings with varying lengths", () => {
26
- const expectedStrings = ["a", "abc", "hello world"];
27
- const encodedStrings = encodePlainStrings(expectedStrings);
28
- const offset = new IntWrapper(0);
29
- const result = decodeString("testColumn", encodedStrings, offset, 2);
30
- const resultVec = result;
31
- for (let i = 0; i < expectedStrings.length; i++) {
32
- expect(resultVec.getValue(i)).toBe(expectedStrings[i]);
33
- }
34
- });
35
- it("should decode plain strings with empty strings", () => {
36
- const expectedStrings = ["", "encodedStrings", "", "more"];
37
- const encodedStrings = encodePlainStrings(expectedStrings);
38
- const offset = new IntWrapper(0);
39
- const result = decodeString("testColumn", encodedStrings, offset, 2);
40
- expect(result).toBeInstanceOf(StringFlatVector);
41
- const resultVec = result;
42
- for (let i = 0; i < expectedStrings.length; i++) {
43
- expect(resultVec.getValue(i)).toBe(expectedStrings[i]);
44
- }
45
- });
46
- it("should decode mixed null and empty strings", () => {
47
- const expectedStrings = [null, "", "encodedStrings", null, ""];
48
- const encodedStrings = encodePlainStrings(expectedStrings);
49
- const offset = new IntWrapper(0);
50
- const result = decodeString("testColumn", encodedStrings, offset, 3);
51
- expect(result).not.toBeNull();
52
- for (let i = 0; i < expectedStrings.length; i++) {
53
- expect(result.getValue(i)).toBe(expectedStrings[i]);
54
- }
55
- });
56
- it("should decode mixed ASCII and UTF-8 strings", () => {
57
- const expectedStrings = ["hello", "Привет", "world", "日本"];
58
- const encodedStrings = encodePlainStrings(expectedStrings);
59
- const offset = new IntWrapper(0);
60
- const result = decodeString("testColumn", encodedStrings, offset, 2);
61
- expect(result).toBeInstanceOf(StringFlatVector);
62
- const resultVec = result;
63
- for (let i = 0; i < expectedStrings.length; i++) {
64
- expect(resultVec.getValue(i)).toBe(expectedStrings[i]);
65
- }
66
- });
67
- });
68
- describe("decodeString - Dictionary String Decoder", () => {
69
- it("should decode dictionary-compressed strings with repeated values", () => {
70
- const expectedStrings = ["cat", "dog", "cat", "cat", "dog"];
71
- const encodedStrings = encodeDictionaryStrings(expectedStrings);
72
- const offset = new IntWrapper(0);
73
- const result = decodeString("testColumn", encodedStrings, offset, 3);
74
- expect(result).toBeInstanceOf(StringDictionaryVector);
75
- const resultVec = result;
76
- for (let i = 0; i < expectedStrings.length; i++) {
77
- expect(resultVec.getValue(i)).toBe(expectedStrings[i]);
78
- }
79
- });
80
- it("should decode dictionary with single repeated string", () => {
81
- const expectedStrings = ["same", "same", "same"];
82
- const encodedStrings = encodeDictionaryStrings(expectedStrings);
83
- const offset = new IntWrapper(0);
84
- const result = decodeString("testColumn", encodedStrings, offset, 3);
85
- expect(result).toBeInstanceOf(StringDictionaryVector);
86
- for (let i = 0; i < expectedStrings.length; i++) {
87
- expect(result.getValue(i)).toBe(expectedStrings[i]);
88
- }
89
- });
90
- it("should decode dictionary with UTF-8 strings", () => {
91
- const expectedStrings = ["café", "日本", "café", "日本"];
92
- const encodedStrings = encodeDictionaryStrings(expectedStrings);
93
- const offset = new IntWrapper(0);
94
- const result = decodeString("testColumn", encodedStrings, offset, 3);
95
- expect(result).toBeInstanceOf(StringDictionaryVector);
96
- for (let i = 0; i < expectedStrings.length; i++) {
97
- expect(result.getValue(i)).toBe(expectedStrings[i]);
98
- }
99
- });
100
- it("should decode dictionary with all unique strings", () => {
101
- const expectedStrings = ["unique1", "unique2", "unique3", "unique4"];
102
- const encodedStrings = encodeDictionaryStrings(expectedStrings);
103
- const offset = new IntWrapper(0);
104
- const result = decodeString("testColumn", encodedStrings, offset, 3);
105
- expect(result).toBeInstanceOf(StringDictionaryVector);
106
- for (let i = 0; i < expectedStrings.length; i++) {
107
- expect(result.getValue(i)).toBe(expectedStrings[i]);
108
- }
109
- });
110
- it("should decode nullable dictionary strings", () => {
111
- const expectedStrings = [null, "", "encodedStrings", "", null];
112
- const encodedStrings = encodeDictionaryStrings(expectedStrings);
113
- const offset = new IntWrapper(0);
114
- const result = decodeString("testColumn", encodedStrings, offset, 4);
115
- expect(result).toBeInstanceOf(StringDictionaryVector);
116
- for (let i = 0; i < expectedStrings.length; i++) {
117
- expect(result.getValue(i)).toBe(expectedStrings[i]);
118
- }
119
- });
120
- });
121
- describe("decodeString - FSST Dictionary Decoder (Basic Coverage)", () => {
122
- it("should decode FSST-compressed strings with simple symbol table", () => {
123
- const encodedStrings = encodeFsstStrings();
124
- const offset = new IntWrapper(0);
125
- const result = decodeString("testColumn", encodedStrings, offset, 6);
126
- expect(result).toBeInstanceOf(StringFsstDictionaryVector);
127
- const resultVec = result;
128
- const expectedValues = ["cat", "dog", "cat"];
129
- for (let i = 0; i < expectedValues.length; i++) {
130
- expect(resultVec.getValue(i)).toBe(expectedValues[i]);
131
- }
132
- });
133
- });
134
- describe("decodeString - Empty Column Edge Cases", () => {
135
- it("should handle empty column with numStreams = 0 (returns null)", () => {
136
- const fullStream = new Uint8Array([]);
137
- const offset = new IntWrapper(0);
138
- const result = decodeString("testColumn", fullStream, offset, 0);
139
- expect(result).toBeNull();
140
- });
141
- it("should handle column with all zero-length streams (returns null)", () => {
142
- const emptyStream = createStream(PhysicalStreamType.LENGTH, new Uint8Array([]), {
143
- logical: new LogicalStreamType(undefined, undefined, LengthType.VAR_BINARY),
144
- });
145
- const offset = new IntWrapper(0);
146
- const result = decodeString("testColumn", emptyStream, offset, 1);
147
- expect(result).toBeNull();
148
- });
149
- it("should handle single value plain string column", () => {
150
- const strings = ["single"];
151
- const encodedStrings = encodePlainStrings(strings);
152
- const offset = new IntWrapper(0);
153
- const result = decodeString("testColumn", encodedStrings, offset, 2);
154
- expect(result).toBeInstanceOf(StringFlatVector);
155
- expect(result.getValue(0)).toBe("single");
156
- });
157
- it("should handle single null value in plain string column (returns null)", () => {
158
- const strings = [null];
159
- const encodedStrings = encodePlainStrings(strings);
160
- const offset = new IntWrapper(0);
161
- const result = decodeString("testColumn", encodedStrings, offset, 3);
162
- expect(result).toBeNull();
163
- });
164
- });
165
- describe("decodeString - Integration Tests", () => {
166
- it("should correctly track offset through multiple streams", () => {
167
- const strings = ["hello", "world"];
168
- const encodedStrings = encodePlainStrings(strings);
169
- const offset = new IntWrapper(0);
170
- const initialOffset = offset.get();
171
- const result = decodeString("testColumn", encodedStrings, offset, 2);
172
- expect(result).toBeInstanceOf(StringFlatVector);
173
- expect(offset.get()).toBeGreaterThan(initialOffset);
174
- expect(offset.get()).toBe(encodedStrings.length);
175
- });
176
- it("should correctly track offset through nullable streams", () => {
177
- const strings = ["test", null, "encodedStrings"];
178
- const encodedStrings = encodePlainStrings(strings);
179
- const offset = new IntWrapper(0);
180
- const initialOffset = offset.get();
181
- const result = decodeString("testColumn", encodedStrings, offset, 3);
182
- expect(result).not.toBeNull();
183
- expect(offset.get()).toBeGreaterThan(initialOffset);
184
- expect(offset.get()).toBe(encodedStrings.length);
185
- });
186
- it("should correctly track offset through FSST dictionary streams", () => {
187
- const encodedStrings = encodeFsstStrings();
188
- const offset = new IntWrapper(0);
189
- const initialOffset = offset.get();
190
- const result = decodeString("testColumn", encodedStrings, offset, 6);
191
- expect(result).toBeInstanceOf(StringFsstDictionaryVector);
192
- expect(offset.get()).toBeGreaterThan(initialOffset);
193
- expect(offset.get()).toBe(encodedStrings.length);
194
- });
195
- it("should handle consecutive decoding operations with shared offset tracker", () => {
196
- const stream1 = encodePlainStrings(["first"]);
197
- const stream2 = encodePlainStrings(["second"]);
198
- const combinedStream = concatenateBuffers(stream1, stream2);
199
- const offset = new IntWrapper(0);
200
- const result1 = decodeString("column1", combinedStream, offset, 2);
201
- expect(result1.getValue(0)).toBe("first");
202
- const offsetAfterFirst = offset.get();
203
- const result2 = decodeString("column2", combinedStream, offset, 2);
204
- expect(result2.getValue(0)).toBe("second");
205
- expect(offset.get()).toBeGreaterThan(offsetAfterFirst);
206
- expect(offset.get()).toBe(combinedStream.length);
207
- });
208
- });
209
- describe("decodeSharedDictionary", () => {
210
- describe("basic functionality", () => {
211
- it("should decode single field with shared dictionary", () => {
212
- const dictionaryStrings = ["apple", "banana", "peach", "date"];
213
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
214
- const fieldStreams = encodeStructField([0, 1, 2, 3], [true, true, true, true]);
215
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);
216
- const columnMetaencodedStrings = createColumnMetadataForStruct("address", [{ name: "street" }]);
217
- const result = decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 4);
218
- expect(result).toHaveLength(1);
219
- expect(result[0]).toBeInstanceOf(StringDictionaryVector);
220
- expect(result[0].name).toBe("address:street");
221
- for (let i = 0; i < dictionaryStrings.length; i++) {
222
- expect(result[0].getValue(i)).toBe(dictionaryStrings[i]);
223
- }
224
- });
225
- it("should handle empty child field name (common prefix stripped)", () => {
226
- const dictionaryStrings = ["Berlin", "London", "Paris"];
227
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
228
- const fieldStreams = encodeStructField([0, 1, 2], [true, true, true]);
229
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);
230
- const columnMetaencodedStrings = createColumnMetadataForStruct("name", [{ name: "" }]);
231
- const result = decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 3);
232
- expect(result).toHaveLength(1);
233
- expect(result[0].name).toBe("name");
234
- for (let i = 0; i < dictionaryStrings.length; i++) {
235
- expect(result[0].getValue(i)).toBe(dictionaryStrings[i]);
236
- }
237
- });
238
- it("should handle mix of empty and delimited child names", () => {
239
- const dict = ["value1", "value2", "value3"];
240
- const { lengthStream, dataStream } = encodeSharedDictionary(dict);
241
- const field1 = encodeStructField([0], [true]);
242
- const field2 = encodeStructField([1], [true]);
243
- const field3 = encodeStructField([2], [true]);
244
- const complete = concatenateBuffers(lengthStream, dataStream, field1, field2, field3);
245
- const metadata = createColumnMetadataForStruct("name", [
246
- { name: "" },
247
- { name: ":en" },
248
- { name: ":de" },
249
- ]);
250
- const result = decodeSharedDictionary(complete, new IntWrapper(0), metadata, 1);
251
- expect(result).toHaveLength(3);
252
- expect(result[0].name).toBe("name");
253
- expect(result[1].name).toBe("name:en");
254
- expect(result[2].name).toBe("name:de");
255
- });
256
- });
257
- describe("nullability", () => {
258
- it("should handle nullable fields with PRESENT stream", () => {
259
- const dictionaryStrings = ["red", "green", "blue"];
260
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
261
- const fieldStreams = encodeStructField([0, 2], [true, false, true, false]);
262
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);
263
- const columnMetaencodedStrings = createColumnMetadataForStruct("colors", [{ name: "primary" }]);
264
- const result = decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 4);
265
- expect(result).toHaveLength(1);
266
- const expected = ["red", null, "blue", null];
267
- for (let i = 0; i < expected.length; i++) {
268
- expect(result[0].getValue(i)).toBe(expected[i]);
269
- }
270
- });
271
- it("should detect nullable fields when offsetCount < numFeatures", () => {
272
- const dictionaryStrings = ["alpha", "beta"];
273
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
274
- // Simulating implicit nullability by mismatched counts
275
- const fieldStreams = encodeStructField([0, 1], [true, false, false, true]);
276
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);
277
- const columnMetaencodedStrings = createColumnMetadataForStruct("greek", [{ name: "letter" }]);
278
- const result = decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 4);
279
- expect(result).toHaveLength(1);
280
- const expected = ["alpha", null, null, "beta"];
281
- for (let i = 0; i < expected.length; i++) {
282
- expect(result[0].getValue(i)).toBe(expected[i]);
283
- }
284
- });
285
- });
286
- describe("FSST encoding", () => {
287
- it("should decode FSST-compressed shared dictionary", () => {
288
- const dictionaryStrings = ["compressed1", "compressed2"];
289
- const { lengthStream, dataStream, symbolLengthStream, symbolDataStream } = encodeSharedDictionary(dictionaryStrings, { useFsst: true });
290
- const fieldStreams = encodeStructField([0, 1], [true, true]);
291
- const completeencodedStrings = concatenateBuffers(lengthStream, symbolLengthStream, symbolDataStream, dataStream, fieldStreams);
292
- const columnMetaencodedStrings = createColumnMetadataForStruct("encodedStrings", [{ name: "value" }]);
293
- const result = decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 2);
294
- expect(result).toHaveLength(1);
295
- expect(result[0]).toBeInstanceOf(StringFsstDictionaryVector);
296
- expect(result[0].name).toBe("encodedStrings:value");
297
- });
298
- });
299
- describe("field filtering", () => {
300
- it("should filter fields by propertyColumnNames", () => {
301
- const dictionaryStrings = ["val1", "val2"];
302
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
303
- const field1Streams = encodeStructField([0], [true]);
304
- const field2Streams = encodeStructField([1], [true]);
305
- const field3Streams = encodeStructField([0], [true]);
306
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, field1Streams, field2Streams, field3Streams);
307
- const columnMetaencodedStrings = createColumnMetadataForStruct("multi", [
308
- { name: "field1" },
309
- { name: "field2" },
310
- { name: "field3" },
311
- ]);
312
- const propertyColumnNames = new Set(["multi:field1", "multi:field3"]);
313
- const result = decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 1, propertyColumnNames);
314
- expect(result).toHaveLength(2);
315
- expect(result[0].name).toBe("multi:field1");
316
- expect(result[1].name).toBe("multi:field3");
317
- });
318
- it("should skip fields with numStreams=0", () => {
319
- const dictionaryStrings = ["present"];
320
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
321
- const field1Streams = encodeStructField([0], [true], true);
322
- const field2Streams = encodeStructField([], [], false); // numStreams=0
323
- const field3Streams = encodeStructField([0], [true], true);
324
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, field1Streams, field2Streams, field3Streams);
325
- const columnMetaencodedStrings = createColumnMetadataForStruct("test", [
326
- { name: "field1" },
327
- { name: "field2" },
328
- { name: "field3" },
329
- ]);
330
- const result = decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 1);
331
- expect(result).toHaveLength(2);
332
- expect(result[0].name).toBe("test:field1");
333
- expect(result[1].name).toBe("test:field3");
334
- });
335
- it("should handle mixed present and filtered fields", () => {
336
- const dictionaryStrings = ["encodedStrings"];
337
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
338
- const field1Streams = encodeStructField([0], [true], true);
339
- const field2Streams = encodeStructField([], [], false);
340
- const field3Streams = encodeStructField([0], [true], true);
341
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, field1Streams, field2Streams, field3Streams);
342
- const columnMetaencodedStrings = createColumnMetadataForStruct("mixed", [
343
- { name: "field1" },
344
- { name: "field2" },
345
- { name: "field3" },
346
- ]);
347
- const propertyColumnNames = new Set(["mixed:field3"]);
348
- const result = decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 1, propertyColumnNames);
349
- expect(result).toHaveLength(1);
350
- expect(result[0].name).toBe("mixed:field3");
351
- });
352
- });
353
- describe("error handling", () => {
354
- it("should throw error for non-string field types", () => {
355
- const dictionaryStrings = ["value"];
356
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
357
- const fieldStreams = encodeStructField([0], [true]);
358
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);
359
- const columnMetaencodedStrings = createColumnMetadataForStruct("invalid", [
360
- { name: "field1", type: ScalarType.INT_32 },
361
- ]);
362
- expect(() => {
363
- decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 1);
364
- }).toThrow("Currently only optional string fields are implemented for a struct.");
365
- });
366
- });
367
- describe("offset tracking", () => {
368
- it("should correctly advance offset through all streams", () => {
369
- const dictionaryStrings = ["a", "b", "c"];
370
- const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);
371
- const field1Streams = encodeStructField([0, 1], [true, true]);
372
- const field2Streams = encodeStructField([1, 2], [true, true]);
373
- const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, field1Streams, field2Streams);
374
- const columnMetaencodedStrings = createColumnMetadataForStruct("track", [
375
- { name: "field1" },
376
- { name: "field2" },
377
- ]);
378
- const offset = new IntWrapper(0);
379
- const initialOffset = offset.get();
380
- const result = decodeSharedDictionary(completeencodedStrings, offset, columnMetaencodedStrings, 2);
381
- expect(result).toHaveLength(2);
382
- expect(offset.get()).toBeGreaterThan(initialOffset);
383
- expect(offset.get()).toBe(completeencodedStrings.length);
384
- });
385
- });
386
- });
387
- //# sourceMappingURL=stringDecoder.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stringDecoder.spec.js","sourceRoot":"","sources":["../../src/decoding/stringDecoder.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EACH,kBAAkB,EAClB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;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,GAAG,sBAAsB,CAAC,sBAAsB,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAC,CAAC,CAAC;YAEnG,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;YACpD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport IntWrapper from \"./intWrapper\";\nimport { decodeString, decodeSharedDictionary } from \"./stringDecoder\";\nimport { encodePlainStrings, encodeDictionaryStrings } from \"../encoding/stringEncoder\";\nimport {\n concatenateBuffers,\n createColumnMetadataForStruct,\n createStream,\n encodeFsstStrings,\n encodeSharedDictionary,\n encodeStructField,\n} from \"./decodingTestUtils\";\nimport { StringFlatVector } from \"../vector/flat/stringFlatVector\";\nimport { StringDictionaryVector } from \"../vector/dictionary/stringDictionaryVector\";\nimport { StringFsstDictionaryVector } from \"../vector/fsst-dictionary/stringFsstDictionaryVector\";\nimport { ScalarType } from \"../metadata/tileset/tilesetMetadata\";\nimport { PhysicalStreamType } from \"../metadata/tile/physicalStreamType\";\nimport { LengthType } from \"../metadata/tile/lengthType\";\nimport { LogicalStreamType } from \"../metadata/tile/logicalStreamType\";\n\ndescribe(\"decodeString - Plain String Decoder\", () => {\n it(\"should decode plain strings with simple ASCII values\", () => {\n const expectedStrings = [\"hello\", \"world\", \"test\"];\n const encodedStrings = encodePlainStrings(expectedStrings);\n const offset = new IntWrapper(0);\n\n const result = decodeString(\"testColumn\", encodedStrings, offset, 2);\n\n expect(result).toBeInstanceOf(StringFlatVector);\n const resultVec = result as StringFlatVector;\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(resultVec.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n\n it(\"should decode plain strings with varying lengths\", () => {\n const expectedStrings = [\"a\", \"abc\", \"hello world\"];\n const encodedStrings = encodePlainStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 2);\n\n const resultVec = result as StringFlatVector;\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(resultVec.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n\n it(\"should decode plain strings with empty strings\", () => {\n const expectedStrings = [\"\", \"encodedStrings\", \"\", \"more\"];\n const encodedStrings = encodePlainStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 2);\n\n expect(result).toBeInstanceOf(StringFlatVector);\n const resultVec = result as StringFlatVector;\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(resultVec.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n\n it(\"should decode mixed null and empty strings\", () => {\n const expectedStrings = [null, \"\", \"encodedStrings\", null, \"\"];\n const encodedStrings = encodePlainStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 3);\n\n expect(result).not.toBeNull();\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(result.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n\n it(\"should decode mixed ASCII and UTF-8 strings\", () => {\n const expectedStrings = [\"hello\", \"Привет\", \"world\", \"日本\"];\n const encodedStrings = encodePlainStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 2);\n\n expect(result).toBeInstanceOf(StringFlatVector);\n const resultVec = result as StringFlatVector;\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(resultVec.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n});\n\ndescribe(\"decodeString - Dictionary String Decoder\", () => {\n it(\"should decode dictionary-compressed strings with repeated values\", () => {\n const expectedStrings = [\"cat\", \"dog\", \"cat\", \"cat\", \"dog\"];\n const encodedStrings = encodeDictionaryStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 3);\n\n expect(result).toBeInstanceOf(StringDictionaryVector);\n const resultVec = result as StringDictionaryVector;\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(resultVec.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n\n it(\"should decode dictionary with single repeated string\", () => {\n const expectedStrings = [\"same\", \"same\", \"same\"];\n const encodedStrings = encodeDictionaryStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 3);\n\n expect(result).toBeInstanceOf(StringDictionaryVector);\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(result.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n\n it(\"should decode dictionary with UTF-8 strings\", () => {\n const expectedStrings = [\"café\", \"日本\", \"café\", \"日本\"];\n const encodedStrings = encodeDictionaryStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 3);\n\n expect(result).toBeInstanceOf(StringDictionaryVector);\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(result.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n\n it(\"should decode dictionary with all unique strings\", () => {\n const expectedStrings = [\"unique1\", \"unique2\", \"unique3\", \"unique4\"];\n const encodedStrings = encodeDictionaryStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 3);\n\n expect(result).toBeInstanceOf(StringDictionaryVector);\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(result.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n\n it(\"should decode nullable dictionary strings\", () => {\n const expectedStrings = [null, \"\", \"encodedStrings\", \"\", null];\n const encodedStrings = encodeDictionaryStrings(expectedStrings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 4);\n\n expect(result).toBeInstanceOf(StringDictionaryVector);\n for (let i = 0; i < expectedStrings.length; i++) {\n expect(result.getValue(i)).toBe(expectedStrings[i]);\n }\n });\n});\n\ndescribe(\"decodeString - FSST Dictionary Decoder (Basic Coverage)\", () => {\n it(\"should decode FSST-compressed strings with simple symbol table\", () => {\n const encodedStrings = encodeFsstStrings();\n const offset = new IntWrapper(0);\n\n const result = decodeString(\"testColumn\", encodedStrings, offset, 6);\n\n expect(result).toBeInstanceOf(StringFsstDictionaryVector);\n const resultVec = result as StringFsstDictionaryVector;\n\n const expectedValues = [\"cat\", \"dog\", \"cat\"];\n for (let i = 0; i < expectedValues.length; i++) {\n expect(resultVec.getValue(i)).toBe(expectedValues[i]);\n }\n });\n});\n\ndescribe(\"decodeString - Empty Column Edge Cases\", () => {\n it(\"should handle empty column with numStreams = 0 (returns null)\", () => {\n const fullStream = new Uint8Array([]);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", fullStream, offset, 0);\n expect(result).toBeNull();\n });\n\n it(\"should handle column with all zero-length streams (returns null)\", () => {\n const emptyStream = createStream(PhysicalStreamType.LENGTH, new Uint8Array([]), {\n logical: new LogicalStreamType(undefined, undefined, LengthType.VAR_BINARY),\n });\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", emptyStream, offset, 1);\n expect(result).toBeNull();\n });\n\n it(\"should handle single value plain string column\", () => {\n const strings = [\"single\"];\n const encodedStrings = encodePlainStrings(strings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 2);\n\n expect(result).toBeInstanceOf(StringFlatVector);\n expect((result as StringFlatVector).getValue(0)).toBe(\"single\");\n });\n\n it(\"should handle single null value in plain string column (returns null)\", () => {\n const strings = [null];\n const encodedStrings = encodePlainStrings(strings);\n const offset = new IntWrapper(0);\n const result = decodeString(\"testColumn\", encodedStrings, offset, 3);\n expect(result).toBeNull();\n });\n});\n\ndescribe(\"decodeString - Integration Tests\", () => {\n it(\"should correctly track offset through multiple streams\", () => {\n const strings = [\"hello\", \"world\"];\n const encodedStrings = encodePlainStrings(strings);\n const offset = new IntWrapper(0);\n const initialOffset = offset.get();\n\n const result = decodeString(\"testColumn\", encodedStrings, offset, 2);\n\n expect(result).toBeInstanceOf(StringFlatVector);\n expect(offset.get()).toBeGreaterThan(initialOffset);\n expect(offset.get()).toBe(encodedStrings.length);\n });\n\n it(\"should correctly track offset through nullable streams\", () => {\n const strings = [\"test\", null, \"encodedStrings\"];\n const encodedStrings = encodePlainStrings(strings);\n const offset = new IntWrapper(0);\n const initialOffset = offset.get();\n\n const result = decodeString(\"testColumn\", encodedStrings, offset, 3);\n\n expect(result).not.toBeNull();\n expect(offset.get()).toBeGreaterThan(initialOffset);\n expect(offset.get()).toBe(encodedStrings.length);\n });\n\n it(\"should correctly track offset through FSST dictionary streams\", () => {\n const encodedStrings = encodeFsstStrings();\n const offset = new IntWrapper(0);\n const initialOffset = offset.get();\n\n const result = decodeString(\"testColumn\", encodedStrings, offset, 6);\n\n expect(result).toBeInstanceOf(StringFsstDictionaryVector);\n expect(offset.get()).toBeGreaterThan(initialOffset);\n expect(offset.get()).toBe(encodedStrings.length);\n });\n\n it(\"should handle consecutive decoding operations with shared offset tracker\", () => {\n const stream1 = encodePlainStrings([\"first\"]);\n const stream2 = encodePlainStrings([\"second\"]);\n const combinedStream = concatenateBuffers(stream1, stream2);\n\n const offset = new IntWrapper(0);\n\n const result1 = decodeString(\"column1\", combinedStream, offset, 2);\n expect((result1 as StringFlatVector).getValue(0)).toBe(\"first\");\n\n const offsetAfterFirst = offset.get();\n\n const result2 = decodeString(\"column2\", combinedStream, offset, 2);\n expect((result2 as StringFlatVector).getValue(0)).toBe(\"second\");\n\n expect(offset.get()).toBeGreaterThan(offsetAfterFirst);\n expect(offset.get()).toBe(combinedStream.length);\n });\n});\n\ndescribe(\"decodeSharedDictionary\", () => {\n describe(\"basic functionality\", () => {\n it(\"should decode single field with shared dictionary\", () => {\n const dictionaryStrings = [\"apple\", \"banana\", \"peach\", \"date\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n\n const fieldStreams = encodeStructField([0, 1, 2, 3], [true, true, true, true]);\n const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"address\", [{ name: \"street\" }]);\n\n const result = decodeSharedDictionary(\n completeencodedStrings,\n new IntWrapper(0),\n columnMetaencodedStrings,\n 4,\n );\n\n expect(result).toHaveLength(1);\n expect(result[0]).toBeInstanceOf(StringDictionaryVector);\n expect(result[0].name).toBe(\"address:street\");\n for (let i = 0; i < dictionaryStrings.length; i++) {\n expect(result[0].getValue(i)).toBe(dictionaryStrings[i]);\n }\n });\n\n it(\"should handle empty child field name (common prefix stripped)\", () => {\n const dictionaryStrings = [\"Berlin\", \"London\", \"Paris\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n\n const fieldStreams = encodeStructField([0, 1, 2], [true, true, true]);\n const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);\n\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"name\", [{ name: \"\" }]);\n\n const result = decodeSharedDictionary(\n completeencodedStrings,\n new IntWrapper(0),\n columnMetaencodedStrings,\n 3,\n );\n\n expect(result).toHaveLength(1);\n expect(result[0].name).toBe(\"name\");\n for (let i = 0; i < dictionaryStrings.length; i++) {\n expect(result[0].getValue(i)).toBe(dictionaryStrings[i]);\n }\n });\n\n it(\"should handle mix of empty and delimited child names\", () => {\n const dict = [\"value1\", \"value2\", \"value3\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dict);\n\n const field1 = encodeStructField([0], [true]);\n const field2 = encodeStructField([1], [true]);\n const field3 = encodeStructField([2], [true]);\n\n const complete = concatenateBuffers(lengthStream, dataStream, field1, field2, field3);\n const metadata = createColumnMetadataForStruct(\"name\", [\n { name: \"\" },\n { name: \":en\" },\n { name: \":de\" },\n ]);\n\n const result = decodeSharedDictionary(complete, new IntWrapper(0), metadata, 1);\n\n expect(result).toHaveLength(3);\n expect(result[0].name).toBe(\"name\");\n expect(result[1].name).toBe(\"name:en\");\n expect(result[2].name).toBe(\"name:de\");\n });\n });\n\n describe(\"nullability\", () => {\n it(\"should handle nullable fields with PRESENT stream\", () => {\n const dictionaryStrings = [\"red\", \"green\", \"blue\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n\n const fieldStreams = encodeStructField([0, 2], [true, false, true, false]);\n const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"colors\", [{ name: \"primary\" }]);\n\n const result = decodeSharedDictionary(\n completeencodedStrings,\n new IntWrapper(0),\n columnMetaencodedStrings,\n 4,\n );\n\n expect(result).toHaveLength(1);\n const expected = [\"red\", null, \"blue\", null];\n for (let i = 0; i < expected.length; i++) {\n expect(result[0].getValue(i)).toBe(expected[i]);\n }\n });\n\n it(\"should detect nullable fields when offsetCount < numFeatures\", () => {\n const dictionaryStrings = [\"alpha\", \"beta\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n\n // Simulating implicit nullability by mismatched counts\n const fieldStreams = encodeStructField([0, 1], [true, false, false, true]);\n const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"greek\", [{ name: \"letter\" }]);\n\n const result = decodeSharedDictionary(\n completeencodedStrings,\n new IntWrapper(0),\n columnMetaencodedStrings,\n 4,\n );\n\n expect(result).toHaveLength(1);\n const expected = [\"alpha\", null, null, \"beta\"];\n for (let i = 0; i < expected.length; i++) {\n expect(result[0].getValue(i)).toBe(expected[i]);\n }\n });\n });\n\n describe(\"FSST encoding\", () => {\n it(\"should decode FSST-compressed shared dictionary\", () => {\n const dictionaryStrings = [\"compressed1\", \"compressed2\"];\n const { lengthStream, dataStream, symbolLengthStream, symbolDataStream } = encodeSharedDictionary(\n dictionaryStrings,\n { useFsst: true },\n );\n\n const fieldStreams = encodeStructField([0, 1], [true, true]);\n const completeencodedStrings = concatenateBuffers(\n lengthStream,\n symbolLengthStream,\n symbolDataStream,\n dataStream,\n fieldStreams,\n );\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"encodedStrings\", [{ name: \"value\" }]);\n\n const result = decodeSharedDictionary(\n completeencodedStrings,\n new IntWrapper(0),\n columnMetaencodedStrings,\n 2,\n );\n\n expect(result).toHaveLength(1);\n expect(result[0]).toBeInstanceOf(StringFsstDictionaryVector);\n expect(result[0].name).toBe(\"encodedStrings:value\");\n });\n });\n\n describe(\"field filtering\", () => {\n it(\"should filter fields by propertyColumnNames\", () => {\n const dictionaryStrings = [\"val1\", \"val2\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n\n const field1Streams = encodeStructField([0], [true]);\n const field2Streams = encodeStructField([1], [true]);\n const field3Streams = encodeStructField([0], [true]);\n\n const completeencodedStrings = concatenateBuffers(\n lengthStream,\n dataStream,\n field1Streams,\n field2Streams,\n field3Streams,\n );\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"multi\", [\n { name: \"field1\" },\n { name: \"field2\" },\n { name: \"field3\" },\n ]);\n\n const propertyColumnNames = new Set([\"multi:field1\", \"multi:field3\"]);\n const result = decodeSharedDictionary(\n completeencodedStrings,\n new IntWrapper(0),\n columnMetaencodedStrings,\n 1,\n propertyColumnNames,\n );\n\n expect(result).toHaveLength(2);\n expect(result[0].name).toBe(\"multi:field1\");\n expect(result[1].name).toBe(\"multi:field3\");\n });\n\n it(\"should skip fields with numStreams=0\", () => {\n const dictionaryStrings = [\"present\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n\n const field1Streams = encodeStructField([0], [true], true);\n const field2Streams = encodeStructField([], [], false); // numStreams=0\n const field3Streams = encodeStructField([0], [true], true);\n\n const completeencodedStrings = concatenateBuffers(\n lengthStream,\n dataStream,\n field1Streams,\n field2Streams,\n field3Streams,\n );\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"test\", [\n { name: \"field1\" },\n { name: \"field2\" },\n { name: \"field3\" },\n ]);\n\n const result = decodeSharedDictionary(\n completeencodedStrings,\n new IntWrapper(0),\n columnMetaencodedStrings,\n 1,\n );\n\n expect(result).toHaveLength(2);\n expect(result[0].name).toBe(\"test:field1\");\n expect(result[1].name).toBe(\"test:field3\");\n });\n\n it(\"should handle mixed present and filtered fields\", () => {\n const dictionaryStrings = [\"encodedStrings\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n\n const field1Streams = encodeStructField([0], [true], true);\n const field2Streams = encodeStructField([], [], false);\n const field3Streams = encodeStructField([0], [true], true);\n\n const completeencodedStrings = concatenateBuffers(\n lengthStream,\n dataStream,\n field1Streams,\n field2Streams,\n field3Streams,\n );\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"mixed\", [\n { name: \"field1\" },\n { name: \"field2\" },\n { name: \"field3\" },\n ]);\n\n const propertyColumnNames = new Set([\"mixed:field3\"]);\n const result = decodeSharedDictionary(\n completeencodedStrings,\n new IntWrapper(0),\n columnMetaencodedStrings,\n 1,\n propertyColumnNames,\n );\n\n expect(result).toHaveLength(1);\n expect(result[0].name).toBe(\"mixed:field3\");\n });\n });\n\n describe(\"error handling\", () => {\n it(\"should throw error for non-string field types\", () => {\n const dictionaryStrings = [\"value\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n const fieldStreams = encodeStructField([0], [true]);\n const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, fieldStreams);\n\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"invalid\", [\n { name: \"field1\", type: ScalarType.INT_32 },\n ]);\n\n expect(() => {\n decodeSharedDictionary(completeencodedStrings, new IntWrapper(0), columnMetaencodedStrings, 1);\n }).toThrow(\"Currently only optional string fields are implemented for a struct.\");\n });\n });\n\n describe(\"offset tracking\", () => {\n it(\"should correctly advance offset through all streams\", () => {\n const dictionaryStrings = [\"a\", \"b\", \"c\"];\n const { lengthStream, dataStream } = encodeSharedDictionary(dictionaryStrings);\n\n const field1Streams = encodeStructField([0, 1], [true, true]);\n const field2Streams = encodeStructField([1, 2], [true, true]);\n\n const completeencodedStrings = concatenateBuffers(lengthStream, dataStream, field1Streams, field2Streams);\n const columnMetaencodedStrings = createColumnMetadataForStruct(\"track\", [\n { name: \"field1\" },\n { name: \"field2\" },\n ]);\n\n const offset = new IntWrapper(0);\n const initialOffset = offset.get();\n const result = decodeSharedDictionary(completeencodedStrings, offset, columnMetaencodedStrings, 2);\n\n expect(result).toHaveLength(2);\n expect(offset.get()).toBeGreaterThan(initialOffset);\n expect(offset.get()).toBe(completeencodedStrings.length);\n });\n });\n});\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,71 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { unpackNullable, unpackNullableBoolean } from "./unpackNullableUtils";
3
- import BitVector from "../vector/flat/bitVector";
4
- import { packNullable, packNullableBoolean } from "../encoding/packNullableUtils";
5
- describe("unpackNullableUtils", () => {
6
- describe("unpackNullable", () => {
7
- it("should return the original array when presentBits is null", () => {
8
- const dataStream = new Int32Array([1, 2, 3]);
9
- const packed = packNullable(dataStream, null);
10
- const result = unpackNullable(packed, null, 0);
11
- expect(result).toBe(dataStream);
12
- expect(result).toEqual(new Int32Array([1, 2, 3]));
13
- });
14
- it("should return the original array when presentBits is undefined", () => {
15
- const dataStream = new Float32Array([1.5, 2.5, 3.5]);
16
- const result = unpackNullable(dataStream, undefined, 0);
17
- expect(result).toBe(dataStream);
18
- expect(result).toEqual(new Float32Array([1.5, 2.5, 3.5]));
19
- });
20
- it("should return the original BigInt64Array when presentBits is null", () => {
21
- const dataStream = new BigInt64Array([10n, 20n, 30n]);
22
- const result = unpackNullable(dataStream, null, 0n);
23
- expect(result).toBe(dataStream);
24
- expect(result).toEqual(new BigInt64Array([10n, 20n, 30n]));
25
- });
26
- it("should return the original array when presentBits is fully set", () => {
27
- const dataStream = new BigInt64Array([10n, 20n, 30n]);
28
- const presentBits = new BitVector(new Uint8Array([0b111]), 3);
29
- const packed = packNullable(dataStream, presentBits);
30
- const result = unpackNullable(packed, presentBits, 0n);
31
- expect(result).toEqual(new BigInt64Array([10n, 20n, 30n]));
32
- });
33
- it("should return partial array when presentBits is partially set", () => {
34
- const dataStream = new Int32Array([0, 20, 30]); // first number is "null"
35
- const presentBits = new BitVector(new Uint8Array([0b110]), 3);
36
- const packed = packNullable(dataStream, presentBits);
37
- const result = unpackNullable(packed, presentBits, 0);
38
- expect(result).toEqual(new Int32Array([0, 20, 30]));
39
- });
40
- });
41
- describe("unpackNullableBoolean", () => {
42
- it("should return the original array when presentBits is null", () => {
43
- const dataStream = new Uint8Array([0b11010101]);
44
- const packed = packNullableBoolean(dataStream, 8, null);
45
- const result = unpackNullableBoolean(packed, 8, null);
46
- expect(result).toBe(dataStream);
47
- expect(result).toEqual(new Uint8Array([0b11010101]));
48
- });
49
- it("should return the original array when presentBits is undefined", () => {
50
- const dataStream = new Uint8Array([0b00001111]);
51
- const result = unpackNullableBoolean(dataStream, 8, undefined);
52
- expect(result).toBe(dataStream);
53
- expect(result).toEqual(new Uint8Array([0b00001111]));
54
- });
55
- it("should return the original array when presentBits is fully set", () => {
56
- const dataStream = new Uint8Array([0b11010101]);
57
- const presentBits = new BitVector(new Uint8Array([0b11111111]), 8);
58
- const packed = packNullableBoolean(dataStream, 8, presentBits);
59
- const result = unpackNullableBoolean(packed, 8, presentBits);
60
- expect(result).toEqual(new Uint8Array([0b11010101]));
61
- });
62
- it("should return partial array when presentBits is partially set", () => {
63
- const dataStream = new Uint8Array([0b11111111]);
64
- const presentBits = new BitVector(new Uint8Array([0b11110000]), 8);
65
- const packed = packNullableBoolean(dataStream, 8, presentBits);
66
- const result = unpackNullableBoolean(packed, 8, presentBits);
67
- expect(result).toEqual(new Uint8Array([0b11110000]));
68
- });
69
- });
70
- });
71
- //# sourceMappingURL=unpackNullableUtils.spec.js.map
@@ -1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C,CAAC","sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { unpackNullable, unpackNullableBoolean } from \"./unpackNullableUtils\";\nimport BitVector from \"../vector/flat/bitVector\";\nimport { packNullable, packNullableBoolean } from \"../encoding/packNullableUtils\";\n\ndescribe(\"unpackNullableUtils\", () => {\n describe(\"unpackNullable\", () => {\n it(\"should return the original array when presentBits is null\", () => {\n const dataStream = new Int32Array([1, 2, 3]);\n const packed = packNullable(dataStream, null);\n const result = unpackNullable(packed, null, 0);\n\n expect(result).toBe(dataStream);\n expect(result).toEqual(new Int32Array([1, 2, 3]));\n });\n\n it(\"should return the original array when presentBits is undefined\", () => {\n const dataStream = new Float32Array([1.5, 2.5, 3.5]);\n const result = unpackNullable(dataStream, undefined, 0);\n\n expect(result).toBe(dataStream);\n expect(result).toEqual(new Float32Array([1.5, 2.5, 3.5]));\n });\n\n it(\"should return the original BigInt64Array when presentBits is null\", () => {\n const dataStream = new BigInt64Array([10n, 20n, 30n]);\n const result = unpackNullable(dataStream, null, 0n);\n\n expect(result).toBe(dataStream);\n expect(result).toEqual(new BigInt64Array([10n, 20n, 30n]));\n });\n\n it(\"should return the original array when presentBits is fully set\", () => {\n const dataStream = new BigInt64Array([10n, 20n, 30n]);\n const presentBits = new BitVector(new Uint8Array([0b111]), 3);\n const packed = packNullable(dataStream, presentBits);\n const result = unpackNullable(packed, presentBits, 0n);\n\n expect(result).toEqual(new BigInt64Array([10n, 20n, 30n]));\n });\n\n it(\"should return partial array when presentBits is partially set\", () => {\n const dataStream = new Int32Array([0, 20, 30]); // first number is \"null\"\n const presentBits = new BitVector(new Uint8Array([0b110]), 3);\n const packed = packNullable(dataStream, presentBits);\n const result = unpackNullable(packed, presentBits, 0);\n\n expect(result).toEqual(new Int32Array([0, 20, 30]));\n });\n });\n\n describe(\"unpackNullableBoolean\", () => {\n it(\"should return the original array when presentBits is null\", () => {\n const dataStream = new Uint8Array([0b11010101]);\n const packed = packNullableBoolean(dataStream, 8, null);\n const result = unpackNullableBoolean(packed, 8, null);\n\n expect(result).toBe(dataStream);\n expect(result).toEqual(new Uint8Array([0b11010101]));\n });\n\n it(\"should return the original array when presentBits is undefined\", () => {\n const dataStream = new Uint8Array([0b00001111]);\n const result = unpackNullableBoolean(dataStream, 8, undefined);\n\n expect(result).toBe(dataStream);\n expect(result).toEqual(new Uint8Array([0b00001111]));\n });\n\n it(\"should return the original array when presentBits is fully set\", () => {\n const dataStream = new Uint8Array([0b11010101]);\n const presentBits = new BitVector(new Uint8Array([0b11111111]), 8);\n const packed = packNullableBoolean(dataStream, 8, presentBits);\n const result = unpackNullableBoolean(packed, 8, presentBits);\n\n expect(result).toEqual(new Uint8Array([0b11010101]));\n });\n\n it(\"should return partial array when presentBits is partially set\", () => {\n const dataStream = new Uint8Array([0b11111111]);\n const presentBits = new BitVector(new Uint8Array([0b11110000]), 8);\n const packed = packNullableBoolean(dataStream, 8, presentBits);\n const result = unpackNullableBoolean(packed, 8, presentBits);\n\n expect(result).toEqual(new Uint8Array([0b11110000]));\n });\n });\n});\n"]}