@loaders.gl/parquet 4.2.0-alpha.4 → 4.2.0-alpha.5

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 (265) hide show
  1. package/dist/index.cjs +269 -616
  2. package/dist/index.cjs.map +7 -0
  3. package/dist/index.d.ts +12 -12
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +6 -1
  6. package/dist/lib/arrow/convert-columns-to-row-group.js +1 -2
  7. package/dist/lib/arrow/convert-row-group-to-columns.js +8 -6
  8. package/dist/lib/arrow/convert-schema-from-parquet.d.ts +3 -3
  9. package/dist/lib/arrow/convert-schema-from-parquet.d.ts.map +1 -1
  10. package/dist/lib/arrow/convert-schema-from-parquet.js +71 -82
  11. package/dist/lib/arrow/convert-schema-to-parquet.d.ts +1 -1
  12. package/dist/lib/arrow/convert-schema-to-parquet.d.ts.map +1 -1
  13. package/dist/lib/arrow/convert-schema-to-parquet.js +65 -35
  14. package/dist/lib/constants.js +14 -1
  15. package/dist/lib/parsers/get-parquet-schema.d.ts +1 -1
  16. package/dist/lib/parsers/get-parquet-schema.d.ts.map +1 -1
  17. package/dist/lib/parsers/get-parquet-schema.js +9 -7
  18. package/dist/lib/parsers/parse-geoparquet.d.ts +1 -1
  19. package/dist/lib/parsers/parse-geoparquet.d.ts.map +1 -1
  20. package/dist/lib/parsers/parse-geoparquet.js +47 -45
  21. package/dist/lib/parsers/parse-parquet-to-columns.d.ts +1 -1
  22. package/dist/lib/parsers/parse-parquet-to-columns.d.ts.map +1 -1
  23. package/dist/lib/parsers/parse-parquet-to-columns.js +36 -25
  24. package/dist/lib/parsers/parse-parquet.d.ts +1 -1
  25. package/dist/lib/parsers/parse-parquet.d.ts.map +1 -1
  26. package/dist/lib/parsers/parse-parquet.js +62 -50
  27. package/dist/lib/wasm/encode-parquet-wasm.d.ts +1 -1
  28. package/dist/lib/wasm/encode-parquet-wasm.d.ts.map +1 -1
  29. package/dist/lib/wasm/encode-parquet-wasm.js +49 -12
  30. package/dist/lib/wasm/load-wasm.js +13 -10
  31. package/dist/lib/wasm/parse-parquet-wasm.d.ts +1 -1
  32. package/dist/lib/wasm/parse-parquet-wasm.d.ts.map +1 -1
  33. package/dist/lib/wasm/parse-parquet-wasm.js +19 -15
  34. package/dist/parquet-loader.d.ts +1 -1
  35. package/dist/parquet-loader.d.ts.map +1 -1
  36. package/dist/parquet-loader.js +77 -64
  37. package/dist/parquet-wasm-loader.js +25 -28
  38. package/dist/parquet-wasm-writer.js +19 -23
  39. package/dist/parquet-writer.js +16 -12
  40. package/dist/parquetjs/codecs/declare.d.ts +1 -1
  41. package/dist/parquetjs/codecs/declare.d.ts.map +1 -1
  42. package/dist/parquetjs/codecs/declare.js +0 -1
  43. package/dist/parquetjs/codecs/dictionary.js +4 -8
  44. package/dist/parquetjs/codecs/index.d.ts +3 -3
  45. package/dist/parquetjs/codecs/index.d.ts.map +1 -1
  46. package/dist/parquetjs/codecs/index.js +20 -17
  47. package/dist/parquetjs/codecs/plain.d.ts +2 -2
  48. package/dist/parquetjs/codecs/plain.d.ts.map +1 -1
  49. package/dist/parquetjs/codecs/plain.js +166 -162
  50. package/dist/parquetjs/codecs/rle.d.ts +2 -2
  51. package/dist/parquetjs/codecs/rle.d.ts.map +1 -1
  52. package/dist/parquetjs/codecs/rle.js +124 -105
  53. package/dist/parquetjs/compression.d.ts +1 -1
  54. package/dist/parquetjs/compression.d.ts.map +1 -1
  55. package/dist/parquetjs/compression.js +157 -43
  56. package/dist/parquetjs/encoder/parquet-encoder.d.ts +3 -3
  57. package/dist/parquetjs/encoder/parquet-encoder.d.ts.map +1 -1
  58. package/dist/parquetjs/encoder/parquet-encoder.js +406 -275
  59. package/dist/parquetjs/parquet-thrift/BoundaryOrder.js +12 -7
  60. package/dist/parquetjs/parquet-thrift/BsonType.js +31 -27
  61. package/dist/parquetjs/parquet-thrift/ColumnChunk.d.ts +1 -1
  62. package/dist/parquetjs/parquet-thrift/ColumnChunk.d.ts.map +1 -1
  63. package/dist/parquetjs/parquet-thrift/ColumnChunk.js +175 -166
  64. package/dist/parquetjs/parquet-thrift/ColumnIndex.d.ts +1 -1
  65. package/dist/parquetjs/parquet-thrift/ColumnIndex.d.ts.map +1 -1
  66. package/dist/parquetjs/parquet-thrift/ColumnIndex.js +178 -166
  67. package/dist/parquetjs/parquet-thrift/ColumnMetaData.d.ts +6 -6
  68. package/dist/parquetjs/parquet-thrift/ColumnMetaData.d.ts.map +1 -1
  69. package/dist/parquetjs/parquet-thrift/ColumnMetaData.js +359 -333
  70. package/dist/parquetjs/parquet-thrift/ColumnOrder.d.ts +1 -1
  71. package/dist/parquetjs/parquet-thrift/ColumnOrder.d.ts.map +1 -1
  72. package/dist/parquetjs/parquet-thrift/ColumnOrder.js +73 -68
  73. package/dist/parquetjs/parquet-thrift/CompressionCodec.js +17 -12
  74. package/dist/parquetjs/parquet-thrift/ConvertedType.js +31 -26
  75. package/dist/parquetjs/parquet-thrift/DataPageHeader.d.ts +2 -2
  76. package/dist/parquetjs/parquet-thrift/DataPageHeader.d.ts.map +1 -1
  77. package/dist/parquetjs/parquet-thrift/DataPageHeader.js +136 -124
  78. package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts +2 -2
  79. package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts.map +1 -1
  80. package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.js +198 -181
  81. package/dist/parquetjs/parquet-thrift/DateType.js +31 -27
  82. package/dist/parquetjs/parquet-thrift/DecimalType.js +76 -69
  83. package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts +1 -1
  84. package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts.map +1 -1
  85. package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.js +93 -86
  86. package/dist/parquetjs/parquet-thrift/Encoding.js +17 -12
  87. package/dist/parquetjs/parquet-thrift/EnumType.js +31 -27
  88. package/dist/parquetjs/parquet-thrift/FieldRepetitionType.js +12 -7
  89. package/dist/parquetjs/parquet-thrift/FileMetaData.d.ts +4 -4
  90. package/dist/parquetjs/parquet-thrift/FileMetaData.d.ts.map +1 -1
  91. package/dist/parquetjs/parquet-thrift/FileMetaData.js +217 -205
  92. package/dist/parquetjs/parquet-thrift/IndexPageHeader.js +31 -27
  93. package/dist/parquetjs/parquet-thrift/IntType.js +76 -69
  94. package/dist/parquetjs/parquet-thrift/JsonType.js +31 -27
  95. package/dist/parquetjs/parquet-thrift/KeyValue.js +73 -67
  96. package/dist/parquetjs/parquet-thrift/ListType.js +31 -27
  97. package/dist/parquetjs/parquet-thrift/LogicalType.d.ts +13 -13
  98. package/dist/parquetjs/parquet-thrift/LogicalType.d.ts.map +1 -1
  99. package/dist/parquetjs/parquet-thrift/LogicalType.js +325 -344
  100. package/dist/parquetjs/parquet-thrift/MapType.js +31 -27
  101. package/dist/parquetjs/parquet-thrift/MicroSeconds.js +31 -27
  102. package/dist/parquetjs/parquet-thrift/MilliSeconds.js +31 -27
  103. package/dist/parquetjs/parquet-thrift/NullType.js +31 -27
  104. package/dist/parquetjs/parquet-thrift/OffsetIndex.d.ts +1 -1
  105. package/dist/parquetjs/parquet-thrift/OffsetIndex.d.ts.map +1 -1
  106. package/dist/parquetjs/parquet-thrift/OffsetIndex.js +66 -60
  107. package/dist/parquetjs/parquet-thrift/PageEncodingStats.d.ts +2 -2
  108. package/dist/parquetjs/parquet-thrift/PageEncodingStats.d.ts.map +1 -1
  109. package/dist/parquetjs/parquet-thrift/PageEncodingStats.js +98 -88
  110. package/dist/parquetjs/parquet-thrift/PageHeader.d.ts +5 -5
  111. package/dist/parquetjs/parquet-thrift/PageHeader.d.ts.map +1 -1
  112. package/dist/parquetjs/parquet-thrift/PageHeader.js +185 -175
  113. package/dist/parquetjs/parquet-thrift/PageLocation.js +108 -96
  114. package/dist/parquetjs/parquet-thrift/PageType.js +13 -8
  115. package/dist/parquetjs/parquet-thrift/RowGroup.d.ts +2 -2
  116. package/dist/parquetjs/parquet-thrift/RowGroup.d.ts.map +1 -1
  117. package/dist/parquetjs/parquet-thrift/RowGroup.js +145 -133
  118. package/dist/parquetjs/parquet-thrift/SchemaElement.d.ts +4 -4
  119. package/dist/parquetjs/parquet-thrift/SchemaElement.d.ts.map +1 -1
  120. package/dist/parquetjs/parquet-thrift/SchemaElement.js +211 -205
  121. package/dist/parquetjs/parquet-thrift/SortingColumn.js +98 -88
  122. package/dist/parquetjs/parquet-thrift/Statistics.js +143 -137
  123. package/dist/parquetjs/parquet-thrift/StringType.js +31 -27
  124. package/dist/parquetjs/parquet-thrift/TimeType.d.ts +1 -1
  125. package/dist/parquetjs/parquet-thrift/TimeType.d.ts.map +1 -1
  126. package/dist/parquetjs/parquet-thrift/TimeType.js +76 -69
  127. package/dist/parquetjs/parquet-thrift/TimeUnit.d.ts +2 -2
  128. package/dist/parquetjs/parquet-thrift/TimeUnit.d.ts.map +1 -1
  129. package/dist/parquetjs/parquet-thrift/TimeUnit.js +94 -91
  130. package/dist/parquetjs/parquet-thrift/TimestampType.d.ts +1 -1
  131. package/dist/parquetjs/parquet-thrift/TimestampType.d.ts.map +1 -1
  132. package/dist/parquetjs/parquet-thrift/TimestampType.js +76 -69
  133. package/dist/parquetjs/parquet-thrift/Type.js +17 -12
  134. package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.js +31 -27
  135. package/dist/parquetjs/parquet-thrift/UUIDType.js +31 -27
  136. package/dist/parquetjs/parquet-thrift/index.d.ts +44 -44
  137. package/dist/parquetjs/parquet-thrift/index.d.ts.map +1 -1
  138. package/dist/parquetjs/parquet-thrift/index.js +6 -1
  139. package/dist/parquetjs/parser/decoders.d.ts +3 -3
  140. package/dist/parquetjs/parser/decoders.d.ts.map +1 -1
  141. package/dist/parquetjs/parser/decoders.js +306 -242
  142. package/dist/parquetjs/parser/parquet-reader.d.ts +3 -3
  143. package/dist/parquetjs/parser/parquet-reader.d.ts.map +1 -1
  144. package/dist/parquetjs/parser/parquet-reader.js +179 -157
  145. package/dist/parquetjs/schema/declare.d.ts +1 -1
  146. package/dist/parquetjs/schema/declare.d.ts.map +1 -1
  147. package/dist/parquetjs/schema/declare.js +6 -9
  148. package/dist/parquetjs/schema/schema.d.ts +1 -1
  149. package/dist/parquetjs/schema/schema.d.ts.map +1 -1
  150. package/dist/parquetjs/schema/schema.js +139 -120
  151. package/dist/parquetjs/schema/shred.d.ts +2 -2
  152. package/dist/parquetjs/schema/shred.d.ts.map +1 -1
  153. package/dist/parquetjs/schema/shred.js +301 -204
  154. package/dist/parquetjs/schema/types.d.ts +1 -1
  155. package/dist/parquetjs/schema/types.d.ts.map +1 -1
  156. package/dist/parquetjs/schema/types.js +328 -314
  157. package/dist/parquetjs/utils/file-utils.js +24 -23
  158. package/dist/parquetjs/utils/read-utils.d.ts +1 -1
  159. package/dist/parquetjs/utils/read-utils.d.ts.map +1 -1
  160. package/dist/parquetjs/utils/read-utils.js +79 -69
  161. package/dist/polyfills/buffer/buffer-polyfill.browser.js +8 -3
  162. package/dist/polyfills/buffer/buffer-polyfill.node.js +13 -8
  163. package/dist/polyfills/buffer/buffer.js +1750 -1367
  164. package/dist/polyfills/buffer/index.d.ts +3 -3
  165. package/dist/polyfills/buffer/index.d.ts.map +1 -1
  166. package/dist/polyfills/buffer/index.js +5 -1
  167. package/dist/polyfills/buffer/install-buffer-polyfill.js +2 -1
  168. package/dist/polyfills/util.js +4 -1
  169. package/dist/workers/parquet-worker.js +3 -1
  170. package/package.json +15 -13
  171. package/src/index.ts +1 -1
  172. package/src/lib/parsers/parse-parquet-to-columns.ts +1 -1
  173. package/src/lib/parsers/parse-parquet.ts +1 -1
  174. package/src/parquetjs/encoder/parquet-encoder.ts +2 -2
  175. package/src/parquetjs/parser/decoders.ts +2 -2
  176. package/src/parquetjs/parser/parquet-reader.ts +1 -1
  177. package/src/parquetjs/schema/schema.ts +1 -1
  178. package/src/parquetjs/utils/read-utils.ts +2 -2
  179. package/dist/index.js.map +0 -1
  180. package/dist/lib/arrow/convert-columns-to-row-group.js.map +0 -1
  181. package/dist/lib/arrow/convert-row-group-to-columns.js.map +0 -1
  182. package/dist/lib/arrow/convert-schema-from-parquet.js.map +0 -1
  183. package/dist/lib/arrow/convert-schema-to-parquet.js.map +0 -1
  184. package/dist/lib/constants.js.map +0 -1
  185. package/dist/lib/parsers/get-parquet-schema.js.map +0 -1
  186. package/dist/lib/parsers/parse-geoparquet.js.map +0 -1
  187. package/dist/lib/parsers/parse-parquet-to-columns.js.map +0 -1
  188. package/dist/lib/parsers/parse-parquet.js.map +0 -1
  189. package/dist/lib/wasm/encode-parquet-wasm.js.map +0 -1
  190. package/dist/lib/wasm/load-wasm.js.map +0 -1
  191. package/dist/lib/wasm/parse-parquet-wasm.js.map +0 -1
  192. package/dist/lib/wip/convert-schema-deep.java.disabled +0 -910
  193. package/dist/lib/wip/convert-schema-deep.rs.disabled +0 -976
  194. package/dist/parquet-loader.js.map +0 -1
  195. package/dist/parquet-wasm-loader.js.map +0 -1
  196. package/dist/parquet-wasm-writer.js.map +0 -1
  197. package/dist/parquet-writer.js.map +0 -1
  198. package/dist/parquetjs/LICENSE +0 -20
  199. package/dist/parquetjs/codecs/declare.js.map +0 -1
  200. package/dist/parquetjs/codecs/dictionary.js.map +0 -1
  201. package/dist/parquetjs/codecs/index.js.map +0 -1
  202. package/dist/parquetjs/codecs/plain.js.map +0 -1
  203. package/dist/parquetjs/codecs/rle.js.map +0 -1
  204. package/dist/parquetjs/compression.js.map +0 -1
  205. package/dist/parquetjs/encoder/parquet-encoder.js.map +0 -1
  206. package/dist/parquetjs/modules.d.ts +0 -21
  207. package/dist/parquetjs/parquet-thrift/BoundaryOrder.js.map +0 -1
  208. package/dist/parquetjs/parquet-thrift/BsonType.js.map +0 -1
  209. package/dist/parquetjs/parquet-thrift/ColumnChunk.js.map +0 -1
  210. package/dist/parquetjs/parquet-thrift/ColumnIndex.js.map +0 -1
  211. package/dist/parquetjs/parquet-thrift/ColumnMetaData.js.map +0 -1
  212. package/dist/parquetjs/parquet-thrift/ColumnOrder.js.map +0 -1
  213. package/dist/parquetjs/parquet-thrift/CompressionCodec.js.map +0 -1
  214. package/dist/parquetjs/parquet-thrift/ConvertedType.js.map +0 -1
  215. package/dist/parquetjs/parquet-thrift/DataPageHeader.js.map +0 -1
  216. package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.js.map +0 -1
  217. package/dist/parquetjs/parquet-thrift/DateType.js.map +0 -1
  218. package/dist/parquetjs/parquet-thrift/DecimalType.js.map +0 -1
  219. package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.js.map +0 -1
  220. package/dist/parquetjs/parquet-thrift/Encoding.js.map +0 -1
  221. package/dist/parquetjs/parquet-thrift/EnumType.js.map +0 -1
  222. package/dist/parquetjs/parquet-thrift/FieldRepetitionType.js.map +0 -1
  223. package/dist/parquetjs/parquet-thrift/FileMetaData.js.map +0 -1
  224. package/dist/parquetjs/parquet-thrift/IndexPageHeader.js.map +0 -1
  225. package/dist/parquetjs/parquet-thrift/IntType.js.map +0 -1
  226. package/dist/parquetjs/parquet-thrift/JsonType.js.map +0 -1
  227. package/dist/parquetjs/parquet-thrift/KeyValue.js.map +0 -1
  228. package/dist/parquetjs/parquet-thrift/ListType.js.map +0 -1
  229. package/dist/parquetjs/parquet-thrift/LogicalType.js.map +0 -1
  230. package/dist/parquetjs/parquet-thrift/MapType.js.map +0 -1
  231. package/dist/parquetjs/parquet-thrift/MicroSeconds.js.map +0 -1
  232. package/dist/parquetjs/parquet-thrift/MilliSeconds.js.map +0 -1
  233. package/dist/parquetjs/parquet-thrift/NullType.js.map +0 -1
  234. package/dist/parquetjs/parquet-thrift/OffsetIndex.js.map +0 -1
  235. package/dist/parquetjs/parquet-thrift/PageEncodingStats.js.map +0 -1
  236. package/dist/parquetjs/parquet-thrift/PageHeader.js.map +0 -1
  237. package/dist/parquetjs/parquet-thrift/PageLocation.js.map +0 -1
  238. package/dist/parquetjs/parquet-thrift/PageType.js.map +0 -1
  239. package/dist/parquetjs/parquet-thrift/RowGroup.js.map +0 -1
  240. package/dist/parquetjs/parquet-thrift/SchemaElement.js.map +0 -1
  241. package/dist/parquetjs/parquet-thrift/SortingColumn.js.map +0 -1
  242. package/dist/parquetjs/parquet-thrift/Statistics.js.map +0 -1
  243. package/dist/parquetjs/parquet-thrift/StringType.js.map +0 -1
  244. package/dist/parquetjs/parquet-thrift/TimeType.js.map +0 -1
  245. package/dist/parquetjs/parquet-thrift/TimeUnit.js.map +0 -1
  246. package/dist/parquetjs/parquet-thrift/TimestampType.js.map +0 -1
  247. package/dist/parquetjs/parquet-thrift/Type.js.map +0 -1
  248. package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.js.map +0 -1
  249. package/dist/parquetjs/parquet-thrift/UUIDType.js.map +0 -1
  250. package/dist/parquetjs/parquet-thrift/index.js.map +0 -1
  251. package/dist/parquetjs/parser/decoders.js.map +0 -1
  252. package/dist/parquetjs/parser/parquet-reader.js.map +0 -1
  253. package/dist/parquetjs/schema/declare.js.map +0 -1
  254. package/dist/parquetjs/schema/schema.js.map +0 -1
  255. package/dist/parquetjs/schema/shred.js.map +0 -1
  256. package/dist/parquetjs/schema/types.js.map +0 -1
  257. package/dist/parquetjs/utils/file-utils.js.map +0 -1
  258. package/dist/parquetjs/utils/read-utils.js.map +0 -1
  259. package/dist/polyfills/buffer/buffer-polyfill.browser.js.map +0 -1
  260. package/dist/polyfills/buffer/buffer-polyfill.node.js.map +0 -1
  261. package/dist/polyfills/buffer/buffer.js.map +0 -1
  262. package/dist/polyfills/buffer/index.js.map +0 -1
  263. package/dist/polyfills/buffer/install-buffer-polyfill.js.map +0 -1
  264. package/dist/polyfills/util.js.map +0 -1
  265. package/dist/workers/parquet-worker.js.map +0 -1
