@finos/legend-application-data-cube 0.5.6 → 0.6.0
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/lib/application/LegendDataCubeApplicationConfig.d.ts +2 -0
- package/lib/application/LegendDataCubeApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendDataCubeApplicationConfig.js +2 -0
- package/lib/application/LegendDataCubeApplicationConfig.js.map +1 -1
- package/lib/application/__test-utils__/LegendDataCubeApplicationTestUtils.d.ts.map +1 -1
- package/lib/application/__test-utils__/LegendDataCubeApplicationTestUtils.js +1 -0
- package/lib/application/__test-utils__/LegendDataCubeApplicationTestUtils.js.map +1 -1
- package/lib/components/builder/LegendDataCubeCreator.d.ts.map +1 -1
- package/lib/components/builder/LegendDataCubeCreator.js +5 -1
- package/lib/components/builder/LegendDataCubeCreator.js.map +1 -1
- package/lib/components/builder/source/LakehouseConsumerDataCubeSourceBuilder.d.ts +5 -0
- package/lib/components/builder/source/LakehouseConsumerDataCubeSourceBuilder.d.ts.map +1 -0
- package/lib/components/builder/source/LakehouseConsumerDataCubeSourceBuilder.js +75 -0
- package/lib/components/builder/source/LakehouseConsumerDataCubeSourceBuilder.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/LegendDataCubeBaseStore.d.ts +2 -1
- package/lib/stores/LegendDataCubeBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendDataCubeBaseStore.js +6 -1
- package/lib/stores/LegendDataCubeBaseStore.js.map +1 -1
- package/lib/stores/LegendDataCubeDataCubeEngine.d.ts +1 -0
- package/lib/stores/LegendDataCubeDataCubeEngine.d.ts.map +1 -1
- package/lib/stores/LegendDataCubeDataCubeEngine.js +74 -10
- package/lib/stores/LegendDataCubeDataCubeEngine.js.map +1 -1
- package/lib/stores/builder/LegendDataCubeBuilderStore.d.ts +2 -1
- package/lib/stores/builder/LegendDataCubeBuilderStore.d.ts.map +1 -1
- package/lib/stores/builder/LegendDataCubeBuilderStore.js +3 -1
- package/lib/stores/builder/LegendDataCubeBuilderStore.js.map +1 -1
- package/lib/stores/builder/LegendDataCubeCreatorState.d.ts.map +1 -1
- package/lib/stores/builder/LegendDataCubeCreatorState.js +3 -0
- package/lib/stores/builder/LegendDataCubeCreatorState.js.map +1 -1
- package/lib/stores/builder/source/LakehouseConsumerDataCubeSourceBuilderState.d.ts +58 -0
- package/lib/stores/builder/source/LakehouseConsumerDataCubeSourceBuilderState.d.ts.map +1 -0
- package/lib/stores/builder/source/LakehouseConsumerDataCubeSourceBuilderState.js +187 -0
- package/lib/stores/builder/source/LakehouseConsumerDataCubeSourceBuilderState.js.map +1 -0
- package/lib/stores/builder/source/LakehouseProducerDataCubeSourceBuilderState.js +3 -3
- package/lib/stores/builder/source/LakehouseProducerDataCubeSourceBuilderState.js.map +1 -1
- package/lib/stores/builder/source/LakehouseProducerDataCubeSourceLoaderState.js +4 -4
- package/lib/stores/builder/source/LakehouseProducerDataCubeSourceLoaderState.js.map +1 -1
- package/lib/stores/builder/source/LegendDataCubeSourceBuilderState.d.ts +2 -1
- package/lib/stores/builder/source/LegendDataCubeSourceBuilderState.d.ts.map +1 -1
- package/lib/stores/builder/source/LegendDataCubeSourceBuilderState.js +1 -0
- package/lib/stores/builder/source/LegendDataCubeSourceBuilderState.js.map +1 -1
- package/lib/stores/model/LakehouseConsumerDataCubeSource.d.ts +32 -0
- package/lib/stores/model/LakehouseConsumerDataCubeSource.d.ts.map +1 -0
- package/lib/stores/model/LakehouseConsumerDataCubeSource.js +38 -0
- package/lib/stores/model/LakehouseConsumerDataCubeSource.js.map +1 -0
- package/lib/stores/model/{IngestDefinitionDataCubeSource.d.ts → LakehouseProducerDataCubeSource.d.ts} +4 -4
- package/lib/stores/model/LakehouseProducerDataCubeSource.d.ts.map +1 -0
- package/lib/stores/model/{IngestDefinitionDataCubeSource.js → LakehouseProducerDataCubeSource.js} +4 -4
- package/lib/stores/model/LakehouseProducerDataCubeSource.js.map +1 -0
- package/package.json +9 -9
- package/src/application/LegendDataCubeApplicationConfig.ts +8 -0
- package/src/application/__test-utils__/LegendDataCubeApplicationTestUtils.ts +1 -0
- package/src/components/builder/LegendDataCubeCreator.tsx +9 -0
- package/src/components/builder/source/LakehouseConsumerDataCubeSourceBuilder.tsx +149 -0
- package/src/stores/LegendDataCubeBaseStore.ts +8 -0
- package/src/stores/LegendDataCubeDataCubeEngine.ts +128 -13
- package/src/stores/builder/LegendDataCubeBuilderStore.tsx +4 -1
- package/src/stores/builder/LegendDataCubeCreatorState.tsx +10 -0
- package/src/stores/builder/source/LakehouseConsumerDataCubeSourceBuilderState.ts +277 -0
- package/src/stores/builder/source/LakehouseProducerDataCubeSourceBuilderState.ts +3 -3
- package/src/stores/builder/source/LakehouseProducerDataCubeSourceLoaderState.ts +4 -4
- package/src/stores/builder/source/LegendDataCubeSourceBuilderState.ts +1 -0
- package/src/stores/model/LakehouseConsumerDataCubeSource.ts +52 -0
- package/src/stores/model/{IngestDefinitionDataCubeSource.ts → LakehouseProducerDataCubeSource.ts} +3 -3
- package/tsconfig.json +4 -1
- package/lib/stores/model/IngestDefinitionDataCubeSource.d.ts.map +0 -1
- package/lib/stores/model/IngestDefinitionDataCubeSource.js.map +0 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { action, flow, makeObservable, observable } from 'mobx';
|
|
18
|
+
import {
|
|
19
|
+
LegendDataCubeSourceBuilderState,
|
|
20
|
+
LegendDataCubeSourceBuilderType,
|
|
21
|
+
} from './LegendDataCubeSourceBuilderState.js';
|
|
22
|
+
import {
|
|
23
|
+
assertErrorThrown,
|
|
24
|
+
guaranteeNonNullable,
|
|
25
|
+
type GeneratorFn,
|
|
26
|
+
type PlainObject,
|
|
27
|
+
} from '@finos/legend-shared';
|
|
28
|
+
import type { DataCubeAlertService } from '@finos/legend-data-cube';
|
|
29
|
+
import type { LegendDataCubeApplicationStore } from '../../LegendDataCubeBaseStore.js';
|
|
30
|
+
import type { LegendDataCubeDataCubeEngine } from '../../LegendDataCubeDataCubeEngine.js';
|
|
31
|
+
import {
|
|
32
|
+
IngestDeploymentServerConfig,
|
|
33
|
+
type LakehousePlatformServerClient,
|
|
34
|
+
type LakehouseContractServerClient,
|
|
35
|
+
} from '@finos/legend-server-lakehouse';
|
|
36
|
+
import {
|
|
37
|
+
DepotScope,
|
|
38
|
+
VersionedProjectData,
|
|
39
|
+
type DepotServerClient,
|
|
40
|
+
type StoredSummaryEntity,
|
|
41
|
+
} from '@finos/legend-server-depot';
|
|
42
|
+
import {
|
|
43
|
+
CORE_PURE_PATH,
|
|
44
|
+
type V1_EntitlementsDataProductDetailsResponse,
|
|
45
|
+
type V1_EntitlementsDataProductDetails,
|
|
46
|
+
} from '@finos/legend-graph';
|
|
47
|
+
import { RawLakehouseConsumerDataCubeSource } from '../../model/LakehouseConsumerDataCubeSource.js';
|
|
48
|
+
|
|
49
|
+
export class LakehouseConsumerDataCubeSourceBuilderState extends LegendDataCubeSourceBuilderState {
|
|
50
|
+
warehouse: string | undefined;
|
|
51
|
+
selectedDataProduct: string | undefined;
|
|
52
|
+
selectedAccessPoint: string | undefined;
|
|
53
|
+
selectedEnvironment: string | undefined;
|
|
54
|
+
paths: string[] = [];
|
|
55
|
+
ingestEnvironment: string | undefined;
|
|
56
|
+
dataProducts: StoredSummaryEntity[] = [];
|
|
57
|
+
dataProductMap: Record<string, V1_EntitlementsDataProductDetails> = {};
|
|
58
|
+
accessPoints: string[] = [];
|
|
59
|
+
environments: string[] = [];
|
|
60
|
+
dpCoordinates: VersionedProjectData | undefined;
|
|
61
|
+
|
|
62
|
+
private readonly _depotServerClient: DepotServerClient;
|
|
63
|
+
private readonly _platformServerClient: LakehousePlatformServerClient;
|
|
64
|
+
private readonly _contractServerClient: LakehouseContractServerClient;
|
|
65
|
+
|
|
66
|
+
constructor(
|
|
67
|
+
application: LegendDataCubeApplicationStore,
|
|
68
|
+
engine: LegendDataCubeDataCubeEngine,
|
|
69
|
+
depotServerClient: DepotServerClient,
|
|
70
|
+
platformServerClient: LakehousePlatformServerClient,
|
|
71
|
+
contractServerClient: LakehouseContractServerClient,
|
|
72
|
+
alertService: DataCubeAlertService,
|
|
73
|
+
) {
|
|
74
|
+
super(application, engine, alertService);
|
|
75
|
+
this._platformServerClient = platformServerClient;
|
|
76
|
+
this._depotServerClient = depotServerClient;
|
|
77
|
+
this._contractServerClient = contractServerClient;
|
|
78
|
+
|
|
79
|
+
makeObservable(this, {
|
|
80
|
+
warehouse: observable,
|
|
81
|
+
dataProducts: observable,
|
|
82
|
+
selectedDataProduct: observable,
|
|
83
|
+
accessPoints: observable,
|
|
84
|
+
environments: observable,
|
|
85
|
+
selectedAccessPoint: observable,
|
|
86
|
+
selectedEnvironment: observable,
|
|
87
|
+
fetchDataProductEnvironments: flow,
|
|
88
|
+
loadDataProducts: flow,
|
|
89
|
+
|
|
90
|
+
setWarehouse: action,
|
|
91
|
+
setDataProducts: action,
|
|
92
|
+
setSelectedDataProduct: action,
|
|
93
|
+
setAccessPoints: action,
|
|
94
|
+
setEnvironments: action,
|
|
95
|
+
setSelectedAccessPoint: action,
|
|
96
|
+
setSelectedEnvironment: action,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
setWarehouse(warehouse: string | undefined) {
|
|
101
|
+
this.warehouse = warehouse;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
setDataProducts(dataProducts: StoredSummaryEntity[]) {
|
|
105
|
+
this.dataProducts = dataProducts;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
setSelectedDataProduct(dataProduct: string | undefined) {
|
|
109
|
+
this.selectedDataProduct = dataProduct;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
setAccessPoints(accessPoints: string[]) {
|
|
113
|
+
this.accessPoints = accessPoints;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
setEnvironments(environments: string[]) {
|
|
117
|
+
this.environments = environments;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
setSelectedAccessPoint(accessPoint: string | undefined) {
|
|
121
|
+
this.selectedAccessPoint = accessPoint;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
setSelectedEnvironment(environment: string | undefined) {
|
|
125
|
+
this.selectedEnvironment = environment;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
*loadDataProducts(): GeneratorFn<void> {
|
|
129
|
+
try {
|
|
130
|
+
this.setDataProducts(
|
|
131
|
+
(yield this._depotServerClient.getEntitiesSummaryByClassifier(
|
|
132
|
+
CORE_PURE_PATH.DATA_PRODUCT,
|
|
133
|
+
{
|
|
134
|
+
scope: DepotScope.RELEASES,
|
|
135
|
+
latest: true,
|
|
136
|
+
summary: true,
|
|
137
|
+
},
|
|
138
|
+
)) as StoredSummaryEntity[],
|
|
139
|
+
);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
assertErrorThrown(error);
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
*fetchDataProductEnvironments(
|
|
147
|
+
access_token: string | undefined,
|
|
148
|
+
): GeneratorFn<void> {
|
|
149
|
+
this.resetDataProduct();
|
|
150
|
+
const selectedDp = guaranteeNonNullable(this.selectedDataProduct);
|
|
151
|
+
const dataProductResponse =
|
|
152
|
+
(yield this._contractServerClient.getDataProduct(
|
|
153
|
+
selectedDp.split('::').pop() ?? '',
|
|
154
|
+
access_token,
|
|
155
|
+
)) as V1_EntitlementsDataProductDetailsResponse;
|
|
156
|
+
if (dataProductResponse.dataProducts) {
|
|
157
|
+
this.dataProductMap = dataProductResponse.dataProducts
|
|
158
|
+
.filter((dp) => Boolean(dp.lakehouseEnvironment))
|
|
159
|
+
.reduce(
|
|
160
|
+
(acc, dp) => {
|
|
161
|
+
const envType = guaranteeNonNullable(
|
|
162
|
+
dp.lakehouseEnvironment,
|
|
163
|
+
).type.valueOf();
|
|
164
|
+
acc[envType] = dp;
|
|
165
|
+
return acc;
|
|
166
|
+
},
|
|
167
|
+
{} as Record<string, V1_EntitlementsDataProductDetails>,
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
this.setEnvironments(Object.keys(this.dataProductMap));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
fetchAccessPoints() {
|
|
175
|
+
this.resetEnvironment();
|
|
176
|
+
const selectedEnvironment = guaranteeNonNullable(this.selectedEnvironment);
|
|
177
|
+
const dataProduct = this.dataProductMap[selectedEnvironment];
|
|
178
|
+
|
|
179
|
+
if (
|
|
180
|
+
dataProduct?.origin &&
|
|
181
|
+
'group' in dataProduct.origin &&
|
|
182
|
+
'artifact' in dataProduct.origin &&
|
|
183
|
+
'version' in dataProduct.origin
|
|
184
|
+
) {
|
|
185
|
+
const versionedData = new VersionedProjectData();
|
|
186
|
+
versionedData.groupId = dataProduct.origin.group as string;
|
|
187
|
+
versionedData.artifactId = dataProduct.origin.artifact as string;
|
|
188
|
+
versionedData.versionId = dataProduct.origin.version as string;
|
|
189
|
+
this.dpCoordinates = versionedData;
|
|
190
|
+
}
|
|
191
|
+
this.setAccessPoints(
|
|
192
|
+
dataProduct?.dataProduct.accessPoints.map(
|
|
193
|
+
(accessPoint) => accessPoint.name,
|
|
194
|
+
) ?? [],
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
async fetchEnvironment(access_token: string | undefined) {
|
|
199
|
+
const selectedEnvironment = guaranteeNonNullable(this.selectedEnvironment);
|
|
200
|
+
const dataProduct = this.dataProductMap[selectedEnvironment];
|
|
201
|
+
const config = IngestDeploymentServerConfig.serialization.fromJson(
|
|
202
|
+
await this._platformServerClient.findProducerServer(
|
|
203
|
+
guaranteeNonNullable(dataProduct?.deploymentId),
|
|
204
|
+
'DEPLOYMENT',
|
|
205
|
+
access_token,
|
|
206
|
+
),
|
|
207
|
+
);
|
|
208
|
+
const baseUrl = new URL(config.ingestServerUrl).hostname;
|
|
209
|
+
const subdomain = baseUrl.split('.')[0];
|
|
210
|
+
const parts = subdomain?.split('-');
|
|
211
|
+
const env = parts?.slice(0, -1).join('-');
|
|
212
|
+
this.ingestEnvironment = env;
|
|
213
|
+
this.setWarehouse('LAKEHOUSE_CONSUMER_DEFAULT_WH');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
reset() {
|
|
217
|
+
this.setWarehouse(undefined);
|
|
218
|
+
this.setDataProducts([]);
|
|
219
|
+
this.setSelectedDataProduct(undefined);
|
|
220
|
+
this.setAccessPoints([]);
|
|
221
|
+
this.setEnvironments([]);
|
|
222
|
+
this.setSelectedAccessPoint(undefined);
|
|
223
|
+
this.setSelectedEnvironment(undefined);
|
|
224
|
+
this.dpCoordinates = undefined;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
resetDataProduct() {
|
|
228
|
+
this.setWarehouse(undefined);
|
|
229
|
+
this.setAccessPoints([]);
|
|
230
|
+
this.setEnvironments([]);
|
|
231
|
+
this.setSelectedAccessPoint(undefined);
|
|
232
|
+
this.setSelectedEnvironment(undefined);
|
|
233
|
+
this.dpCoordinates = undefined;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
resetEnvironment() {
|
|
237
|
+
this.setWarehouse(undefined);
|
|
238
|
+
this.setAccessPoints([]);
|
|
239
|
+
this.setSelectedAccessPoint(undefined);
|
|
240
|
+
this.dpCoordinates = undefined;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
override get label(): LegendDataCubeSourceBuilderType {
|
|
244
|
+
return LegendDataCubeSourceBuilderType.LAKEHOUSE_CONSUMER;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
override get isValid(): boolean {
|
|
248
|
+
return (
|
|
249
|
+
Boolean(this.warehouse) &&
|
|
250
|
+
Boolean(this.selectedAccessPoint) &&
|
|
251
|
+
Boolean(this.selectedDataProduct) &&
|
|
252
|
+
Boolean(this.selectedEnvironment) &&
|
|
253
|
+
Boolean(this.dpCoordinates)
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
override async generateSourceData(): Promise<PlainObject> {
|
|
258
|
+
// build data cube source
|
|
259
|
+
this.paths = [];
|
|
260
|
+
this.paths.push(
|
|
261
|
+
...[
|
|
262
|
+
guaranteeNonNullable(this.selectedDataProduct),
|
|
263
|
+
guaranteeNonNullable(this.selectedAccessPoint),
|
|
264
|
+
],
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
const rawSource = new RawLakehouseConsumerDataCubeSource();
|
|
268
|
+
rawSource.environment = guaranteeNonNullable(this.ingestEnvironment);
|
|
269
|
+
rawSource.dpCoordinates = guaranteeNonNullable(this.dpCoordinates);
|
|
270
|
+
rawSource.paths = this.paths;
|
|
271
|
+
rawSource.warehouse = guaranteeNonNullable(this.warehouse);
|
|
272
|
+
|
|
273
|
+
return Promise.resolve(
|
|
274
|
+
RawLakehouseConsumerDataCubeSource.serialization.toJson(rawSource),
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
@@ -23,7 +23,7 @@ import { guaranteeNonNullable, type PlainObject } from '@finos/legend-shared';
|
|
|
23
23
|
import type { DataCubeAlertService } from '@finos/legend-data-cube';
|
|
24
24
|
import type { LegendDataCubeApplicationStore } from '../../LegendDataCubeBaseStore.js';
|
|
25
25
|
import type { LegendDataCubeDataCubeEngine } from '../../LegendDataCubeDataCubeEngine.js';
|
|
26
|
-
import {
|
|
26
|
+
import { RawLakehouseProducerDataCubeSource } from '../../model/LakehouseProducerDataCubeSource.js';
|
|
27
27
|
import {
|
|
28
28
|
IngestDeploymentServerConfig,
|
|
29
29
|
ProducerEnvironment,
|
|
@@ -225,7 +225,7 @@ export class LakehouseProducerDataCubeSourceBuilderState extends LegendDataCubeS
|
|
|
225
225
|
|
|
226
226
|
// build data cube source
|
|
227
227
|
this.createPath();
|
|
228
|
-
const rawSource = new
|
|
228
|
+
const rawSource = new RawLakehouseProducerDataCubeSource();
|
|
229
229
|
rawSource.ingestDefinitionUrn = guaranteeNonNullable(
|
|
230
230
|
this.selectedIngestUrn,
|
|
231
231
|
);
|
|
@@ -234,7 +234,7 @@ export class LakehouseProducerDataCubeSourceBuilderState extends LegendDataCubeS
|
|
|
234
234
|
rawSource.warehouse = guaranteeNonNullable(this.warehouse);
|
|
235
235
|
|
|
236
236
|
return Promise.resolve(
|
|
237
|
-
|
|
237
|
+
RawLakehouseProducerDataCubeSource.serialization.toJson(rawSource),
|
|
238
238
|
);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
@@ -24,7 +24,7 @@ import type { LegendDataCubeDataCubeEngine } from '../../LegendDataCubeDataCubeE
|
|
|
24
24
|
import { LegendDataCubeSourceLoaderState } from './LegendDataCubeSourceLoaderState.js';
|
|
25
25
|
import type { DataCubeAlertService } from '@finos/legend-data-cube';
|
|
26
26
|
import type { PersistentDataCube } from '@finos/legend-graph';
|
|
27
|
-
import {
|
|
27
|
+
import { RawLakehouseProducerDataCubeSource } from '../../model/LakehouseProducerDataCubeSource.js';
|
|
28
28
|
import type { LakehouseIngestServerClient } from '@finos/legend-server-lakehouse';
|
|
29
29
|
import { action, makeObservable, observable } from 'mobx';
|
|
30
30
|
import { LegendDataCubeSourceBuilderType } from './LegendDataCubeSourceBuilderState.js';
|
|
@@ -84,7 +84,7 @@ export class LakehouseProducerDataCubeSourceLoaderState extends LegendDataCubeSo
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
reset() {
|
|
87
|
-
const rawSource =
|
|
87
|
+
const rawSource = RawLakehouseProducerDataCubeSource.serialization.fromJson(
|
|
88
88
|
this.sourceData,
|
|
89
89
|
);
|
|
90
90
|
this.setIngestDefinitionUrn(rawSource.ingestDefinitionUrn);
|
|
@@ -106,7 +106,7 @@ export class LakehouseProducerDataCubeSourceLoaderState extends LegendDataCubeSo
|
|
|
106
106
|
|
|
107
107
|
override async load(source: PlainObject | undefined) {
|
|
108
108
|
const deserializedSource =
|
|
109
|
-
|
|
109
|
+
RawLakehouseProducerDataCubeSource.serialization.fromJson(
|
|
110
110
|
guaranteeNonNullable(source),
|
|
111
111
|
);
|
|
112
112
|
|
|
@@ -116,7 +116,7 @@ export class LakehouseProducerDataCubeSourceLoaderState extends LegendDataCubeSo
|
|
|
116
116
|
)[0] as PlainObject,
|
|
117
117
|
);
|
|
118
118
|
|
|
119
|
-
return
|
|
119
|
+
return RawLakehouseProducerDataCubeSource.serialization.toJson(
|
|
120
120
|
deserializedSource,
|
|
121
121
|
);
|
|
122
122
|
}
|
|
@@ -28,6 +28,7 @@ export enum LegendDataCubeSourceBuilderType {
|
|
|
28
28
|
LOCAL_FILE = 'Local File',
|
|
29
29
|
USER_DEFINED_FUNCTION = 'User Defined Function',
|
|
30
30
|
LAKEHOUSE_PRODUCER = 'Lakehouse Producer',
|
|
31
|
+
LAKEHOUSE_CONSUMER = 'Lakehouse Consumer',
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export abstract class LegendDataCubeSourceBuilderState {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { DataCubeSource } from '@finos/legend-data-cube';
|
|
18
|
+
import type { V1_PureModelContextComposite } from '@finos/legend-graph';
|
|
19
|
+
import { VersionedProjectData } from '@finos/legend-server-depot';
|
|
20
|
+
import {
|
|
21
|
+
SerializationFactory,
|
|
22
|
+
usingConstantValueSchema,
|
|
23
|
+
usingModelSchema,
|
|
24
|
+
type PlainObject,
|
|
25
|
+
} from '@finos/legend-shared';
|
|
26
|
+
import { createModelSchema, list, primitive } from 'serializr';
|
|
27
|
+
|
|
28
|
+
export const LAKEHOUSE_CONSUMER_DATA_CUBE_SOURCE_TYPE = 'lakehouseConsumer';
|
|
29
|
+
|
|
30
|
+
export class LakehouseConsumerDataCubeSource extends DataCubeSource {
|
|
31
|
+
model!: PlainObject<V1_PureModelContextComposite>;
|
|
32
|
+
runtime!: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class RawLakehouseConsumerDataCubeSource {
|
|
36
|
+
dpCoordinates!: VersionedProjectData;
|
|
37
|
+
warehouse!: string;
|
|
38
|
+
environment!: string;
|
|
39
|
+
paths!: string[];
|
|
40
|
+
|
|
41
|
+
static readonly serialization = new SerializationFactory(
|
|
42
|
+
createModelSchema(RawLakehouseConsumerDataCubeSource, {
|
|
43
|
+
_type: usingConstantValueSchema(LAKEHOUSE_CONSUMER_DATA_CUBE_SOURCE_TYPE),
|
|
44
|
+
dpCoordinates: usingModelSchema(
|
|
45
|
+
VersionedProjectData.serialization.schema,
|
|
46
|
+
),
|
|
47
|
+
warehouse: primitive(),
|
|
48
|
+
environment: primitive(),
|
|
49
|
+
paths: list(primitive()),
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
}
|
package/src/stores/model/{IngestDefinitionDataCubeSource.ts → LakehouseProducerDataCubeSource.ts}
RENAMED
|
@@ -25,19 +25,19 @@ import { createModelSchema, list, primitive } from 'serializr';
|
|
|
25
25
|
|
|
26
26
|
export const LAKEHOUSE_PRODUCER_DATA_CUBE_SOURCE_TYPE = 'lakehouseProducer';
|
|
27
27
|
|
|
28
|
-
export class
|
|
28
|
+
export class LakehouseProducerDataCubeSource extends DataCubeSource {
|
|
29
29
|
model!: PlainObject<V1_PureModelContextData>;
|
|
30
30
|
runtime!: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export class
|
|
33
|
+
export class RawLakehouseProducerDataCubeSource {
|
|
34
34
|
ingestDefinitionUrn!: string;
|
|
35
35
|
warehouse!: string;
|
|
36
36
|
ingestServerUrl!: string;
|
|
37
37
|
paths!: string[];
|
|
38
38
|
|
|
39
39
|
static readonly serialization = new SerializationFactory(
|
|
40
|
-
createModelSchema(
|
|
40
|
+
createModelSchema(RawLakehouseProducerDataCubeSource, {
|
|
41
41
|
_type: usingConstantValueSchema(LAKEHOUSE_PRODUCER_DATA_CUBE_SOURCE_TYPE),
|
|
42
42
|
ingestDefinitionUrn: primitive(),
|
|
43
43
|
warehouse: primitive(),
|
package/tsconfig.json
CHANGED
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"./src/stores/LegendDataCubeDataCubeEngine.ts",
|
|
68
68
|
"./src/stores/LegendDataCubeDuckDBEngine.ts",
|
|
69
69
|
"./src/stores/builder/source/FreeformTDSExpressionDataCubeSourceBuilderState.ts",
|
|
70
|
+
"./src/stores/builder/source/LakehouseConsumerDataCubeSourceBuilderState.ts",
|
|
70
71
|
"./src/stores/builder/source/LakehouseProducerDataCubeSourceBuilderState.ts",
|
|
71
72
|
"./src/stores/builder/source/LakehouseProducerDataCubeSourceLoaderState.ts",
|
|
72
73
|
"./src/stores/builder/source/LegendDataCubeSourceBuilderState.ts",
|
|
@@ -75,7 +76,8 @@
|
|
|
75
76
|
"./src/stores/builder/source/LocalFileDataCubeSourceBuilderState.ts",
|
|
76
77
|
"./src/stores/builder/source/LocalFileDataCubeSourceLoaderState.ts",
|
|
77
78
|
"./src/stores/builder/source/UserDefinedFunctionDataCubeSourceBuilderState.ts",
|
|
78
|
-
"./src/stores/model/
|
|
79
|
+
"./src/stores/model/LakehouseConsumerDataCubeSource.ts",
|
|
80
|
+
"./src/stores/model/LakehouseProducerDataCubeSource.ts",
|
|
79
81
|
"./src/stores/model/LegendQueryDataCubeSource.ts",
|
|
80
82
|
"./src/stores/model/LocalFileDataCubeSource.ts",
|
|
81
83
|
"./src/application/LegendDataCube.tsx",
|
|
@@ -92,6 +94,7 @@
|
|
|
92
94
|
"./src/components/builder/LegendDataCubeSaver.tsx",
|
|
93
95
|
"./src/components/builder/LegendDataCubeSourceViewer.tsx",
|
|
94
96
|
"./src/components/builder/source/FreeformTDSExpressionDataCubeSourceBuilder.tsx",
|
|
97
|
+
"./src/components/builder/source/LakehouseConsumerDataCubeSourceBuilder.tsx",
|
|
95
98
|
"./src/components/builder/source/LakehouseProducerDataCubeSourceBuilder.tsx",
|
|
96
99
|
"./src/components/builder/source/LakehouseProducerDataCubeSourceLoader.tsx",
|
|
97
100
|
"./src/components/builder/source/LegendDataCubeSourceLoader.tsx",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IngestDefinitionDataCubeSource.d.ts","sourceRoot":"","sources":["../../../src/stores/model/IngestDefinitionDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,oBAAoB,EAEpB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAE5E,qBAAa,8BAA+B,SAAQ,cAAc;IAChE,KAAK,EAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAC7C,OAAO,EAAG,MAAM,CAAC;CAClB;AAED,qBAAa,iCAAiC;IAC5C,mBAAmB,EAAG,MAAM,CAAC;IAC7B,SAAS,EAAG,MAAM,CAAC;IACnB,eAAe,EAAG,MAAM,CAAC;IACzB,KAAK,EAAG,MAAM,EAAE,CAAC;IAEjB,MAAM,CAAC,QAAQ,CAAC,aAAa,0DAQ3B;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IngestDefinitionDataCubeSource.js","sourceRoot":"","sources":["../../../src/stores/model/IngestDefinitionDataCubeSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/D,MAAM,CAAC,MAAM,wCAAwC,GAAG,mBAAmB,CAAC;AAE5E,MAAM,OAAO,8BAA+B,SAAQ,cAAc;IAChE,KAAK,CAAwC;IAC7C,OAAO,CAAU;CAClB;AAED,MAAM,OAAO,iCAAiC;IAC5C,mBAAmB,CAAU;IAC7B,SAAS,CAAU;IACnB,eAAe,CAAU;IACzB,KAAK,CAAY;IAEjB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,iCAAiC,EAAE;QACnD,KAAK,EAAE,wBAAwB,CAAC,wCAAwC,CAAC;QACzE,mBAAmB,EAAE,SAAS,EAAE;QAChC,SAAS,EAAE,SAAS,EAAE;QACtB,eAAe,EAAE,SAAS,EAAE;QAC5B,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;KACzB,CAAC,CACH,CAAC"}
|