@loaders.gl/parquet 3.4.11 → 3.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/dist.min.js +16 -16
  2. package/dist/dist.min.js.map +3 -3
  3. package/dist/es5/parquet-loader.js +1 -1
  4. package/dist/es5/parquet-wasm-loader.js +1 -1
  5. package/dist/es5/parquet-wasm-writer.js +1 -1
  6. package/dist/es5/parquet-writer.js +1 -1
  7. package/dist/esm/parquet-loader.js +1 -1
  8. package/dist/esm/parquet-wasm-loader.js +1 -1
  9. package/dist/esm/parquet-wasm-writer.js +1 -1
  10. package/dist/esm/parquet-writer.js +1 -1
  11. package/dist/parquet-worker.js +2 -2
  12. package/package.json +9 -7
  13. package/dist/bundle.js +0 -5
  14. package/dist/constants.js +0 -18
  15. package/dist/index.js +0 -56
  16. package/dist/lib/arrow/convert-columns-to-row-group.js +0 -1
  17. package/dist/lib/arrow/convert-row-group-to-columns.js +0 -12
  18. package/dist/lib/arrow/convert-schema-from-parquet.js +0 -82
  19. package/dist/lib/arrow/convert-schema-to-parquet.js +0 -72
  20. package/dist/lib/geo/decode-geo-metadata.js +0 -73
  21. package/dist/lib/geo/geoparquet-schema.js +0 -69
  22. package/dist/lib/parsers/parse-parquet-to-columns.js +0 -40
  23. package/dist/lib/parsers/parse-parquet-to-rows.js +0 -40
  24. package/dist/lib/wasm/encode-parquet-wasm.js +0 -30
  25. package/dist/lib/wasm/load-wasm/index.js +0 -5
  26. package/dist/lib/wasm/load-wasm/load-wasm-browser.js +0 -38
  27. package/dist/lib/wasm/load-wasm/load-wasm-node.js +0 -31
  28. package/dist/lib/wasm/parse-parquet-wasm.js +0 -27
  29. package/dist/parquet-loader.js +0 -29
  30. package/dist/parquet-wasm-loader.js +0 -27
  31. package/dist/parquet-wasm-writer.js +0 -23
  32. package/dist/parquet-writer.js +0 -21
  33. package/dist/parquetjs/codecs/declare.js +0 -2
  34. package/dist/parquetjs/codecs/dictionary.js +0 -14
  35. package/dist/parquetjs/codecs/index.js +0 -55
  36. package/dist/parquetjs/codecs/plain.js +0 -211
  37. package/dist/parquetjs/codecs/rle.js +0 -145
  38. package/dist/parquetjs/compression.js +0 -183
  39. package/dist/parquetjs/encoder/parquet-encoder.js +0 -484
  40. package/dist/parquetjs/parquet-thrift/BoundaryOrder.js +0 -15
  41. package/dist/parquetjs/parquet-thrift/BsonType.js +0 -62
  42. package/dist/parquetjs/parquet-thrift/ColumnChunk.js +0 -211
  43. package/dist/parquetjs/parquet-thrift/ColumnIndex.js +0 -217
  44. package/dist/parquetjs/parquet-thrift/ColumnMetaData.js +0 -402
  45. package/dist/parquetjs/parquet-thrift/ColumnOrder.js +0 -108
  46. package/dist/parquetjs/parquet-thrift/CompressionCodec.js +0 -20
  47. package/dist/parquetjs/parquet-thrift/ConvertedType.js +0 -34
  48. package/dist/parquetjs/parquet-thrift/DataPageHeader.js +0 -170
  49. package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.js +0 -230
  50. package/dist/parquetjs/parquet-thrift/DateType.js +0 -62
  51. package/dist/parquetjs/parquet-thrift/DecimalType.js +0 -109
  52. package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.js +0 -126
  53. package/dist/parquetjs/parquet-thrift/Encoding.js +0 -20
  54. package/dist/parquetjs/parquet-thrift/EnumType.js +0 -62
  55. package/dist/parquetjs/parquet-thrift/FieldRepetitionType.js +0 -15
  56. package/dist/parquetjs/parquet-thrift/FileMetaData.js +0 -260
  57. package/dist/parquetjs/parquet-thrift/IndexPageHeader.js +0 -62
  58. package/dist/parquetjs/parquet-thrift/IntType.js +0 -109
  59. package/dist/parquetjs/parquet-thrift/JsonType.js +0 -62
  60. package/dist/parquetjs/parquet-thrift/KeyValue.js +0 -106
  61. package/dist/parquetjs/parquet-thrift/ListType.js +0 -62
  62. package/dist/parquetjs/parquet-thrift/LogicalType.js +0 -384
  63. package/dist/parquetjs/parquet-thrift/MapType.js +0 -62
  64. package/dist/parquetjs/parquet-thrift/MicroSeconds.js +0 -62
  65. package/dist/parquetjs/parquet-thrift/MilliSeconds.js +0 -62
  66. package/dist/parquetjs/parquet-thrift/NullType.js +0 -62
  67. package/dist/parquetjs/parquet-thrift/OffsetIndex.js +0 -101
  68. package/dist/parquetjs/parquet-thrift/PageEncodingStats.js +0 -131
  69. package/dist/parquetjs/parquet-thrift/PageHeader.js +0 -220
  70. package/dist/parquetjs/parquet-thrift/PageLocation.js +0 -145
  71. package/dist/parquetjs/parquet-thrift/PageType.js +0 -16
  72. package/dist/parquetjs/parquet-thrift/RowGroup.js +0 -186
  73. package/dist/parquetjs/parquet-thrift/SchemaElement.js +0 -243
  74. package/dist/parquetjs/parquet-thrift/SortingColumn.js +0 -131
  75. package/dist/parquetjs/parquet-thrift/Statistics.js +0 -180
  76. package/dist/parquetjs/parquet-thrift/StringType.js +0 -62
  77. package/dist/parquetjs/parquet-thrift/TimeType.js +0 -110
  78. package/dist/parquetjs/parquet-thrift/TimeUnit.js +0 -131
  79. package/dist/parquetjs/parquet-thrift/TimestampType.js +0 -110
  80. package/dist/parquetjs/parquet-thrift/Type.js +0 -20
  81. package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.js +0 -62
  82. package/dist/parquetjs/parquet-thrift/UUIDType.js +0 -62
  83. package/dist/parquetjs/parquet-thrift/index.js +0 -65
  84. package/dist/parquetjs/parser/decoders.js +0 -318
  85. package/dist/parquetjs/parser/parquet-reader.js +0 -200
  86. package/dist/parquetjs/schema/declare.js +0 -12
  87. package/dist/parquetjs/schema/schema.js +0 -162
  88. package/dist/parquetjs/schema/shred.js +0 -347
  89. package/dist/parquetjs/schema/types.js +0 -416
  90. package/dist/parquetjs/utils/file-utils.js +0 -43
  91. package/dist/parquetjs/utils/read-utils.js +0 -109
  92. package/dist/workers/parquet-worker.js +0 -5
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.MilliSeconds = void 0;
27
- /* tslint:disable */
28
- /* eslint-disable */
29
- /*
30
- * Autogenerated by @creditkarma/thrift-typescript v3.7.2
31
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
32
- */
33
- const thrift = __importStar(require("thrift"));
34
- class MilliSeconds {
35
- constructor() { }
36
- write(output) {
37
- output.writeStructBegin('MilliSeconds');
38
- output.writeFieldStop();
39
- output.writeStructEnd();
40
- return;
41
- }
42
- static read(input) {
43
- input.readStructBegin();
44
- while (true) {
45
- const ret = input.readFieldBegin();
46
- const fieldType = ret.ftype;
47
- const fieldId = ret.fid;
48
- if (fieldType === thrift.Thrift.Type.STOP) {
49
- break;
50
- }
51
- switch (fieldId) {
52
- default: {
53
- input.skip(fieldType);
54
- }
55
- }
56
- input.readFieldEnd();
57
- }
58
- input.readStructEnd();
59
- return new MilliSeconds();
60
- }
61
- }
62
- exports.MilliSeconds = MilliSeconds;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.NullType = void 0;
27
- /* tslint:disable */
28
- /* eslint-disable */
29
- /*
30
- * Autogenerated by @creditkarma/thrift-typescript v3.7.2
31
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
32
- */
33
- const thrift = __importStar(require("thrift"));
34
- class NullType {
35
- constructor() { }
36
- write(output) {
37
- output.writeStructBegin('NullType');
38
- output.writeFieldStop();
39
- output.writeStructEnd();
40
- return;
41
- }
42
- static read(input) {
43
- input.readStructBegin();
44
- while (true) {
45
- const ret = input.readFieldBegin();
46
- const fieldType = ret.ftype;
47
- const fieldId = ret.fid;
48
- if (fieldType === thrift.Thrift.Type.STOP) {
49
- break;
50
- }
51
- switch (fieldId) {
52
- default: {
53
- input.skip(fieldType);
54
- }
55
- }
56
- input.readFieldEnd();
57
- }
58
- input.readStructEnd();
59
- return new NullType();
60
- }
61
- }
62
- exports.NullType = NullType;
@@ -1,101 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.OffsetIndex = void 0;
27
- /* tslint:disable */
28
- /* eslint-disable */
29
- /*
30
- * Autogenerated by @creditkarma/thrift-typescript v3.7.2
31
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
32
- */
33
- const thrift = __importStar(require("thrift"));
34
- const PageLocation = __importStar(require("./PageLocation"));
35
- class OffsetIndex {
36
- constructor(args) {
37
- if (args != null && args.page_locations != null) {
38
- this.page_locations = args.page_locations;
39
- }
40
- else {
41
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Required field[page_locations] is unset!');
42
- }
43
- }
44
- write(output) {
45
- output.writeStructBegin('OffsetIndex');
46
- if (this.page_locations != null) {
47
- output.writeFieldBegin('page_locations', thrift.Thrift.Type.LIST, 1);
48
- output.writeListBegin(thrift.Thrift.Type.STRUCT, this.page_locations.length);
49
- this.page_locations.forEach((value_1) => {
50
- value_1.write(output);
51
- });
52
- output.writeListEnd();
53
- output.writeFieldEnd();
54
- }
55
- output.writeFieldStop();
56
- output.writeStructEnd();
57
- return;
58
- }
59
- static read(input) {
60
- input.readStructBegin();
61
- let _args = {};
62
- while (true) {
63
- const ret = input.readFieldBegin();
64
- const fieldType = ret.ftype;
65
- const fieldId = ret.fid;
66
- if (fieldType === thrift.Thrift.Type.STOP) {
67
- break;
68
- }
69
- switch (fieldId) {
70
- case 1:
71
- if (fieldType === thrift.Thrift.Type.LIST) {
72
- const value_2 = new Array();
73
- const metadata_1 = input.readListBegin();
74
- const size_1 = metadata_1.size;
75
- for (let i_1 = 0; i_1 < size_1; i_1++) {
76
- const value_3 = PageLocation.PageLocation.read(input);
77
- value_2.push(value_3);
78
- }
79
- input.readListEnd();
80
- _args.page_locations = value_2;
81
- }
82
- else {
83
- input.skip(fieldType);
84
- }
85
- break;
86
- default: {
87
- input.skip(fieldType);
88
- }
89
- }
90
- input.readFieldEnd();
91
- }
92
- input.readStructEnd();
93
- if (_args.page_locations !== undefined) {
94
- return new OffsetIndex(_args);
95
- }
96
- else {
97
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Unable to read OffsetIndex from input');
98
- }
99
- }
100
- }
101
- exports.OffsetIndex = OffsetIndex;
@@ -1,131 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.PageEncodingStats = void 0;
27
- /* tslint:disable */
28
- /* eslint-disable */
29
- /*
30
- * Autogenerated by @creditkarma/thrift-typescript v3.7.2
31
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
32
- */
33
- const thrift = __importStar(require("thrift"));
34
- class PageEncodingStats {
35
- constructor(args) {
36
- if (args != null && args.page_type != null) {
37
- this.page_type = args.page_type;
38
- }
39
- else {
40
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Required field[page_type] is unset!');
41
- }
42
- if (args != null && args.encoding != null) {
43
- this.encoding = args.encoding;
44
- }
45
- else {
46
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Required field[encoding] is unset!');
47
- }
48
- if (args != null && args.count != null) {
49
- this.count = args.count;
50
- }
51
- else {
52
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Required field[count] is unset!');
53
- }
54
- }
55
- write(output) {
56
- output.writeStructBegin('PageEncodingStats');
57
- if (this.page_type != null) {
58
- output.writeFieldBegin('page_type', thrift.Thrift.Type.I32, 1);
59
- output.writeI32(this.page_type);
60
- output.writeFieldEnd();
61
- }
62
- if (this.encoding != null) {
63
- output.writeFieldBegin('encoding', thrift.Thrift.Type.I32, 2);
64
- output.writeI32(this.encoding);
65
- output.writeFieldEnd();
66
- }
67
- if (this.count != null) {
68
- output.writeFieldBegin('count', thrift.Thrift.Type.I32, 3);
69
- output.writeI32(this.count);
70
- output.writeFieldEnd();
71
- }
72
- output.writeFieldStop();
73
- output.writeStructEnd();
74
- return;
75
- }
76
- static read(input) {
77
- input.readStructBegin();
78
- let _args = {};
79
- while (true) {
80
- const ret = input.readFieldBegin();
81
- const fieldType = ret.ftype;
82
- const fieldId = ret.fid;
83
- if (fieldType === thrift.Thrift.Type.STOP) {
84
- break;
85
- }
86
- switch (fieldId) {
87
- case 1:
88
- if (fieldType === thrift.Thrift.Type.I32) {
89
- const value_1 = input.readI32();
90
- _args.page_type = value_1;
91
- }
92
- else {
93
- input.skip(fieldType);
94
- }
95
- break;
96
- case 2:
97
- if (fieldType === thrift.Thrift.Type.I32) {
98
- const value_2 = input.readI32();
99
- _args.encoding = value_2;
100
- }
101
- else {
102
- input.skip(fieldType);
103
- }
104
- break;
105
- case 3:
106
- if (fieldType === thrift.Thrift.Type.I32) {
107
- const value_3 = input.readI32();
108
- _args.count = value_3;
109
- }
110
- else {
111
- input.skip(fieldType);
112
- }
113
- break;
114
- default: {
115
- input.skip(fieldType);
116
- }
117
- }
118
- input.readFieldEnd();
119
- }
120
- input.readStructEnd();
121
- if (_args.page_type !== undefined &&
122
- _args.encoding !== undefined &&
123
- _args.count !== undefined) {
124
- return new PageEncodingStats(_args);
125
- }
126
- else {
127
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Unable to read PageEncodingStats from input');
128
- }
129
- }
130
- }
131
- exports.PageEncodingStats = PageEncodingStats;
@@ -1,220 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.PageHeader = void 0;
27
- /* tslint:disable */
28
- /* eslint-disable */
29
- /*
30
- * Autogenerated by @creditkarma/thrift-typescript v3.7.2
31
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
32
- */
33
- const thrift = __importStar(require("thrift"));
34
- const DataPageHeader = __importStar(require("./DataPageHeader"));
35
- const DataPageHeaderV2 = __importStar(require("./DataPageHeaderV2"));
36
- const DictionaryPageHeader = __importStar(require("./DictionaryPageHeader"));
37
- const IndexPageHeader = __importStar(require("./IndexPageHeader"));
38
- class PageHeader {
39
- constructor(args) {
40
- if (args != null && args.type != null) {
41
- this.type = args.type;
42
- }
43
- else {
44
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Required field[type] is unset!');
45
- }
46
- if (args != null && args.uncompressed_page_size != null) {
47
- this.uncompressed_page_size = args.uncompressed_page_size;
48
- }
49
- else {
50
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Required field[uncompressed_page_size] is unset!');
51
- }
52
- if (args != null && args.compressed_page_size != null) {
53
- this.compressed_page_size = args.compressed_page_size;
54
- }
55
- else {
56
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Required field[compressed_page_size] is unset!');
57
- }
58
- if (args != null && args.crc != null) {
59
- this.crc = args.crc;
60
- }
61
- if (args != null && args.data_page_header != null) {
62
- this.data_page_header = args.data_page_header;
63
- }
64
- if (args != null && args.index_page_header != null) {
65
- this.index_page_header = args.index_page_header;
66
- }
67
- if (args != null && args.dictionary_page_header != null) {
68
- this.dictionary_page_header = args.dictionary_page_header;
69
- }
70
- if (args != null && args.data_page_header_v2 != null) {
71
- this.data_page_header_v2 = args.data_page_header_v2;
72
- }
73
- }
74
- write(output) {
75
- output.writeStructBegin('PageHeader');
76
- if (this.type != null) {
77
- output.writeFieldBegin('type', thrift.Thrift.Type.I32, 1);
78
- output.writeI32(this.type);
79
- output.writeFieldEnd();
80
- }
81
- if (this.uncompressed_page_size != null) {
82
- output.writeFieldBegin('uncompressed_page_size', thrift.Thrift.Type.I32, 2);
83
- output.writeI32(this.uncompressed_page_size);
84
- output.writeFieldEnd();
85
- }
86
- if (this.compressed_page_size != null) {
87
- output.writeFieldBegin('compressed_page_size', thrift.Thrift.Type.I32, 3);
88
- output.writeI32(this.compressed_page_size);
89
- output.writeFieldEnd();
90
- }
91
- if (this.crc != null) {
92
- output.writeFieldBegin('crc', thrift.Thrift.Type.I32, 4);
93
- output.writeI32(this.crc);
94
- output.writeFieldEnd();
95
- }
96
- if (this.data_page_header != null) {
97
- output.writeFieldBegin('data_page_header', thrift.Thrift.Type.STRUCT, 5);
98
- this.data_page_header.write(output);
99
- output.writeFieldEnd();
100
- }
101
- if (this.index_page_header != null) {
102
- output.writeFieldBegin('index_page_header', thrift.Thrift.Type.STRUCT, 6);
103
- this.index_page_header.write(output);
104
- output.writeFieldEnd();
105
- }
106
- if (this.dictionary_page_header != null) {
107
- output.writeFieldBegin('dictionary_page_header', thrift.Thrift.Type.STRUCT, 7);
108
- this.dictionary_page_header.write(output);
109
- output.writeFieldEnd();
110
- }
111
- if (this.data_page_header_v2 != null) {
112
- output.writeFieldBegin('data_page_header_v2', thrift.Thrift.Type.STRUCT, 8);
113
- this.data_page_header_v2.write(output);
114
- output.writeFieldEnd();
115
- }
116
- output.writeFieldStop();
117
- output.writeStructEnd();
118
- return;
119
- }
120
- static read(input) {
121
- input.readStructBegin();
122
- let _args = {};
123
- while (true) {
124
- const ret = input.readFieldBegin();
125
- const fieldType = ret.ftype;
126
- const fieldId = ret.fid;
127
- if (fieldType === thrift.Thrift.Type.STOP) {
128
- break;
129
- }
130
- switch (fieldId) {
131
- case 1:
132
- if (fieldType === thrift.Thrift.Type.I32) {
133
- const value_1 = input.readI32();
134
- _args.type = value_1;
135
- }
136
- else {
137
- input.skip(fieldType);
138
- }
139
- break;
140
- case 2:
141
- if (fieldType === thrift.Thrift.Type.I32) {
142
- const value_2 = input.readI32();
143
- _args.uncompressed_page_size = value_2;
144
- }
145
- else {
146
- input.skip(fieldType);
147
- }
148
- break;
149
- case 3:
150
- if (fieldType === thrift.Thrift.Type.I32) {
151
- const value_3 = input.readI32();
152
- _args.compressed_page_size = value_3;
153
- }
154
- else {
155
- input.skip(fieldType);
156
- }
157
- break;
158
- case 4:
159
- if (fieldType === thrift.Thrift.Type.I32) {
160
- const value_4 = input.readI32();
161
- _args.crc = value_4;
162
- }
163
- else {
164
- input.skip(fieldType);
165
- }
166
- break;
167
- case 5:
168
- if (fieldType === thrift.Thrift.Type.STRUCT) {
169
- const value_5 = DataPageHeader.DataPageHeader.read(input);
170
- _args.data_page_header = value_5;
171
- }
172
- else {
173
- input.skip(fieldType);
174
- }
175
- break;
176
- case 6:
177
- if (fieldType === thrift.Thrift.Type.STRUCT) {
178
- const value_6 = IndexPageHeader.IndexPageHeader.read(input);
179
- _args.index_page_header = value_6;
180
- }
181
- else {
182
- input.skip(fieldType);
183
- }
184
- break;
185
- case 7:
186
- if (fieldType === thrift.Thrift.Type.STRUCT) {
187
- const value_7 = DictionaryPageHeader.DictionaryPageHeader.read(input);
188
- _args.dictionary_page_header = value_7;
189
- }
190
- else {
191
- input.skip(fieldType);
192
- }
193
- break;
194
- case 8:
195
- if (fieldType === thrift.Thrift.Type.STRUCT) {
196
- const value_8 = DataPageHeaderV2.DataPageHeaderV2.read(input);
197
- _args.data_page_header_v2 = value_8;
198
- }
199
- else {
200
- input.skip(fieldType);
201
- }
202
- break;
203
- default: {
204
- input.skip(fieldType);
205
- }
206
- }
207
- input.readFieldEnd();
208
- }
209
- input.readStructEnd();
210
- if (_args.type !== undefined &&
211
- _args.uncompressed_page_size !== undefined &&
212
- _args.compressed_page_size !== undefined) {
213
- return new PageHeader(_args);
214
- }
215
- else {
216
- throw new thrift.Thrift.TProtocolException(thrift.Thrift.TProtocolExceptionType.UNKNOWN, 'Unable to read PageHeader from input');
217
- }
218
- }
219
- }
220
- exports.PageHeader = PageHeader;