@@ -1,3 +1,9 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /*
4
+ * Autogenerated by @creditkarma/thrift-typescript v3.7.2
5
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
6
+ */
1
7
  import * as thrift from 'thrift';
2
8
  import * as BsonType from "./BsonType.js";
3
9
  import * as DateType from "./DateType.js";
@@ -13,364 +19,339 @@ import * as TimestampType from "./TimestampType.js";
13
19
  import * as TimeType from "./TimeType.js";
14
20
  import * as UUIDType from "./UUIDType.js";
15
21
  export class LogicalType {
16
- constructor(args) {
17
- this.STRING = void 0;
18
- this.MAP = void 0;
19
- this.LIST = void 0;
20
- this.ENUM = void 0;
21
- this.DECIMAL = void 0;
22
- this.DATE = void 0;
23
- this.TIME = void 0;
24
- this.TIMESTAMP = void 0;
25
- this.INTEGER = void 0;
26
- this.UNKNOWN = void 0;
27
- this.JSON = void 0;
28
- this.BSON = void 0;
29
- this.UUID = void 0;
30
- let _fieldsSet = 0;
31
- if (args != null) {
32
- if (args.STRING != null) {
33
- _fieldsSet++;
34
- this.STRING = args.STRING;
35
- }
36
- if (args.MAP != null) {
37
- _fieldsSet++;
38
- this.MAP = args.MAP;
39
- }
40
- if (args.LIST != null) {
41
- _fieldsSet++;
42
- this.LIST = args.LIST;
43
- }
44
- if (args.ENUM != null) {
45
- _fieldsSet++;
46
- this.ENUM = args.ENUM;
47
- }
48
- if (args.DECIMAL != null) {
49
- _fieldsSet++;
50
- this.DECIMAL = args.DECIMAL;
51
- }
52
- if (args.DATE != null) {
53
- _fieldsSet++;
54
- this.DATE = args.DATE;
55
- }
56
- if (args.TIME != null) {
57
- _fieldsSet++;
58
- this.TIME = args.TIME;
59
- }
60
- if (args.TIMESTAMP != null) {
61
- _fieldsSet++;
62
- this.TIMESTAMP = args.TIMESTAMP;
63
- }
64
- if (args.INTEGER != null) {
65
- _fieldsSet++;
66
- this.INTEGER = args.INTEGER;
67
- }
68
- if (args.UNKNOWN != null) {
69
- _fieldsSet++;
70
- this.UNKNOWN = args.UNKNOWN;
71
- }
72
- if (args.JSON != null) {
73
- _fieldsSet++;
74
- this.JSON = args.JSON;
75
- }
76
- if (args.BSON != null) {
77
- _fieldsSet++;
78
- this.BSON = args.BSON;
79
- }
80
- if (args.UUID != null) {
81
- _fieldsSet++;
82
- this.UUID = args.UUID;
83
- }
84
- if (_fieldsSet > 1) {
85
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.INVALID_DATA, 'Cannot read a TUnion with more than one set value!');
86
- } else if (_fieldsSet < 1) {
87
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.INVALID_DATA, 'Cannot read a TUnion with no set value!');
88
- }
22
+ constructor(args) {
23
+ let _fieldsSet = 0;
24
+ if (args != null) {
25
+ if (args.STRING != null) {
26
+ _fieldsSet++;
27
+ this.STRING = args.STRING;
28
+ }
29
+ if (args.MAP != null) {
30
+ _fieldsSet++;
31
+ this.MAP = args.MAP;
32
+ }
33
+ if (args.LIST != null) {
34
+ _fieldsSet++;
35
+ this.LIST = args.LIST;
36
+ }
37
+ if (args.ENUM != null) {
38
+ _fieldsSet++;
39
+ this.ENUM = args.ENUM;
40
+ }
41
+ if (args.DECIMAL != null) {
42
+ _fieldsSet++;
43
+ this.DECIMAL = args.DECIMAL;
44
+ }
45
+ if (args.DATE != null) {
46
+ _fieldsSet++;
47
+ this.DATE = args.DATE;
48
+ }
49
+ if (args.TIME != null) {
50
+ _fieldsSet++;
51
+ this.TIME = args.TIME;
52
+ }
53
+ if (args.TIMESTAMP != null) {
54
+ _fieldsSet++;
55
+ this.TIMESTAMP = args.TIMESTAMP;
56
+ }
57
+ if (args.INTEGER != null) {
58
+ _fieldsSet++;
59
+ this.INTEGER = args.INTEGER;
60
+ }
61
+ if (args.UNKNOWN != null) {
62
+ _fieldsSet++;
63
+ this.UNKNOWN = args.UNKNOWN;
64
+ }
65
+ if (args.JSON != null) {
66
+ _fieldsSet++;
67
+ this.JSON = args.JSON;
68
+ }
69
+ if (args.BSON != null) {
70
+ _fieldsSet++;
71
+ this.BSON = args.BSON;
72
+ }
73
+ if (args.UUID != null) {
74
+ _fieldsSet++;
75
+ this.UUID = args.UUID;
76
+ }
77
+ if (_fieldsSet > 1) {
78
+ throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.INVALID_DATA, 'Cannot read a TUnion with more than one set value!');
79
+ }
80
+ else if (_fieldsSet < 1) {
81
+ throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.INVALID_DATA, 'Cannot read a TUnion with no set value!');
82
+ }
83
+ }
89
84
  }
