@platforma-sdk/model 1.58.5 → 1.58.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +43 -0
- package/dist/_virtual/_rolldown/runtime.js +18 -0
- package/dist/annotations/converter.cjs +15 -20
- package/dist/annotations/converter.cjs.map +1 -1
- package/dist/annotations/converter.d.ts +6 -2
- package/dist/annotations/converter.js +14 -18
- package/dist/annotations/converter.js.map +1 -1
- package/dist/annotations/index.cjs +1 -0
- package/dist/annotations/index.d.ts +2 -3
- package/dist/annotations/index.js +1 -0
- package/dist/annotations/types.d.ts +21 -16
- package/dist/bconfig/index.cjs +2 -0
- package/dist/bconfig/index.d.ts +5 -6
- package/dist/bconfig/index.js +2 -0
- package/dist/bconfig/lambdas.d.ts +52 -52
- package/dist/bconfig/normalization.cjs +13 -18
- package/dist/bconfig/normalization.cjs.map +1 -1
- package/dist/bconfig/normalization.d.ts +10 -6
- package/dist/bconfig/normalization.js +12 -16
- package/dist/bconfig/normalization.js.map +1 -1
- package/dist/bconfig/types.cjs +4 -3
- package/dist/bconfig/types.cjs.map +1 -1
- package/dist/bconfig/types.d.ts +10 -5
- package/dist/bconfig/types.js +4 -2
- package/dist/bconfig/types.js.map +1 -1
- package/dist/bconfig/util.d.ts +7 -4
- package/dist/bconfig/v3.d.ts +10 -6
- package/dist/block_api_v1.d.ts +62 -58
- package/dist/block_api_v2.d.ts +51 -47
- package/dist/block_api_v3.d.ts +33 -29
- package/dist/block_migrations.cjs +481 -413
- package/dist/block_migrations.cjs.map +1 -1
- package/dist/block_migrations.d.ts +258 -204
- package/dist/block_migrations.js +482 -408
- package/dist/block_migrations.js.map +1 -1
- package/dist/block_model.cjs +312 -343
- package/dist/block_model.cjs.map +1 -1
- package/dist/block_model.d.ts +143 -147
- package/dist/block_model.js +312 -341
- package/dist/block_model.js.map +1 -1
- package/dist/block_model_legacy.cjs +231 -255
- package/dist/block_model_legacy.cjs.map +1 -1
- package/dist/block_model_legacy.d.ts +108 -106
- package/dist/block_model_legacy.js +231 -253
- package/dist/block_model_legacy.js.map +1 -1
- package/dist/block_state_patch.d.ts +10 -10
- package/dist/block_state_util.cjs +15 -19
- package/dist/block_state_util.cjs.map +1 -1
- package/dist/block_state_util.d.ts +14 -13
- package/dist/block_state_util.js +15 -18
- package/dist/block_state_util.js.map +1 -1
- package/dist/block_storage.cjs +233 -238
- package/dist/block_storage.cjs.map +1 -1
- package/dist/block_storage.d.ts +62 -78
- package/dist/block_storage.js +234 -237
- package/dist/block_storage.js.map +1 -1
- package/dist/block_storage_callbacks.cjs +156 -195
- package/dist/block_storage_callbacks.cjs.map +1 -1
- package/dist/block_storage_callbacks.js +156 -192
- package/dist/block_storage_callbacks.js.map +1 -1
- package/dist/block_storage_facade.cjs +29 -85
- package/dist/block_storage_facade.cjs.map +1 -1
- package/dist/block_storage_facade.d.ts +83 -126
- package/dist/block_storage_facade.js +29 -83
- package/dist/block_storage_facade.js.map +1 -1
- package/dist/components/PFrameForGraphs.cjs +26 -24
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +12 -7
- package/dist/components/PFrameForGraphs.js +25 -22
- package/dist/components/PFrameForGraphs.js.map +1 -1
- package/dist/components/PlAnnotations/filter.d.ts +62 -79
- package/dist/components/PlAnnotations/filters_ui.cjs +135 -171
- package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts +48 -46
- package/dist/components/PlAnnotations/filters_ui.js +135 -170
- package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
- package/dist/components/PlAnnotations/index.d.ts +2 -3
- package/dist/components/PlDataTable/index.cjs +2 -0
- package/dist/components/PlDataTable/index.d.ts +3 -5
- package/dist/components/PlDataTable/index.js +2 -0
- package/dist/components/PlDataTable/labels.cjs +59 -81
- package/dist/components/PlDataTable/labels.cjs.map +1 -1
- package/dist/components/PlDataTable/labels.js +58 -79
- package/dist/components/PlDataTable/labels.js.map +1 -1
- package/dist/components/PlDataTable/state-migration.cjs +186 -144
- package/dist/components/PlDataTable/state-migration.cjs.map +1 -1
- package/dist/components/PlDataTable/state-migration.d.ts +85 -82
- package/dist/components/PlDataTable/state-migration.js +185 -142
- package/dist/components/PlDataTable/state-migration.js.map +1 -1
- package/dist/components/PlDataTable/table.cjs +172 -194
- package/dist/components/PlDataTable/table.cjs.map +1 -1
- package/dist/components/PlDataTable/table.d.ts +16 -12
- package/dist/components/PlDataTable/table.js +171 -192
- package/dist/components/PlDataTable/table.js.map +1 -1
- package/dist/components/PlDataTable/v4.d.ts +84 -119
- package/dist/components/PlDataTable/v5.d.ts +80 -103
- package/dist/components/PlMultiSequenceAlignment.cjs +27 -29
- package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts +36 -27
- package/dist/components/PlMultiSequenceAlignment.js +26 -27
- package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
- package/dist/components/PlSelectionModel.cjs +7 -6
- package/dist/components/PlSelectionModel.cjs.map +1 -1
- package/dist/components/PlSelectionModel.d.ts +10 -8
- package/dist/components/PlSelectionModel.js +7 -5
- package/dist/components/PlSelectionModel.js.map +1 -1
- package/dist/components/index.cjs +8 -0
- package/dist/components/index.d.ts +11 -6
- package/dist/components/index.js +8 -0
- package/dist/config/actions.cjs +138 -171
- package/dist/config/actions.cjs.map +1 -1
- package/dist/config/actions.d.ts +47 -47
- package/dist/config/actions.js +146 -178
- package/dist/config/actions.js.map +1 -1
- package/dist/config/actions_kinds.d.ts +114 -121
- package/dist/config/index.cjs +1 -0
- package/dist/config/index.d.ts +6 -7
- package/dist/config/index.js +1 -0
- package/dist/config/model.d.ts +131 -127
- package/dist/config/model_meta.d.ts +4 -1
- package/dist/config/type_engine.d.ts +22 -21
- package/dist/config/type_util.d.ts +12 -10
- package/dist/env_value.cjs +5 -6
- package/dist/env_value.cjs.map +1 -1
- package/dist/env_value.d.ts +4 -1
- package/dist/env_value.js +5 -5
- package/dist/env_value.js.map +1 -1
- package/dist/filters/converters/filterToQuery.cjs +273 -239
- package/dist/filters/converters/filterToQuery.cjs.map +1 -1
- package/dist/filters/converters/filterToQuery.d.ts +6 -2
- package/dist/filters/converters/filterToQuery.js +272 -237
- package/dist/filters/converters/filterToQuery.js.map +1 -1
- package/dist/filters/converters/filterUiToExpressionImpl.cjs +56 -85
- package/dist/filters/converters/filterUiToExpressionImpl.cjs.map +1 -1
- package/dist/filters/converters/filterUiToExpressionImpl.d.ts +8 -4
- package/dist/filters/converters/filterUiToExpressionImpl.js +55 -83
- package/dist/filters/converters/filterUiToExpressionImpl.js.map +1 -1
- package/dist/filters/converters/index.cjs +2 -0
- package/dist/filters/converters/index.d.ts +2 -3
- package/dist/filters/converters/index.js +2 -0
- package/dist/filters/distill.cjs +59 -60
- package/dist/filters/distill.cjs.map +1 -1
- package/dist/filters/distill.d.ts +6 -3
- package/dist/filters/distill.js +58 -58
- package/dist/filters/distill.js.map +1 -1
- package/dist/filters/index.cjs +4 -0
- package/dist/filters/index.d.ts +5 -4
- package/dist/filters/index.js +4 -0
- package/dist/filters/traverse.cjs +31 -40
- package/dist/filters/traverse.cjs.map +1 -1
- package/dist/filters/traverse.js +31 -39
- package/dist/filters/traverse.js.map +1 -1
- package/dist/filters/types.d.ts +10 -7
- package/dist/index.cjs +193 -187
- package/dist/index.d.ts +61 -28
- package/dist/index.js +49 -41
- package/dist/internal.cjs +48 -62
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +49 -60
- package/dist/internal.js.map +1 -1
- package/dist/package.cjs +12 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.js +6 -0
- package/dist/package.js.map +1 -0
- package/dist/pframe.cjs +32 -37
- package/dist/pframe.cjs.map +1 -1
- package/dist/pframe.d.ts +14 -10
- package/dist/pframe.js +32 -35
- package/dist/pframe.js.map +1 -1
- package/dist/pframe_utils/axes.cjs +81 -114
- package/dist/pframe_utils/axes.cjs.map +1 -1
- package/dist/pframe_utils/axes.d.ts +10 -13
- package/dist/pframe_utils/axes.js +80 -112
- package/dist/pframe_utils/axes.js.map +1 -1
- package/dist/pframe_utils/columns.cjs +61 -81
- package/dist/pframe_utils/columns.cjs.map +1 -1
- package/dist/pframe_utils/columns.d.ts +15 -6
- package/dist/pframe_utils/columns.js +60 -79
- package/dist/pframe_utils/columns.js.map +1 -1
- package/dist/pframe_utils/index.cjs +232 -253
- package/dist/pframe_utils/index.cjs.map +1 -1
- package/dist/pframe_utils/index.d.ts +39 -35
- package/dist/pframe_utils/index.js +231 -251
- package/dist/pframe_utils/index.js.map +1 -1
- package/dist/platforma.d.ts +48 -46
- package/dist/plugin_handle.cjs +6 -14
- package/dist/plugin_handle.cjs.map +1 -1
- package/dist/plugin_handle.d.ts +20 -25
- package/dist/plugin_handle.js +6 -13
- package/dist/plugin_handle.js.map +1 -1
- package/dist/plugin_model.cjs +364 -163
- package/dist/plugin_model.cjs.map +1 -1
- package/dist/plugin_model.d.ts +280 -129
- package/dist/plugin_model.js +362 -163
- package/dist/plugin_model.js.map +1 -1
- package/dist/raw_globals.cjs +10 -22
- package/dist/raw_globals.cjs.map +1 -1
- package/dist/raw_globals.d.ts +8 -5
- package/dist/raw_globals.js +10 -20
- package/dist/raw_globals.js.map +1 -1
- package/dist/ref_util.cjs +14 -13
- package/dist/ref_util.cjs.map +1 -1
- package/dist/ref_util.d.ts +18 -12
- package/dist/ref_util.js +14 -11
- package/dist/ref_util.js.map +1 -1
- package/dist/render/accessor.cjs +213 -226
- package/dist/render/accessor.cjs.map +1 -1
- package/dist/render/accessor.d.ts +115 -120
- package/dist/render/accessor.js +212 -224
- package/dist/render/accessor.js.map +1 -1
- package/dist/render/api.cjs +478 -580
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +207 -209
- package/dist/render/api.js +476 -578
- package/dist/render/api.js.map +1 -1
- package/dist/render/future.cjs +28 -32
- package/dist/render/future.cjs.map +1 -1
- package/dist/render/future.d.ts +15 -11
- package/dist/render/future.js +28 -30
- package/dist/render/future.js.map +1 -1
- package/dist/render/index.cjs +8 -0
- package/dist/render/index.d.ts +10 -8
- package/dist/render/index.js +8 -0
- package/dist/render/internal.cjs +33 -29
- package/dist/render/internal.cjs.map +1 -1
- package/dist/render/internal.d.ts +78 -72
- package/dist/render/internal.js +29 -26
- package/dist/render/internal.js.map +1 -1
- package/dist/render/traversal_ops.d.ts +42 -43
- package/dist/render/util/axis_filtering.cjs +63 -86
- package/dist/render/util/axis_filtering.cjs.map +1 -1
- package/dist/render/util/axis_filtering.d.ts +10 -7
- package/dist/render/util/axis_filtering.js +63 -85
- package/dist/render/util/axis_filtering.js.map +1 -1
- package/dist/render/util/column_collection.cjs +266 -321
- package/dist/render/util/column_collection.cjs.map +1 -1
- package/dist/render/util/column_collection.d.ts +47 -47
- package/dist/render/util/column_collection.js +264 -319
- package/dist/render/util/column_collection.js.map +1 -1
- package/dist/render/util/index.cjs +4 -0
- package/dist/render/util/index.d.ts +4 -5
- package/dist/render/util/index.js +4 -0
- package/dist/render/util/label.cjs +129 -163
- package/dist/render/util/label.cjs.map +1 -1
- package/dist/render/util/label.d.ts +45 -46
- package/dist/render/util/label.js +128 -161
- package/dist/render/util/label.js.map +1 -1
- package/dist/render/util/pcolumn_data.cjs +315 -375
- package/dist/render/util/pcolumn_data.cjs.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +33 -32
- package/dist/render/util/pcolumn_data.js +314 -373
- package/dist/render/util/pcolumn_data.js.map +1 -1
- package/dist/render/util/pframe_upgraders.cjs +37 -42
- package/dist/render/util/pframe_upgraders.cjs.map +1 -1
- package/dist/render/util/pframe_upgraders.js +37 -41
- package/dist/render/util/pframe_upgraders.js.map +1 -1
- package/dist/render/util/split_selectors.d.ts +13 -9
- package/dist/version.cjs +6 -8
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.ts +7 -4
- package/dist/version.js +5 -5
- package/dist/version.js.map +1 -1
- package/package.json +10 -4
- package/src/block_migrations.test.ts +184 -14
- package/src/block_migrations.ts +185 -30
- package/src/block_model.ts +111 -66
- package/src/block_storage.test.ts +147 -3
- package/src/block_storage.ts +43 -8
- package/src/block_storage_callbacks.ts +9 -4
- package/src/env_value.ts +0 -2
- package/src/index.ts +12 -11
- package/src/internal.ts +0 -1
- package/src/platforma.ts +4 -4
- package/src/plugin_handle.ts +1 -1
- package/src/plugin_model.test.ts +217 -21
- package/src/plugin_model.ts +450 -55
- package/src/raw_globals.ts +0 -1
- package/dist/annotations/converter.d.ts.map +0 -1
- package/dist/annotations/index.d.ts.map +0 -1
- package/dist/annotations/types.d.ts.map +0 -1
- package/dist/bconfig/index.d.ts.map +0 -1
- package/dist/bconfig/lambdas.d.ts.map +0 -1
- package/dist/bconfig/normalization.d.ts.map +0 -1
- package/dist/bconfig/types.d.ts.map +0 -1
- package/dist/bconfig/util.d.ts.map +0 -1
- package/dist/bconfig/v3.d.ts.map +0 -1
- package/dist/block_api_v1.d.ts.map +0 -1
- package/dist/block_api_v2.d.ts.map +0 -1
- package/dist/block_api_v3.d.ts.map +0 -1
- package/dist/block_migrations.d.ts.map +0 -1
- package/dist/block_model.d.ts.map +0 -1
- package/dist/block_model_legacy.d.ts.map +0 -1
- package/dist/block_state_patch.d.ts.map +0 -1
- package/dist/block_state_util.d.ts.map +0 -1
- package/dist/block_storage.d.ts.map +0 -1
- package/dist/block_storage_callbacks.d.ts +0 -115
- package/dist/block_storage_callbacks.d.ts.map +0 -1
- package/dist/block_storage_facade.d.ts.map +0 -1
- package/dist/components/PFrameForGraphs.d.ts.map +0 -1
- package/dist/components/PlAnnotations/filter.d.ts.map +0 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts.map +0 -1
- package/dist/components/PlAnnotations/index.d.ts.map +0 -1
- package/dist/components/PlAnnotations/types.d.ts +0 -3
- package/dist/components/PlAnnotations/types.d.ts.map +0 -1
- package/dist/components/PlDataTable/index.d.ts.map +0 -1
- package/dist/components/PlDataTable/labels.d.ts +0 -7
- package/dist/components/PlDataTable/labels.d.ts.map +0 -1
- package/dist/components/PlDataTable/state-migration.d.ts.map +0 -1
- package/dist/components/PlDataTable/table.d.ts.map +0 -1
- package/dist/components/PlDataTable/v4.d.ts.map +0 -1
- package/dist/components/PlDataTable/v5.d.ts.map +0 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts.map +0 -1
- package/dist/components/PlSelectionModel.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/config/actions.d.ts.map +0 -1
- package/dist/config/actions_kinds.d.ts.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/model.d.ts.map +0 -1
- package/dist/config/model_meta.d.ts.map +0 -1
- package/dist/config/type_engine.d.ts.map +0 -1
- package/dist/config/type_util.d.ts.map +0 -1
- package/dist/env_value.d.ts.map +0 -1
- package/dist/filters/converters/filterToQuery.d.ts.map +0 -1
- package/dist/filters/converters/filterUiToExpressionImpl.d.ts.map +0 -1
- package/dist/filters/converters/index.d.ts.map +0 -1
- package/dist/filters/distill.d.ts.map +0 -1
- package/dist/filters/index.d.ts.map +0 -1
- package/dist/filters/traverse.d.ts +0 -27
- package/dist/filters/traverse.d.ts.map +0 -1
- package/dist/filters/types.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal.d.ts +0 -36
- package/dist/internal.d.ts.map +0 -1
- package/dist/package.json.cjs +0 -6
- package/dist/package.json.cjs.map +0 -1
- package/dist/package.json.js +0 -4
- package/dist/package.json.js.map +0 -1
- package/dist/pframe.d.ts.map +0 -1
- package/dist/pframe_utils/axes.d.ts.map +0 -1
- package/dist/pframe_utils/columns.d.ts.map +0 -1
- package/dist/pframe_utils/index.d.ts.map +0 -1
- package/dist/pframe_utils/querySpec.d.ts +0 -2
- package/dist/pframe_utils/querySpec.d.ts.map +0 -1
- package/dist/platforma.d.ts.map +0 -1
- package/dist/plugin_handle.d.ts.map +0 -1
- package/dist/plugin_model.d.ts.map +0 -1
- package/dist/raw_globals.d.ts.map +0 -1
- package/dist/ref_util.d.ts.map +0 -1
- package/dist/render/accessor.d.ts.map +0 -1
- package/dist/render/api.d.ts.map +0 -1
- package/dist/render/future.d.ts.map +0 -1
- package/dist/render/index.d.ts.map +0 -1
- package/dist/render/internal.d.ts.map +0 -1
- package/dist/render/traversal_ops.d.ts.map +0 -1
- package/dist/render/util/axis_filtering.d.ts.map +0 -1
- package/dist/render/util/column_collection.d.ts.map +0 -1
- package/dist/render/util/index.d.ts.map +0 -1
- package/dist/render/util/label.d.ts.map +0 -1
- package/dist/render/util/pcolumn_data.d.ts.map +0 -1
- package/dist/render/util/pframe_upgraders.d.ts +0 -3
- package/dist/render/util/pframe_upgraders.d.ts.map +0 -1
- package/dist/render/util/split_selectors.d.ts.map +0 -1
- package/dist/version.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var accessor = require('../accessor.cjs');
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_accessor = require('../accessor.cjs');
|
|
3
|
+
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
5
4
|
|
|
5
|
+
//#region src/render/util/pcolumn_data.ts
|
|
6
6
|
const PCD_PREFIX = "PColumnData/";
|
|
7
7
|
const RT_RESOURCE_MAP = PCD_PREFIX + "ResourceMap";
|
|
8
8
|
const RT_RESOURCE_MAP_PARTITIONED = PCD_PREFIX + "Partitioned/ResourceMap";
|
|
@@ -14,400 +14,340 @@ const RT_JSON_SUPER_PARTITIONED = PCD_SUP_PREFIX + "JsonPartitioned";
|
|
|
14
14
|
const RT_BINARY_SUPER_PARTITIONED = PCD_SUP_PREFIX + "BinaryPartitioned";
|
|
15
15
|
const RT_PARQUET_SUPER_PARTITIONED = PCD_SUP_PREFIX + "ParquetPartitioned";
|
|
16
16
|
function populateResourceMapData(acc, resourceParser, data, keyPrefix = [], addEntriesWithNoData) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
17
|
+
if (acc === void 0) return false;
|
|
18
|
+
switch (acc.resourceType.name) {
|
|
19
|
+
case RT_RESOURCE_MAP: {
|
|
20
|
+
let isComplete = acc.getInputsLocked();
|
|
21
|
+
for (const keyStr of acc.listInputFields()) {
|
|
22
|
+
const value = acc.resolve({
|
|
23
|
+
field: keyStr,
|
|
24
|
+
assertFieldType: "Input"
|
|
25
|
+
});
|
|
26
|
+
const key = [...keyPrefix, ...JSON.parse(keyStr)];
|
|
27
|
+
const converted = value === void 0 ? void 0 : resourceParser(value);
|
|
28
|
+
if (converted === void 0) isComplete = false;
|
|
29
|
+
if (converted !== void 0 || addEntriesWithNoData) data.push({
|
|
30
|
+
key,
|
|
31
|
+
value: converted
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return isComplete;
|
|
35
|
+
}
|
|
36
|
+
case RT_RESOURCE_MAP_PARTITIONED: {
|
|
37
|
+
let isComplete = acc.getInputsLocked();
|
|
38
|
+
for (const keyStr of acc.listInputFields()) {
|
|
39
|
+
const value = acc.resolve({
|
|
40
|
+
field: keyStr,
|
|
41
|
+
assertFieldType: "Input"
|
|
42
|
+
});
|
|
43
|
+
if (value === void 0) isComplete = false;
|
|
44
|
+
else {
|
|
45
|
+
const populateResult = populateResourceMapData(value, resourceParser, data, [...keyPrefix, ...JSON.parse(keyStr)], addEntriesWithNoData);
|
|
46
|
+
isComplete = isComplete && populateResult;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return isComplete;
|
|
50
|
+
}
|
|
51
|
+
default: throw new Error(`Unknown resource type: ${acc.resourceType.name}`);
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
function parseResourceMap(acc, resourceParser, addEntriesWithNoData = false) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
const data = [];
|
|
56
|
+
return {
|
|
57
|
+
isComplete: populateResourceMapData(acc, resourceParser, data, [], addEntriesWithNoData),
|
|
58
|
+
data
|
|
59
|
+
};
|
|
55
60
|
}
|
|
56
61
|
const removeIndexSuffix = (keyStr) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
if (keyStr.endsWith(".index")) return {
|
|
63
|
+
baseKey: keyStr.substring(0, keyStr.length - 6),
|
|
64
|
+
type: "index"
|
|
65
|
+
};
|
|
66
|
+
else if (keyStr.endsWith(".values")) return {
|
|
67
|
+
baseKey: keyStr.substring(0, keyStr.length - 7),
|
|
68
|
+
type: "values"
|
|
69
|
+
};
|
|
70
|
+
else throw new Error(`key must ends on .index/.values for binary p-column, got: ${keyStr}`);
|
|
66
71
|
};
|
|
67
|
-
// @TODO define a class with various resource map operations
|
|
68
72
|
/** Returns a list of all partition keys appeared in the p-column */
|
|
69
73
|
function getPartitionKeysList(acc) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
return { data, keyLength };
|
|
74
|
+
if (!acc) return void 0;
|
|
75
|
+
const rt = acc.resourceType.name;
|
|
76
|
+
const meta = acc.getDataAsJson();
|
|
77
|
+
const data = [];
|
|
78
|
+
let keyLength = 0;
|
|
79
|
+
switch (rt) {
|
|
80
|
+
case RT_RESOURCE_MAP:
|
|
81
|
+
keyLength = meta["keyLength"];
|
|
82
|
+
break;
|
|
83
|
+
case RT_RESOURCE_MAP_PARTITIONED:
|
|
84
|
+
keyLength = meta["partitionKeyLength"] + meta["keyLength"];
|
|
85
|
+
break;
|
|
86
|
+
case RT_JSON_PARTITIONED:
|
|
87
|
+
case RT_BINARY_PARTITIONED:
|
|
88
|
+
case RT_PARQUET_PARTITIONED:
|
|
89
|
+
keyLength = meta["partitionKeyLength"];
|
|
90
|
+
break;
|
|
91
|
+
case RT_BINARY_SUPER_PARTITIONED:
|
|
92
|
+
case RT_JSON_SUPER_PARTITIONED:
|
|
93
|
+
case RT_PARQUET_SUPER_PARTITIONED:
|
|
94
|
+
keyLength = meta["superPartitionKeyLength"] + meta["partitionKeyLength"];
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
switch (rt) {
|
|
98
|
+
case RT_RESOURCE_MAP:
|
|
99
|
+
case RT_JSON_PARTITIONED:
|
|
100
|
+
case RT_BINARY_PARTITIONED:
|
|
101
|
+
case RT_PARQUET_PARTITIONED:
|
|
102
|
+
for (let keyStr of acc.listInputFields()) {
|
|
103
|
+
if (rt === RT_BINARY_PARTITIONED) keyStr = removeIndexSuffix(keyStr).baseKey;
|
|
104
|
+
const key = [...JSON.parse(keyStr)];
|
|
105
|
+
data.push(key);
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case RT_RESOURCE_MAP_PARTITIONED:
|
|
109
|
+
case RT_BINARY_SUPER_PARTITIONED:
|
|
110
|
+
case RT_JSON_SUPER_PARTITIONED:
|
|
111
|
+
case RT_PARQUET_SUPER_PARTITIONED:
|
|
112
|
+
for (const supKeyStr of acc.listInputFields()) {
|
|
113
|
+
const keyPrefix = [...JSON.parse(supKeyStr)];
|
|
114
|
+
const value = acc.resolve({
|
|
115
|
+
field: supKeyStr,
|
|
116
|
+
assertFieldType: "Input"
|
|
117
|
+
});
|
|
118
|
+
if (value !== void 0) for (let keyStr of value.listInputFields()) {
|
|
119
|
+
if (rt === RT_BINARY_SUPER_PARTITIONED) keyStr = removeIndexSuffix(keyStr).baseKey;
|
|
120
|
+
const key = [...keyPrefix, ...JSON.parse(keyStr)];
|
|
121
|
+
data.push(key);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
data,
|
|
128
|
+
keyLength
|
|
129
|
+
};
|
|
128
130
|
}
|
|
129
131
|
function getUniquePartitionKeysForDataEntries(list) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const key = part.key;
|
|
141
|
-
if (key.length !== partitionKeyLength) {
|
|
142
|
-
throw new Error(`Key length (${key.length}) does not match partition length (${partitionKeyLength}) for key: ${JSON.stringify(key)}`);
|
|
143
|
-
}
|
|
144
|
-
for (let i = 0; i < partitionKeyLength; ++i) {
|
|
145
|
-
result[i].add(key[i]);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return result.map((s) => Array.from(s.values()));
|
|
132
|
+
if (list.type !== "JsonPartitioned" && list.type !== "BinaryPartitioned" && list.type !== "ParquetPartitioned") throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${list.type}`);
|
|
133
|
+
const { parts, partitionKeyLength } = list;
|
|
134
|
+
const result = [];
|
|
135
|
+
for (let i = 0; i < partitionKeyLength; ++i) result.push(/* @__PURE__ */ new Set());
|
|
136
|
+
for (const part of parts) {
|
|
137
|
+
const key = part.key;
|
|
138
|
+
if (key.length !== partitionKeyLength) throw new Error(`Key length (${key.length}) does not match partition length (${partitionKeyLength}) for key: ${JSON.stringify(key)}`);
|
|
139
|
+
for (let i = 0; i < partitionKeyLength; ++i) result[i].add(key[i]);
|
|
140
|
+
}
|
|
141
|
+
return result.map((s) => Array.from(s.values()));
|
|
149
142
|
}
|
|
150
143
|
function getUniquePartitionKeys(acc) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
for (const l of data) {
|
|
164
|
-
if (l.length !== keyLength) {
|
|
165
|
-
throw new Error("key length does not match partition length");
|
|
166
|
-
}
|
|
167
|
-
for (let i = 0; i < keyLength; ++i) {
|
|
168
|
-
result[i].add(l[i]);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return result.map((s) => Array.from(s.values()));
|
|
144
|
+
if (acc === void 0) return void 0;
|
|
145
|
+
if ((0, _milaboratories_pl_model_common.isDataInfoEntries)(acc)) return getUniquePartitionKeysForDataEntries(acc);
|
|
146
|
+
const list = getPartitionKeysList(acc);
|
|
147
|
+
if (!list) return void 0;
|
|
148
|
+
const { data, keyLength } = list;
|
|
149
|
+
const result = [];
|
|
150
|
+
for (let i = 0; i < keyLength; ++i) result.push(/* @__PURE__ */ new Set());
|
|
151
|
+
for (const l of data) {
|
|
152
|
+
if (l.length !== keyLength) throw new Error("key length does not match partition length");
|
|
153
|
+
for (let i = 0; i < keyLength; ++i) result[i].add(l[i]);
|
|
154
|
+
}
|
|
155
|
+
return result.map((s) => Array.from(s.values()));
|
|
172
156
|
}
|
|
173
157
|
/**
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
158
|
+
* Parses the PColumn data from a TreeNodeAccessor into a DataInfoEntries structure.
|
|
159
|
+
* Returns undefined if any required data is missing.
|
|
160
|
+
* Throws error on validation failures.
|
|
161
|
+
*
|
|
162
|
+
* @param acc - The TreeNodeAccessor containing PColumn data
|
|
163
|
+
* @param keyPrefix - Optional key prefix for recursive calls
|
|
164
|
+
* @returns DataInfoEntries representation of the PColumn data, or undefined if incomplete
|
|
165
|
+
*/
|
|
182
166
|
function parsePColumnData(acc, keyPrefix = []) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
case RT_PARQUET_SUPER_PARTITIONED: {
|
|
338
|
-
if (typeof meta?.superPartitionKeyLength !== "number" ||
|
|
339
|
-
typeof meta?.partitionKeyLength !== "number") {
|
|
340
|
-
throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);
|
|
341
|
-
}
|
|
342
|
-
const totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;
|
|
343
|
-
const parts = [];
|
|
344
|
-
// Process all super partitions
|
|
345
|
-
for (const supKeyStr of acc.listInputFields()) {
|
|
346
|
-
const superPartition = acc.resolve({ field: supKeyStr, assertFieldType: "Input" });
|
|
347
|
-
if (superPartition === undefined)
|
|
348
|
-
return undefined;
|
|
349
|
-
// Validate inner type
|
|
350
|
-
if (superPartition.resourceType.name !== RT_PARQUET_PARTITIONED) {
|
|
351
|
-
throw new Error(`Expected ${RT_PARQUET_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);
|
|
352
|
-
}
|
|
353
|
-
const innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));
|
|
354
|
-
if (innerResult === undefined)
|
|
355
|
-
return undefined;
|
|
356
|
-
if (innerResult.type !== "ParquetPartitioned")
|
|
357
|
-
throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);
|
|
358
|
-
parts.push(...innerResult.parts);
|
|
359
|
-
}
|
|
360
|
-
return {
|
|
361
|
-
type: "ParquetPartitioned",
|
|
362
|
-
partitionKeyLength: totalKeyLength,
|
|
363
|
-
parts,
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
default:
|
|
367
|
-
throw new Error(`Unknown resource type: ${resourceType}`);
|
|
368
|
-
}
|
|
167
|
+
if (acc === void 0) return void 0;
|
|
168
|
+
if (!acc.getIsReadyOrError()) return void 0;
|
|
169
|
+
const resourceType = acc.resourceType.name;
|
|
170
|
+
const meta = acc.getDataAsJson();
|
|
171
|
+
if (keyPrefix.length > 0 && (resourceType === RT_JSON_SUPER_PARTITIONED || resourceType === RT_BINARY_SUPER_PARTITIONED || resourceType === RT_PARQUET_SUPER_PARTITIONED)) throw new Error(`Unexpected nested super-partitioned resource: ${resourceType}`);
|
|
172
|
+
switch (resourceType) {
|
|
173
|
+
case RT_RESOURCE_MAP:
|
|
174
|
+
case RT_RESOURCE_MAP_PARTITIONED: throw new Error(`Only data columns are supported, got: ${resourceType}`);
|
|
175
|
+
case RT_JSON_PARTITIONED: {
|
|
176
|
+
if (typeof meta?.partitionKeyLength !== "number") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);
|
|
177
|
+
const parts = [];
|
|
178
|
+
for (const keyStr of acc.listInputFields()) {
|
|
179
|
+
const value = acc.resolve({
|
|
180
|
+
field: keyStr,
|
|
181
|
+
assertFieldType: "Input"
|
|
182
|
+
});
|
|
183
|
+
if (value === void 0) return void 0;
|
|
184
|
+
const key = [...keyPrefix, ...JSON.parse(keyStr)];
|
|
185
|
+
parts.push({
|
|
186
|
+
key,
|
|
187
|
+
value
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
type: "JsonPartitioned",
|
|
192
|
+
partitionKeyLength: meta.partitionKeyLength,
|
|
193
|
+
parts
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
case RT_BINARY_PARTITIONED: {
|
|
197
|
+
if (typeof meta?.partitionKeyLength !== "number") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);
|
|
198
|
+
const parts = [];
|
|
199
|
+
const baseKeys = /* @__PURE__ */ new Map();
|
|
200
|
+
for (const keyStr of acc.listInputFields()) {
|
|
201
|
+
const suffix = removeIndexSuffix(keyStr);
|
|
202
|
+
const value = acc.resolve({
|
|
203
|
+
field: keyStr,
|
|
204
|
+
assertFieldType: "Input"
|
|
205
|
+
});
|
|
206
|
+
if (value === void 0) return void 0;
|
|
207
|
+
let entry = baseKeys.get(suffix.baseKey);
|
|
208
|
+
if (!entry) {
|
|
209
|
+
entry = {};
|
|
210
|
+
baseKeys.set(suffix.baseKey, entry);
|
|
211
|
+
}
|
|
212
|
+
if (suffix.type === "index") entry.index = value;
|
|
213
|
+
else entry.values = value;
|
|
214
|
+
}
|
|
215
|
+
for (const [baseKeyStr, entry] of baseKeys.entries()) {
|
|
216
|
+
if (!entry.index || !entry.values) return void 0;
|
|
217
|
+
const key = [...keyPrefix, ...JSON.parse(baseKeyStr)];
|
|
218
|
+
parts.push({
|
|
219
|
+
key,
|
|
220
|
+
value: {
|
|
221
|
+
index: entry.index,
|
|
222
|
+
values: entry.values
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
type: "BinaryPartitioned",
|
|
228
|
+
partitionKeyLength: meta.partitionKeyLength,
|
|
229
|
+
parts
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
case RT_PARQUET_PARTITIONED: {
|
|
233
|
+
if (typeof meta?.partitionKeyLength !== "number") throw new Error(`Missing partitionKeyLength in metadata for ${resourceType}`);
|
|
234
|
+
const parts = [];
|
|
235
|
+
for (const keyStr of acc.listInputFields()) {
|
|
236
|
+
const value = acc.resolve({
|
|
237
|
+
field: keyStr,
|
|
238
|
+
assertFieldType: "Input"
|
|
239
|
+
});
|
|
240
|
+
if (value === void 0) return void 0;
|
|
241
|
+
const key = [...keyPrefix, ...JSON.parse(keyStr)];
|
|
242
|
+
parts.push({
|
|
243
|
+
key,
|
|
244
|
+
value
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return {
|
|
248
|
+
type: "ParquetPartitioned",
|
|
249
|
+
partitionKeyLength: meta.partitionKeyLength,
|
|
250
|
+
parts
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
case RT_JSON_SUPER_PARTITIONED: {
|
|
254
|
+
if (typeof meta?.superPartitionKeyLength !== "number" || typeof meta?.partitionKeyLength !== "number") throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);
|
|
255
|
+
const totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;
|
|
256
|
+
const parts = [];
|
|
257
|
+
for (const supKeyStr of acc.listInputFields()) {
|
|
258
|
+
const superPartition = acc.resolve({
|
|
259
|
+
field: supKeyStr,
|
|
260
|
+
assertFieldType: "Input"
|
|
261
|
+
});
|
|
262
|
+
if (superPartition === void 0) return void 0;
|
|
263
|
+
if (superPartition.resourceType.name !== RT_JSON_PARTITIONED) throw new Error(`Expected ${RT_JSON_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);
|
|
264
|
+
const innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));
|
|
265
|
+
if (innerResult === void 0) return void 0;
|
|
266
|
+
if (innerResult.type !== "JsonPartitioned") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);
|
|
267
|
+
parts.push(...innerResult.parts);
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
type: "JsonPartitioned",
|
|
271
|
+
partitionKeyLength: totalKeyLength,
|
|
272
|
+
parts
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
case RT_BINARY_SUPER_PARTITIONED: {
|
|
276
|
+
if (typeof meta?.superPartitionKeyLength !== "number" || typeof meta?.partitionKeyLength !== "number") throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);
|
|
277
|
+
const totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;
|
|
278
|
+
const parts = [];
|
|
279
|
+
for (const supKeyStr of acc.listInputFields()) {
|
|
280
|
+
const superPartition = acc.resolve({
|
|
281
|
+
field: supKeyStr,
|
|
282
|
+
assertFieldType: "Input"
|
|
283
|
+
});
|
|
284
|
+
if (superPartition === void 0) return void 0;
|
|
285
|
+
if (superPartition.resourceType.name !== RT_BINARY_PARTITIONED) throw new Error(`Expected ${RT_BINARY_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);
|
|
286
|
+
const innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));
|
|
287
|
+
if (innerResult === void 0) return void 0;
|
|
288
|
+
if (innerResult.type !== "BinaryPartitioned") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);
|
|
289
|
+
parts.push(...innerResult.parts);
|
|
290
|
+
}
|
|
291
|
+
return {
|
|
292
|
+
type: "BinaryPartitioned",
|
|
293
|
+
partitionKeyLength: totalKeyLength,
|
|
294
|
+
parts
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
case RT_PARQUET_SUPER_PARTITIONED: {
|
|
298
|
+
if (typeof meta?.superPartitionKeyLength !== "number" || typeof meta?.partitionKeyLength !== "number") throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${resourceType}`);
|
|
299
|
+
const totalKeyLength = meta.superPartitionKeyLength + meta.partitionKeyLength;
|
|
300
|
+
const parts = [];
|
|
301
|
+
for (const supKeyStr of acc.listInputFields()) {
|
|
302
|
+
const superPartition = acc.resolve({
|
|
303
|
+
field: supKeyStr,
|
|
304
|
+
assertFieldType: "Input"
|
|
305
|
+
});
|
|
306
|
+
if (superPartition === void 0) return void 0;
|
|
307
|
+
if (superPartition.resourceType.name !== RT_PARQUET_PARTITIONED) throw new Error(`Expected ${RT_PARQUET_PARTITIONED} inside ${resourceType}, but got ${superPartition.resourceType.name}`);
|
|
308
|
+
const innerResult = parsePColumnData(superPartition, JSON.parse(supKeyStr));
|
|
309
|
+
if (innerResult === void 0) return void 0;
|
|
310
|
+
if (innerResult.type !== "ParquetPartitioned") throw new Error(`Unexpected inner result type for ${resourceType}: ${innerResult.type}`);
|
|
311
|
+
parts.push(...innerResult.parts);
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
type: "ParquetPartitioned",
|
|
315
|
+
partitionKeyLength: totalKeyLength,
|
|
316
|
+
parts
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
default: throw new Error(`Unknown resource type: ${resourceType}`);
|
|
320
|
+
}
|
|
369
321
|
}
|
|
370
322
|
/**
|
|
371
|
-
|
|
323
|
+
* Converts or parses the input into DataInfoEntries format.
|
|
372
324
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
325
|
+
* @param acc - The input data, which can be TreeNodeAccessor, DataInfoEntries, DataInfo, or undefined.
|
|
326
|
+
* @returns The data in DataInfoEntries format, or undefined if the input was undefined or data is not ready.
|
|
327
|
+
*/
|
|
376
328
|
function convertOrParsePColumnData(acc) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
return plModelCommon.dataInfoToEntries(acc);
|
|
383
|
-
if (acc instanceof accessor.TreeNodeAccessor)
|
|
384
|
-
return parsePColumnData(acc);
|
|
385
|
-
throw new Error(`Unexpected input type: ${typeof acc}`);
|
|
329
|
+
if (acc === void 0) return void 0;
|
|
330
|
+
if ((0, _milaboratories_pl_model_common.isDataInfoEntries)(acc)) return acc;
|
|
331
|
+
if ((0, _milaboratories_pl_model_common.isDataInfo)(acc)) return (0, _milaboratories_pl_model_common.dataInfoToEntries)(acc);
|
|
332
|
+
if (acc instanceof require_accessor.TreeNodeAccessor) return parsePColumnData(acc);
|
|
333
|
+
throw new Error(`Unexpected input type: ${typeof acc}`);
|
|
386
334
|
}
|
|
387
335
|
function isPColumnReady(c) {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
else if (plModelCommon.isDataInfo(data)) {
|
|
399
|
-
plModelCommon.visitDataInfo(data, (v) => (ready &&= v.getIsReadyOrError()));
|
|
400
|
-
}
|
|
401
|
-
else if (!isValues(data)) {
|
|
402
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
403
|
-
throw Error(`unsupported column data type: ${data}`);
|
|
404
|
-
}
|
|
405
|
-
return ready;
|
|
336
|
+
const isValues = (d) => Array.isArray(d);
|
|
337
|
+
const isAccessor = (d) => d instanceof require_accessor.TreeNodeAccessor;
|
|
338
|
+
let ready = true;
|
|
339
|
+
const data = typeof c.data === "function" ? c.data() : c.data;
|
|
340
|
+
if (data == null) return false;
|
|
341
|
+
else if (isAccessor(data)) ready &&= data.getIsReadyOrError();
|
|
342
|
+
else if ((0, _milaboratories_pl_model_common.isDataInfo)(data)) (0, _milaboratories_pl_model_common.visitDataInfo)(data, (v) => ready &&= v.getIsReadyOrError());
|
|
343
|
+
else if (!isValues(data)) throw Error(`unsupported column data type: ${data}`);
|
|
344
|
+
return ready;
|
|
406
345
|
}
|
|
407
346
|
function allPColumnsReady(columns) {
|
|
408
|
-
|
|
347
|
+
return columns.every(isPColumnReady);
|
|
409
348
|
}
|
|
410
349
|
|
|
350
|
+
//#endregion
|
|
411
351
|
exports.RT_BINARY_PARTITIONED = RT_BINARY_PARTITIONED;
|
|
412
352
|
exports.RT_BINARY_SUPER_PARTITIONED = RT_BINARY_SUPER_PARTITIONED;
|
|
413
353
|
exports.RT_JSON_PARTITIONED = RT_JSON_PARTITIONED;
|
|
@@ -423,4 +363,4 @@ exports.getUniquePartitionKeys = getUniquePartitionKeys;
|
|
|
423
363
|
exports.isPColumnReady = isPColumnReady;
|
|
424
364
|
exports.parsePColumnData = parsePColumnData;
|
|
425
365
|
exports.parseResourceMap = parseResourceMap;
|
|
426
|
-
//# sourceMappingURL=pcolumn_data.cjs.map
|
|
366
|
+
//# sourceMappingURL=pcolumn_data.cjs.map
|