90
- }
91
- static fromSTRING(STRING) {
92
- return new LogicalType({
93
- STRING
94
- });
95
- }
96
- static fromMAP(MAP) {
97
- return new LogicalType({
98
- MAP
99
- });
100
- }
101
- static fromLIST(LIST) {
102
- return new LogicalType({
103
- LIST
104
- });
105
- }
106
- static fromENUM(ENUM) {
107
- return new LogicalType({
108
- ENUM
109
- });
110
- }
111
- static fromDECIMAL(DECIMAL) {
112
- return new LogicalType({
113
- DECIMAL
114
- });
115
- }
116
- static fromDATE(DATE) {
117
- return new LogicalType({
118
- DATE
119
- });
120
- }
121
- static fromTIME(TIME) {
122
- return new LogicalType({
123
- TIME
124
- });
125
- }
126
- static fromTIMESTAMP(TIMESTAMP) {
127
- return new LogicalType({
128
- TIMESTAMP
129
- });
130
- }
131
- static fromINTEGER(INTEGER) {
132
- return new LogicalType({
133
- INTEGER
134
- });
135
- }
136
- static fromUNKNOWN(UNKNOWN) {
137
- return new LogicalType({
138
- UNKNOWN
139
- });
140
- }
141
- static fromJSON(JSON) {
142
- return new LogicalType({
143
- JSON
144
- });
145
- }
146
- static fromBSON(BSON) {
147
- return new LogicalType({
148
- BSON
149
- });
150
- }
151
- static fromUUID(UUID) {
152
- return new LogicalType({
153
- UUID
154
- });
155
- }
156
- write(output) {
157
- output.writeStructBegin('LogicalType');
158
- if (this.STRING != null) {
159
- output.writeFieldBegin('STRING', thrift.Thrift.Type.STRUCT, 1);
160
- this.STRING.write(output);
161
- output.writeFieldEnd();
85
+ static fromSTRING(STRING) {
86
+ return new LogicalType({ STRING });
162
87
  }
163
- if (this.MAP != null) {
164
- output.writeFieldBegin('MAP', thrift.Thrift.Type.STRUCT, 2);
165
- this.MAP.write(output);
166
- output.writeFieldEnd();
88
+ static fromMAP(MAP) {
89
+ return new LogicalType({ MAP });
167
90
  }
168
- if (this.LIST != null) {
169
- output.writeFieldBegin('LIST', thrift.Thrift.Type.STRUCT, 3);
170
- this.LIST.write(output);
171
- output.writeFieldEnd();
91
+ static fromLIST(LIST) {
92
+ return new LogicalType({ LIST });
172
93
  }
173
- if (this.ENUM != null) {
174
- output.writeFieldBegin('ENUM', thrift.Thrift.Type.STRUCT, 4);
175
- this.ENUM.write(output);
176
- output.writeFieldEnd();
94
+ static fromENUM(ENUM) {
95
+ return new LogicalType({ ENUM });
177
96
  }
178
- if (this.DECIMAL != null) {
179
- output.writeFieldBegin('DECIMAL', thrift.Thrift.Type.STRUCT, 5);
180
- this.DECIMAL.write(output);
181
- output.writeFieldEnd();
97
+ static fromDECIMAL(DECIMAL) {
98
+ return new LogicalType({ DECIMAL });
182
99
  }
183
- if (this.DATE != null) {
184
- output.writeFieldBegin('DATE', thrift.Thrift.Type.STRUCT, 6);
185
- this.DATE.write(output);
186
- output.writeFieldEnd();
100
+ static fromDATE(DATE) {
101
+ return new LogicalType({ DATE });
187
102
  }
188
- if (this.TIME != null) {
189
- output.writeFieldBegin('TIME', thrift.Thrift.Type.STRUCT, 7);
190
- this.TIME.write(output);
191
- output.writeFieldEnd();
103
+ static fromTIME(TIME) {
104
+ return new LogicalType({ TIME });
192
105
  }
193
- if (this.TIMESTAMP != null) {
194
- output.writeFieldBegin('TIMESTAMP', thrift.Thrift.Type.STRUCT, 8);
195
- this.TIMESTAMP.write(output);
196
- output.writeFieldEnd();
106
+ static fromTIMESTAMP(TIMESTAMP) {
107
+ return new LogicalType({ TIMESTAMP });
197
108
  }
198
- if (this.INTEGER != null) {
199
- output.writeFieldBegin('INTEGER', thrift.Thrift.Type.STRUCT, 10);
200
- this.INTEGER.write(output);
201
- output.writeFieldEnd();
109
+ static fromINTEGER(INTEGER) {
110
+ return new LogicalType({ INTEGER });
202
111
  }
203
- if (this.UNKNOWN != null) {
204
- output.writeFieldBegin('UNKNOWN', thrift.Thrift.Type.STRUCT, 11);
205
- this.UNKNOWN.write(output);
206
- output.writeFieldEnd();
112
+ static fromUNKNOWN(UNKNOWN) {
113
+ return new LogicalType({ UNKNOWN });
207
114
  }
208
- if (this.JSON != null) {
209
- output.writeFieldBegin('JSON', thrift.Thrift.Type.STRUCT, 12);
210
- this.JSON.write(output);
211
- output.writeFieldEnd();
115
+ static fromJSON(JSON) {
116
+ return new LogicalType({ JSON });
212
117
  }
213
- if (this.BSON != null) {
214
- output.writeFieldBegin('BSON', thrift.Thrift.Type.STRUCT, 13);
215
- this.BSON.write(output);
216
- output.writeFieldEnd();
118
+ static fromBSON(BSON) {
119
+ return new LogicalType({ BSON });
217
120
  }
218
- if (this.UUID != null) {
219
- output.writeFieldBegin('UUID', thrift.Thrift.Type.STRUCT, 14);
220
- this.UUID.write(output);
221
- output.writeFieldEnd();
121
+ static fromUUID(UUID) {
122
+ return new LogicalType({ UUID });
222
123
  }
223
- output.writeFieldStop();
224
- output.writeStructEnd();
225
- return;
226
- }
227
- static read(input) {
228
- let _fieldsSet = 0;
229
- let _returnValue = null;
230
- input.readStructBegin();
231
- while (true) {
232
- const ret = input.readFieldBegin();
233
- const fieldType = ret.ftype;
234
- const fieldId = ret.fid;
235
- if (fieldType === thrift.Thrift.Type.STOP) {
236
- break;
237
- }
238
- switch (fieldId) {
239
- case 1:
240
- if (fieldType === thrift.Thrift.Type.STRUCT) {
241
- _fieldsSet++;
242
- const value_1 = StringType.StringType.read(input);
243
- _returnValue = LogicalType.fromSTRING(value_1);
244
- } else {
245
- input.skip(fieldType);
246
- }
247
- break;
248
- case 2:
249
- if (fieldType === thrift.Thrift.Type.STRUCT) {
250
- _fieldsSet++;
251
- const value_2 = MapType.MapType.read(input);
252
- _returnValue = LogicalType.fromMAP(value_2);
253
- } else {
254
- input.skip(fieldType);
255
- }
256
- break;
257
- case 3:
258
- if (fieldType === thrift.Thrift.Type.STRUCT) {
259
- _fieldsSet++;
260
- const value_3 = ListType.ListType.read(input);
261
- _returnValue = LogicalType.fromLIST(value_3);
262
- } else {
263
- input.skip(fieldType);
264
- }
265
- break;
266
- case 4:
267
- if (fieldType === thrift.Thrift.Type.STRUCT) {
268
- _fieldsSet++;
269
- const value_4 = EnumType.EnumType.read(input);
270
- _returnValue = LogicalType.fromENUM(value_4);
271
- } else {
272
- input.skip(fieldType);
273
- }
274
- break;
275
- case 5:
276
- if (fieldType === thrift.Thrift.Type.STRUCT) {
277
- _fieldsSet++;
278
- const value_5 = DecimalType.DecimalType.read(input);
279
- _returnValue = LogicalType.fromDECIMAL(value_5);
280
- } else {
281
- input.skip(fieldType);
282
- }
283
- break;
284
- case 6:
285
- if (fieldType === thrift.Thrift.Type.STRUCT) {
286
- _fieldsSet++;
287
- const value_6 = DateType.DateType.read(input);
288
- _returnValue = LogicalType.fromDATE(value_6);
289
- } else {
290
- input.skip(fieldType);
291
- }
292
- break;
293
- case 7:
294
- if (fieldType === thrift.Thrift.Type.STRUCT) {
295
- _fieldsSet++;
296
- const value_7 = TimeType.TimeType.read(input);
297
- _returnValue = LogicalType.fromTIME(value_7);
298
- } else {
299
- input.skip(fieldType);
300
- }
301
- break;
302
- case 8:
303
- if (fieldType === thrift.Thrift.Type.STRUCT) {
304
- _fieldsSet++;
305
- const value_8 = TimestampType.TimestampType.read(input);
306
- _returnValue = LogicalType.fromTIMESTAMP(value_8);
307
- } else {
308
- input.skip(fieldType);
309
- }
310
- break;
311
- case 10:
312
- if (fieldType === thrift.Thrift.Type.STRUCT) {
313
- _fieldsSet++;
314
- const value_9 = IntType.IntType.read(input);
315
- _returnValue = LogicalType.fromINTEGER(value_9);
316
- } else {
317
- input.skip(fieldType);
318
- }
319
- break;
320
- case 11:
321
- if (fieldType === thrift.Thrift.Type.STRUCT) {
322
- _fieldsSet++;
323
- const value_10 = NullType.NullType.read(input);
324
- _returnValue = LogicalType.fromUNKNOWN(value_10);
325
- } else {
326
- input.skip(fieldType);
327
- }
328
- break;
329
- case 12:
330
- if (fieldType === thrift.Thrift.Type.STRUCT) {
331
- _fieldsSet++;
332
- const value_11 = JsonType.JsonType.read(input);
333
- _returnValue = LogicalType.fromJSON(value_11);
334
- } else {
335
- input.skip(fieldType);
336
- }
337
- break;
338
- case 13:
339
- if (fieldType === thrift.Thrift.Type.STRUCT) {
340
- _fieldsSet++;
341
- const value_12 = BsonType.BsonType.read(input);
342
- _returnValue = LogicalType.fromBSON(value_12);
343
- } else {
344
- input.skip(fieldType);
345
- }
346
- break;
347
- case 14:
348
- if (fieldType === thrift.Thrift.Type.STRUCT) {
349
- _fieldsSet++;
350
- const value_13 = UUIDType.UUIDType.read(input);
351
- _returnValue = LogicalType.fromUUID(value_13);
352
- } else {
353
- input.skip(fieldType);
354
- }
355
- break;
356
- default:
357
- {
358
- input.skip(fieldType);
359
- }
360
- }
361
- input.readFieldEnd();
124
+ write(output) {
125
+ output.writeStructBegin('LogicalType');
126
+ if (this.STRING != null) {
127
+ output.writeFieldBegin('STRING', thrift.Thrift.Type.STRUCT, 1);
128
+ this.STRING.write(output);
129
+ output.writeFieldEnd();
130
+ }
131
+ if (this.MAP != null) {
132
+ output.writeFieldBegin('MAP', thrift.Thrift.Type.STRUCT, 2);
133
+ this.MAP.write(output);
134
+ output.writeFieldEnd();
135
+ }
136
+ if (this.LIST != null) {
137
+ output.writeFieldBegin('LIST', thrift.Thrift.Type.STRUCT, 3);
138
+ this.LIST.write(output);
139
+ output.writeFieldEnd();
140
+ }
141
+ if (this.ENUM != null) {
142
+ output.writeFieldBegin('ENUM', thrift.Thrift.Type.STRUCT, 4);
143
+ this.ENUM.write(output);
144
+ output.writeFieldEnd();
145
+ }
146
+ if (this.DECIMAL != null) {
147
+ output.writeFieldBegin('DECIMAL', thrift.Thrift.Type.STRUCT, 5);
148
+ this.DECIMAL.write(output);
149
+ output.writeFieldEnd();
150
+ }
151
+ if (this.DATE != null) {
152
+ output.writeFieldBegin('DATE', thrift.Thrift.Type.STRUCT, 6);
153
+ this.DATE.write(output);
154
+ output.writeFieldEnd();
155
+ }
156
+ if (this.TIME != null) {
157
+ output.writeFieldBegin('TIME', thrift.Thrift.Type.STRUCT, 7);
158
+ this.TIME.write(output);
159
+ output.writeFieldEnd();
160
+ }
161
+ if (this.TIMESTAMP != null) {
162
+ output.writeFieldBegin('TIMESTAMP', thrift.Thrift.Type.STRUCT, 8);
163
+ this.TIMESTAMP.write(output);
164
+ output.writeFieldEnd();
165
+ }
166
+ if (this.INTEGER != null) {
167
+ output.writeFieldBegin('INTEGER', thrift.Thrift.Type.STRUCT, 10);
168
+ this.INTEGER.write(output);
169
+ output.writeFieldEnd();
170
+ }
171
+ if (this.UNKNOWN != null) {
172
+ output.writeFieldBegin('UNKNOWN', thrift.Thrift.Type.STRUCT, 11);
173
+ this.UNKNOWN.write(output);
174
+ output.writeFieldEnd();
175
+ }
176
+ if (this.JSON != null) {
177
+ output.writeFieldBegin('JSON', thrift.Thrift.Type.STRUCT, 12);
178
+ this.JSON.write(output);
179
+ output.writeFieldEnd();
180
+ }
181
+ if (this.BSON != null) {
182
+ output.writeFieldBegin('BSON', thrift.Thrift.Type.STRUCT, 13);
183
+ this.BSON.write(output);
184
+ output.writeFieldEnd();
185
+ }
186
+ if (this.UUID != null) {
187
+ output.writeFieldBegin('UUID', thrift.Thrift.Type.STRUCT, 14);
188
+ this.UUID.write(output);
189
+ output.writeFieldEnd();
190
+ }
191
+ output.writeFieldStop();
192
+ output.writeStructEnd();
193
+ return;
362
194
  }
363
- input.readStructEnd();
364
- if (_fieldsSet > 1) {
365
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.INVALID_DATA, 'Cannot read a TUnion with more than one set value!');
366
- } else if (_fieldsSet < 1) {
367
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.INVALID_DATA, 'Cannot read a TUnion with no set value!');
195
+ static read(input) {
196
+ let _fieldsSet = 0;
197
+ let _returnValue = null;
198
+ input.readStructBegin();
199
+ while (true) {
200
+ const ret = input.readFieldBegin();
201
+ const fieldType = ret.ftype;
202
+ const fieldId = ret.fid;
203
+ if (fieldType === thrift.Thrift.Type.STOP) {
204
+ break;
205
+ }
206
+ switch (fieldId) {
207
+ case 1:
208
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
209
+ _fieldsSet++;
210
+ const value_1 = StringType.StringType.read(input);
211
+ _returnValue = LogicalType.fromSTRING(value_1);
212
+ }
213
+ else {
214
+ input.skip(fieldType);
215
+ }
216
+ break;
217
+ case 2:
218
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
219
+ _fieldsSet++;
220
+ const value_2 = MapType.MapType.read(input);
221
+ _returnValue = LogicalType.fromMAP(value_2);
222
+ }
223
+ else {
224
+ input.skip(fieldType);
225
+ }
226
+ break;
227
+ case 3:
228
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
229
+ _fieldsSet++;
230
+ const value_3 = ListType.ListType.read(input);
231
+ _returnValue = LogicalType.fromLIST(value_3);
232
+ }
233
+ else {
234
+ input.skip(fieldType);
235
+ }
236
+ break;
237
+ case 4:
238
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
239
+ _fieldsSet++;
240
+ const value_4 = EnumType.EnumType.read(input);
241
+ _returnValue = LogicalType.fromENUM(value_4);
242
+ }
243
+ else {
244
+ input.skip(fieldType);
245
+ }
246
+ break;
247
+ case 5:
248
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
249
+ _fieldsSet++;
250
+ const value_5 = DecimalType.DecimalType.read(input);
251
+ _returnValue = LogicalType.fromDECIMAL(value_5);
252
+ }
253
+ else {
254
+ input.skip(fieldType);
255
+ }
256
+ break;
257
+ case 6:
258
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
259
+ _fieldsSet++;
260
+ const value_6 = DateType.DateType.read(input);
261
+ _returnValue = LogicalType.fromDATE(value_6);
262
+ }
263
+ else {
264
+ input.skip(fieldType);
265
+ }
266
+ break;
267
+ case 7:
268
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
269
+ _fieldsSet++;
270
+ const value_7 = TimeType.TimeType.read(input);
271
+ _returnValue = LogicalType.fromTIME(value_7);
272
+ }
273
+ else {
274
+ input.skip(fieldType);
275
+ }
276
+ break;
277
+ case 8:
278
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
279
+ _fieldsSet++;
280
+ const value_8 = TimestampType.TimestampType.read(input);
281
+ _returnValue = LogicalType.fromTIMESTAMP(value_8);
282
+ }
283
+ else {
284
+ input.skip(fieldType);
285
+ }
286
+ break;
287
+ case 10:
288
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
289
+ _fieldsSet++;
290
+ const value_9 = IntType.IntType.read(input);
291
+ _returnValue = LogicalType.fromINTEGER(value_9);
292
+ }
293
+ else {
294
+ input.skip(fieldType);
295
+ }
296
+ break;
297
+ case 11:
298
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
299
+ _fieldsSet++;
300
+ const value_10 = NullType.NullType.read(input);
301
+ _returnValue = LogicalType.fromUNKNOWN(value_10);
302
+ }
303
+ else {
304
+ input.skip(fieldType);
305
+ }
306
+ break;
307
+ case 12:
308
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
309
+ _fieldsSet++;
310
+ const value_11 = JsonType.JsonType.read(input);
311
+ _returnValue = LogicalType.fromJSON(value_11);
312
+ }
313
+ else {
314
+ input.skip(fieldType);
315
+ }
316
+ break;
317
+ case 13:
318
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
319
+ _fieldsSet++;
320
+ const value_12 = BsonType.BsonType.read(input);
321
+ _returnValue = LogicalType.fromBSON(value_12);
322
+ }
323
+ else {
324
+ input.skip(fieldType);
325
+ }
326
+ break;
327
+ case 14:
328
+ if (fieldType === thrift.Thrift.Type.STRUCT) {
329
+ _fieldsSet++;
330
+ const value_13 = UUIDType.UUIDType.read(input);
331
+ _returnValue = LogicalType.fromUUID(value_13);
332
+ }
333
+ else {
334
+ input.skip(fieldType);
335
+ }
336
+ break;
337
+ default: {
338
+ input.skip(fieldType);
339
+ }
340
+ }
341
+ input.readFieldEnd();
342
+ }
343
+ input.readStructEnd();
344
+ if (_fieldsSet > 1) {
345
+ throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.INVALID_DATA, 'Cannot read a TUnion with more than one set value!');
346
+ }
347
+ else if (_fieldsSet < 1) {
348
+ throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.INVALID_DATA, 'Cannot read a TUnion with no set value!');
349
+ }
350
+ if (_returnValue !== null) {
351
+ return _returnValue;
352
+ }
353
+ else {
354
+ throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Unable to read data for TUnion');
355
+ }
368
356
  }
369
- if (_returnValue !== null) {
370
- return _returnValue;
371
- } else {
372
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Unable to read data for TUnion');
373
- }
374
- }
375
357
  }
376
- //# sourceMappingURL=LogicalType.js.map