@finos/legend-graph 32.3.2 → 32.3.3
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/graph/BasicModel.d.ts +2 -1
- package/lib/graph/BasicModel.d.ts.map +1 -1
- package/lib/graph/BasicModel.js +3 -2
- package/lib/graph/BasicModel.js.map +1 -1
- package/lib/graph/Core_HashUtils.d.ts +4 -0
- package/lib/graph/Core_HashUtils.d.ts.map +1 -1
- package/lib/graph/Core_HashUtils.js +4 -0
- package/lib/graph/Core_HashUtils.js.map +1 -1
- package/lib/graph/DependencyManager.d.ts +2 -0
- package/lib/graph/DependencyManager.d.ts.map +1 -1
- package/lib/graph/DependencyManager.js +2 -0
- package/lib/graph/DependencyManager.js.map +1 -1
- package/lib/graph/MetaModelConst.d.ts +2 -1
- package/lib/graph/MetaModelConst.d.ts.map +1 -1
- package/lib/graph/MetaModelConst.js +1 -0
- package/lib/graph/MetaModelConst.js.map +1 -1
- package/lib/graph/PureModel.d.ts +3 -0
- package/lib/graph/PureModel.d.ts.map +1 -1
- package/lib/graph/PureModel.js +10 -0
- package/lib/graph/PureModel.js.map +1 -1
- package/lib/graph/helpers/STO_Internal_Relational_Helper.d.ts +29 -0
- package/lib/graph/helpers/STO_Internal_Relational_Helper.d.ts.map +1 -0
- package/lib/graph/helpers/STO_Internal_Relational_Helper.js +66 -0
- package/lib/graph/helpers/STO_Internal_Relational_Helper.js.map +1 -0
- package/lib/graph/helpers/STO_Relational_Helper.d.ts +3 -2
- package/lib/graph/helpers/STO_Relational_Helper.d.ts.map +1 -1
- package/lib/graph/helpers/STO_Relational_Helper.js +14 -5
- package/lib/graph/helpers/STO_Relational_Helper.js.map +1 -1
- package/lib/graph/metamodel/pure/data/EmbeddedData.d.ts +16 -0
- package/lib/graph/metamodel/pure/data/EmbeddedData.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/data/EmbeddedData.js +34 -0
- package/lib/graph/metamodel/pure/data/EmbeddedData.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/function/test/{FunctionStoreTestData.d.ts → FunctionTestData.d.ts} +4 -4
- package/lib/graph/metamodel/pure/packageableElements/function/test/FunctionTestData.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/function/test/{FunctionStoreTestData.js → FunctionTestData.js} +4 -4
- package/lib/graph/metamodel/pure/packageableElements/function/test/FunctionTestData.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/function/test/FunctionTestSuite.d.ts +2 -2
- package/lib/graph/metamodel/pure/packageableElements/function/test/FunctionTestSuite.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/function/test/FunctionTestSuite.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/runtime/Runtime.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/runtime/Runtime.js +1 -1
- package/lib/graph/metamodel/pure/packageableElements/runtime/Runtime.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/Database.d.ts +11 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/Database.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/Database.js +17 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/Database.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/IncludeStore.d.ts +28 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/IncludeStore.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/IncludeStore.js +34 -0
- package/lib/graph/metamodel/pure/packageableElements/store/relational/model/IncludeStore.js.map +1 -0
- package/lib/graph-manager/action/changeDetection/DomainObserverHelper.d.ts +2 -2
- package/lib/graph-manager/action/changeDetection/DomainObserverHelper.d.ts.map +1 -1
- package/lib/graph-manager/action/changeDetection/DomainObserverHelper.js +1 -1
- package/lib/graph-manager/action/changeDetection/DomainObserverHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +4 -0
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.d.ts +16 -0
- package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.js +34 -0
- package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/{V1_FunctionStoreTestData.d.ts → V1_FunctionTestData.d.ts} +3 -3
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/V1_FunctionTestData.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/{V1_FunctionStoreTestData.js → V1_FunctionTestData.js} +4 -4
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/V1_FunctionTestData.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/V1_FunctionTestSuite.d.ts +2 -2
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/V1_FunctionTestSuite.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/V1_FunctionTestSuite.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_Database.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_Database.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_Database.js +2 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_Database.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_IncludeStore.d.ts +23 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_IncludeStore.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_IncludeStore.js +30 -0
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_IncludeStore.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_CoreTransformerHelper.d.ts +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_CoreTransformerHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_CoreTransformerHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.js +22 -2
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.d.ts +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.js +19 -2
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.js +3 -3
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_RuntimeTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_RuntimeTransformer.js +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_RuntimeTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.js +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +13 -3
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts +3 -3
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js +33 -6
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js +3 -3
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.js +16 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.d.ts +4 -2
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js +56 -18
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js +5 -5
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.js +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.d.ts +5 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js +19 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js +12 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionSerializationHelper.js +27 -10
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionSerializationHelper.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/graph/BasicModel.ts +6 -2
- package/src/graph/Core_HashUtils.ts +4 -0
- package/src/graph/DependencyManager.ts +8 -0
- package/src/graph/MetaModelConst.ts +1 -0
- package/src/graph/PureModel.ts +19 -0
- package/src/graph/helpers/STO_Internal_Relational_Helper.ts +97 -0
- package/src/graph/helpers/STO_Relational_Helper.ts +30 -9
- package/src/graph/metamodel/pure/data/EmbeddedData.ts +42 -0
- package/src/graph/metamodel/pure/packageableElements/function/test/{FunctionStoreTestData.ts → FunctionTestData.ts} +4 -4
- package/src/graph/metamodel/pure/packageableElements/function/test/FunctionTestSuite.ts +2 -2
- package/src/graph/metamodel/pure/packageableElements/runtime/Runtime.ts +1 -4
- package/src/graph/metamodel/pure/packageableElements/store/relational/model/Database.ts +27 -0
- package/src/graph/metamodel/pure/packageableElements/store/relational/model/IncludeStore.ts +48 -0
- package/src/graph-manager/action/changeDetection/DomainObserverHelper.ts +3 -3
- package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +4 -0
- package/src/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.ts +45 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/function/test/{V1_FunctionStoreTestData.ts → V1_FunctionTestData.ts} +3 -3
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/function/test/V1_FunctionTestSuite.ts +2 -2
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_Database.ts +3 -0
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/store/relational/model/V1_IncludeStore.ts +32 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_CoreTransformerHelper.ts +1 -1
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.ts +41 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.ts +30 -3
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DomainTransformer.ts +5 -5
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_RuntimeTransformer.ts +1 -4
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ClassMappingSecondPassBuilder.ts +5 -1
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +29 -2
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.ts +71 -11
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.ts +6 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.ts +22 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.ts +89 -17
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.ts +11 -8
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.ts +8 -1
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.ts +32 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.ts +25 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_FunctionSerializationHelper.ts +45 -17
- package/src/index.ts +4 -1
- package/tsconfig.json +5 -2
- package/lib/graph/metamodel/pure/packageableElements/function/test/FunctionStoreTestData.d.ts.map +0 -1
- package/lib/graph/metamodel/pure/packageableElements/function/test/FunctionStoreTestData.js.map +0 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/V1_FunctionStoreTestData.d.ts.map +0 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/function/test/V1_FunctionStoreTestData.js.map +0 -1
package/src/graph/PureModel.ts
CHANGED
|
@@ -69,6 +69,7 @@ import type { PropertyOwner } from './metamodel/pure/packageableElements/domain/
|
|
|
69
69
|
import type { ExecutionEnvironmentInstance } from './metamodel/pure/packageableElements/service/ExecutionEnvironmentInstance.js';
|
|
70
70
|
import { FunctionActivator } from './metamodel/pure/packageableElements/function/FunctionActivator.js';
|
|
71
71
|
import type { IngestDefinition } from './metamodel/pure/packageableElements/ingest/IngestDefinition.js';
|
|
72
|
+
import type { DataProduct } from './metamodel/pure/dataProduct/DataProduct.js';
|
|
72
73
|
|
|
73
74
|
export interface GraphTextInputOption {
|
|
74
75
|
graphGrammar: string | undefined;
|
|
@@ -510,6 +511,24 @@ export class PureModel extends BasicModel {
|
|
|
510
511
|
this.coreModel.getOwnNullableStore(path),
|
|
511
512
|
`Can't find store '${path}'`,
|
|
512
513
|
);
|
|
514
|
+
getDataProduct = (path: string): DataProduct =>
|
|
515
|
+
guaranteeNonNullable(
|
|
516
|
+
this.getOwnNullableDataProduct(path) ??
|
|
517
|
+
this.generationModel.getOwnNullableDataProduct(path) ??
|
|
518
|
+
this.dependencyManager.getOwnNullableDataProduct(path) ??
|
|
519
|
+
this.systemModel.getOwnNullableDataProduct(path) ??
|
|
520
|
+
this.coreModel.getOwnNullableDataProduct(path),
|
|
521
|
+
`Can't find data product '${path}'`,
|
|
522
|
+
);
|
|
523
|
+
getIngestDefinition = (path: string): IngestDefinition =>
|
|
524
|
+
guaranteeNonNullable(
|
|
525
|
+
this.getOwnNullableIngestDefinition(path) ??
|
|
526
|
+
this.generationModel.getOwnNullableIngestDefinition(path) ??
|
|
527
|
+
this.dependencyManager.getOwnNullableIngestDefinition(path) ??
|
|
528
|
+
this.systemModel.getOwnNullableIngestDefinition(path) ??
|
|
529
|
+
this.coreModel.getOwnNullableIngestDefinition(path),
|
|
530
|
+
`Can't find ingest definition '${path}'`,
|
|
531
|
+
);
|
|
513
532
|
getFlatDataStore = (path: string): FlatData =>
|
|
514
533
|
guaranteeType(
|
|
515
534
|
this.getStore(path),
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-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 { assertTrue, assertType, filterByType } from '@finos/legend-shared';
|
|
18
|
+
import { Column } from '../metamodel/pure/packageableElements/store/relational/model/Column.js';
|
|
19
|
+
import { Table } from '../metamodel/pure/packageableElements/store/relational/model/Table.js';
|
|
20
|
+
import type { View } from '../metamodel/pure/packageableElements/store/relational/model/View.js';
|
|
21
|
+
import type { Database } from '../../STO_Relational_Exports.js';
|
|
22
|
+
import { INTERNAL__LakehouseGeneratedDatabase } from '../metamodel/pure/packageableElements/store/relational/model/Database.js';
|
|
23
|
+
import { Schema } from '../metamodel/pure/packageableElements/store/relational/model/Schema.js';
|
|
24
|
+
|
|
25
|
+
export const getOrCreateColumnFromGeneratedTable = (
|
|
26
|
+
columnName: string,
|
|
27
|
+
relation: Table | View,
|
|
28
|
+
): Column => {
|
|
29
|
+
let column = relation.columns
|
|
30
|
+
.filter(filterByType(Column))
|
|
31
|
+
.find((col) => col.name === columnName);
|
|
32
|
+
if (!column) {
|
|
33
|
+
column = new Column();
|
|
34
|
+
column.name = columnName;
|
|
35
|
+
column.owner = relation;
|
|
36
|
+
relation.columns.push(column);
|
|
37
|
+
}
|
|
38
|
+
return column;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const isGeneratedSchema = (schema: Schema): boolean => {
|
|
42
|
+
return schema._OWNER instanceof INTERNAL__LakehouseGeneratedDatabase;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const isGeneratedRelation = (relation: Table | View): boolean => {
|
|
46
|
+
return isGeneratedSchema(relation.schema);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const getOrCreateTableFromGeneratedSchema = (
|
|
50
|
+
tableName: string,
|
|
51
|
+
schema: Schema,
|
|
52
|
+
): Table => {
|
|
53
|
+
assertTrue(isGeneratedSchema(schema), 'Schema must be generated');
|
|
54
|
+
let table = schema.tables.find((t) => t.name === tableName);
|
|
55
|
+
if (!table) {
|
|
56
|
+
table = new Table(tableName, schema);
|
|
57
|
+
schema.tables.push(table);
|
|
58
|
+
}
|
|
59
|
+
return table;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const getOrCreateSchemaFromGeneratedDatabase = (
|
|
63
|
+
schemaName: string,
|
|
64
|
+
db: Database,
|
|
65
|
+
): Schema => {
|
|
66
|
+
assertType(
|
|
67
|
+
db,
|
|
68
|
+
INTERNAL__LakehouseGeneratedDatabase,
|
|
69
|
+
'Database must be a generated database',
|
|
70
|
+
);
|
|
71
|
+
const schema = db.schemas.find((s) => s.name === schemaName);
|
|
72
|
+
if (schema) {
|
|
73
|
+
return schema;
|
|
74
|
+
}
|
|
75
|
+
const newSchema = new Schema(schemaName, db);
|
|
76
|
+
db.schemas.push(newSchema);
|
|
77
|
+
return newSchema;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const findGeneratedDatabase = (
|
|
81
|
+
database: Database,
|
|
82
|
+
path: string,
|
|
83
|
+
): INTERNAL__LakehouseGeneratedDatabase | undefined => {
|
|
84
|
+
return database.includedStoreSpecifications.find(
|
|
85
|
+
(x) => x.packageableElementPointer.value.path === path,
|
|
86
|
+
)?.generatedDatabase;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const buildGeneratedIndex = (
|
|
90
|
+
database: Database,
|
|
91
|
+
): Map<string, INTERNAL__LakehouseGeneratedDatabase> | undefined => {
|
|
92
|
+
const index = new Map<string, INTERNAL__LakehouseGeneratedDatabase>();
|
|
93
|
+
database.includedStoreSpecifications.forEach((inc) =>
|
|
94
|
+
index.set(inc.packageableElementPointer.value.path, inc.generatedDatabase),
|
|
95
|
+
);
|
|
96
|
+
return index.size > 0 ? index : undefined;
|
|
97
|
+
};
|
|
@@ -21,7 +21,10 @@ import {
|
|
|
21
21
|
UnsupportedOperationError,
|
|
22
22
|
} from '@finos/legend-shared';
|
|
23
23
|
import { Column } from '../metamodel/pure/packageableElements/store/relational/model/Column.js';
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
Database,
|
|
26
|
+
type INTERNAL__LakehouseGeneratedDatabase,
|
|
27
|
+
} from '../metamodel/pure/packageableElements/store/relational/model/Database.js';
|
|
25
28
|
import type { Filter } from '../metamodel/pure/packageableElements/store/relational/model/Filter.js';
|
|
26
29
|
import type { Join } from '../metamodel/pure/packageableElements/store/relational/model/Join.js';
|
|
27
30
|
import {
|
|
@@ -57,6 +60,10 @@ import {
|
|
|
57
60
|
} from '../../STO_Relational_Exports.js';
|
|
58
61
|
import type { PackageableElement } from '../metamodel/pure/packageableElements/PackageableElement.js';
|
|
59
62
|
import { PackageableConnection } from '../metamodel/pure/packageableElements/connection/PackageableConnection.js';
|
|
63
|
+
import {
|
|
64
|
+
getOrCreateColumnFromGeneratedTable,
|
|
65
|
+
isGeneratedRelation,
|
|
66
|
+
} from './STO_Internal_Relational_Helper.js';
|
|
60
67
|
|
|
61
68
|
const collectIncludedDatabases = (
|
|
62
69
|
results: Set<Database>,
|
|
@@ -90,6 +97,16 @@ export const getAllIncludedDatabases = (db: Database): Set<Database> => {
|
|
|
90
97
|
return results;
|
|
91
98
|
};
|
|
92
99
|
|
|
100
|
+
export const getAllIncludedGeneratedDatabases = (
|
|
101
|
+
db: Database,
|
|
102
|
+
): Set<INTERNAL__LakehouseGeneratedDatabase> => {
|
|
103
|
+
return new Set(
|
|
104
|
+
db.includedStoreSpecifications.map(
|
|
105
|
+
(includedStore) => includedStore.generatedDatabase,
|
|
106
|
+
),
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
93
110
|
export const getJoinType = (type: string): JoinType => {
|
|
94
111
|
switch (type) {
|
|
95
112
|
case JoinType.INNER:
|
|
@@ -167,7 +184,7 @@ export const getFilter = (database: Database, name: string): Filter =>
|
|
|
167
184
|
export const getNullableTable = (
|
|
168
185
|
schema: Schema,
|
|
169
186
|
name: string,
|
|
170
|
-
): Table | undefined => schema.tables.find((
|
|
187
|
+
): Table | undefined => schema.tables.find((_table) => _table.name === name);
|
|
171
188
|
|
|
172
189
|
export const getTable = (schema: Schema, name: string): Table =>
|
|
173
190
|
guaranteeNonNullable(
|
|
@@ -189,13 +206,17 @@ export const getRelation = (schema: Schema, name: string): Relation => {
|
|
|
189
206
|
);
|
|
190
207
|
};
|
|
191
208
|
|
|
192
|
-
export
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
209
|
+
export function getColumn(relation: Table | View, name: string): Column {
|
|
210
|
+
if (!isGeneratedRelation(relation)) {
|
|
211
|
+
guaranteeNonNullable(
|
|
212
|
+
relation.columns
|
|
213
|
+
.filter(filterByType(Column))
|
|
214
|
+
.find((column) => column.name === name),
|
|
215
|
+
`Can't find column '${name}' in table '${relation.name}'`,
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
return getOrCreateColumnFromGeneratedTable(name, relation);
|
|
219
|
+
}
|
|
199
220
|
|
|
200
221
|
export const stringifyDataType = (type: RelationalDataType): string => {
|
|
201
222
|
if (type instanceof VarChar) {
|
|
@@ -31,6 +31,7 @@ export interface EmbeddedDataVisitor<T> {
|
|
|
31
31
|
|
|
32
32
|
visit_ExternalFormatData(data: ExternalFormatData): T;
|
|
33
33
|
visit_ModelStoreData(data: ModelStoreData): T;
|
|
34
|
+
visit_RelationElementsData(data: RelationElementsData): T;
|
|
34
35
|
visit_DataElementReference(data: DataElementReference): T;
|
|
35
36
|
visit_RelationalCSVData(data: RelationalCSVData): T;
|
|
36
37
|
}
|
|
@@ -121,3 +122,44 @@ export class ModelStoreData extends EmbeddedData implements Hashable {
|
|
|
121
122
|
return visitor.visit_ModelStoreData(this);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
125
|
+
|
|
126
|
+
export class RelationRowTestData implements Hashable {
|
|
127
|
+
values!: string[];
|
|
128
|
+
|
|
129
|
+
get hashCode(): string {
|
|
130
|
+
return hashArray([
|
|
131
|
+
CORE_HASH_STRUCTURE.RELATION_ROW_TEST_DATA,
|
|
132
|
+
hashArray(this.values),
|
|
133
|
+
]);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export class RelationElement implements Hashable {
|
|
138
|
+
paths!: string[];
|
|
139
|
+
columns!: string[];
|
|
140
|
+
rows: RelationRowTestData[] = [];
|
|
141
|
+
|
|
142
|
+
get hashCode(): string {
|
|
143
|
+
return hashArray([
|
|
144
|
+
CORE_HASH_STRUCTURE.RELATION_ELEMENT,
|
|
145
|
+
hashArray(this.paths),
|
|
146
|
+
hashArray(this.columns),
|
|
147
|
+
hashArray(this.rows),
|
|
148
|
+
]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export class RelationElementsData extends EmbeddedData implements Hashable {
|
|
153
|
+
relationElements: RelationElement[] = [];
|
|
154
|
+
|
|
155
|
+
get hashCode(): string {
|
|
156
|
+
return hashArray([
|
|
157
|
+
CORE_HASH_STRUCTURE.RELATION_ELEMENTS_DATA,
|
|
158
|
+
hashArray(this.relationElements),
|
|
159
|
+
]);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
accept_EmbeddedDataVisitor<T>(visitor: EmbeddedDataVisitor<T>): T {
|
|
163
|
+
return visitor.visit_RelationElementsData(this);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
18
|
import type { PackageableElementReference } from '../../PackageableElementReference.js';
|
|
19
19
|
import type { EmbeddedData } from '../../../data/EmbeddedData.js';
|
|
20
|
-
import type { Store } from '../../store/Store.js';
|
|
21
20
|
import { CORE_HASH_STRUCTURE } from '../../../../../Core_HashUtils.js';
|
|
21
|
+
import type { PackageableElement } from '../../PackageableElement.js';
|
|
22
22
|
|
|
23
|
-
export class
|
|
23
|
+
export class FunctionTestData implements Hashable {
|
|
24
24
|
doc: string | undefined;
|
|
25
|
-
|
|
25
|
+
element!: PackageableElementReference<PackageableElement>;
|
|
26
26
|
data!: EmbeddedData;
|
|
27
27
|
|
|
28
28
|
get hashCode(): string {
|
|
29
29
|
return hashArray([
|
|
30
30
|
CORE_HASH_STRUCTURE.FUNCTION_STORE_TEST_DATA,
|
|
31
31
|
this.doc ?? '',
|
|
32
|
-
this.
|
|
32
|
+
this.element.valueForSerialization ?? '',
|
|
33
33
|
this.data,
|
|
34
34
|
]);
|
|
35
35
|
}
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
import { hashArray } from '@finos/legend-shared';
|
|
18
18
|
import { TestSuite } from '../../../test/Test.js';
|
|
19
|
-
import type {
|
|
19
|
+
import type { FunctionTestData } from './FunctionTestData.js';
|
|
20
20
|
import { CORE_HASH_STRUCTURE } from '../../../../../Core_HashUtils.js';
|
|
21
21
|
|
|
22
22
|
export class FunctionTestSuite extends TestSuite {
|
|
23
|
-
testData:
|
|
23
|
+
testData: FunctionTestData[] | undefined;
|
|
24
24
|
|
|
25
25
|
override get hashCode(): string {
|
|
26
26
|
return hashArray([
|
|
@@ -83,10 +83,7 @@ export class ConnectionStores implements Hashable {
|
|
|
83
83
|
this.connectionPointer,
|
|
84
84
|
hashArray(
|
|
85
85
|
this.storePointers.map((s) =>
|
|
86
|
-
hashElementPointer(
|
|
87
|
-
PackageableElementPointerType.STORE,
|
|
88
|
-
s.valueForSerialization ?? '',
|
|
89
|
-
),
|
|
86
|
+
hashElementPointer(undefined, s.valueForSerialization ?? ''),
|
|
90
87
|
),
|
|
91
88
|
),
|
|
92
89
|
]);
|
|
@@ -21,11 +21,15 @@ import type { PackageableElementVisitor } from '../../../PackageableElement.js';
|
|
|
21
21
|
import type { Schema } from './Schema.js';
|
|
22
22
|
import type { Join } from './Join.js';
|
|
23
23
|
import type { Filter } from './Filter.js';
|
|
24
|
+
import type { IncludeStore } from './IncludeStore.js';
|
|
25
|
+
import type { DataProduct } from '../../../../dataProduct/DataProduct.js';
|
|
26
|
+
import type { IngestDefinition } from '../../../ingest/IngestDefinition.js';
|
|
24
27
|
|
|
25
28
|
export class Database extends Store implements Hashable {
|
|
26
29
|
schemas: Schema[] = [];
|
|
27
30
|
joins: Join[] = [];
|
|
28
31
|
filters: Filter[] = [];
|
|
32
|
+
includedStoreSpecifications: IncludeStore[] = [];
|
|
29
33
|
|
|
30
34
|
protected override get _elementHashCode(): string {
|
|
31
35
|
return hashArray([
|
|
@@ -39,6 +43,7 @@ export class Database extends Store implements Hashable {
|
|
|
39
43
|
hashArray(this.filters),
|
|
40
44
|
hashArray(this.stereotypes.map((val) => val.pointerHashCode)),
|
|
41
45
|
hashArray(this.taggedValues),
|
|
46
|
+
hashArray(this.includedStoreSpecifications),
|
|
42
47
|
]);
|
|
43
48
|
}
|
|
44
49
|
|
|
@@ -48,3 +53,25 @@ export class Database extends Store implements Hashable {
|
|
|
48
53
|
return visitor.visit_Database(this);
|
|
49
54
|
}
|
|
50
55
|
}
|
|
56
|
+
|
|
57
|
+
export class INTERNAL__LakehouseGeneratedDatabase extends Database {
|
|
58
|
+
readonly generatorElement: DataProduct | IngestDefinition;
|
|
59
|
+
readonly OWNER: Database;
|
|
60
|
+
constructor(
|
|
61
|
+
generatorElement: DataProduct | IngestDefinition,
|
|
62
|
+
owner: Database,
|
|
63
|
+
) {
|
|
64
|
+
super(owner.name);
|
|
65
|
+
this.generatorElement = generatorElement;
|
|
66
|
+
this.OWNER = owner;
|
|
67
|
+
}
|
|
68
|
+
override accept_PackageableElementVisitor<T>(
|
|
69
|
+
visitor: PackageableElementVisitor<T>,
|
|
70
|
+
): T {
|
|
71
|
+
return visitor.visit_Database(this);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
override get path(): string {
|
|
75
|
+
return `${this.generatorElement.path}`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
|
+
import type { PackageableElementReference } from '../../../PackageableElementReference.js';
|
|
19
|
+
import type { IngestDefinition } from '../../../ingest/IngestDefinition.js';
|
|
20
|
+
import type { DataProduct } from '../../../../dataProduct/DataProduct.js';
|
|
21
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
|
|
22
|
+
import type { INTERNAL__LakehouseGeneratedDatabase } from './Database.js';
|
|
23
|
+
|
|
24
|
+
export class IncludeStore implements Hashable {
|
|
25
|
+
packageableElementPointer: PackageableElementReference<
|
|
26
|
+
IngestDefinition | DataProduct
|
|
27
|
+
>;
|
|
28
|
+
storeType: string;
|
|
29
|
+
generatedDatabase!: INTERNAL__LakehouseGeneratedDatabase;
|
|
30
|
+
|
|
31
|
+
constructor(
|
|
32
|
+
packageableElementPointer: PackageableElementReference<
|
|
33
|
+
IngestDefinition | DataProduct
|
|
34
|
+
>,
|
|
35
|
+
storeType: string,
|
|
36
|
+
) {
|
|
37
|
+
this.packageableElementPointer = packageableElementPointer;
|
|
38
|
+
this.storeType = storeType;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get hashCode(): string {
|
|
42
|
+
return hashArray([
|
|
43
|
+
CORE_HASH_STRUCTURE.DATABASE_INCLUDE_STORE,
|
|
44
|
+
this.packageableElementPointer.value.path,
|
|
45
|
+
this.storeType,
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
observe_AtomicTest,
|
|
86
86
|
observe_TestAssertion,
|
|
87
87
|
} from './Testable_ObserverHelper.js';
|
|
88
|
-
import type {
|
|
88
|
+
import type { FunctionTestData } from '../../../graph/metamodel/pure/packageableElements/function/test/FunctionTestData.js';
|
|
89
89
|
import { observe_EmbeddedData } from './DSL_Data_ObserverHelper.js';
|
|
90
90
|
import type { HostedService } from '../../../graph/metamodel/pure/packageableElements/function/HostedService.js';
|
|
91
91
|
import type { MemSQLFunction } from '../../../graph/metamodel/pure/packageableElements/function/MemSQLFunction.js';
|
|
@@ -499,9 +499,9 @@ export const observe_FunctionTest = skipObserved(
|
|
|
499
499
|
);
|
|
500
500
|
|
|
501
501
|
export const observe_FunctionTestData = skipObservedWithContext(
|
|
502
|
-
(metamodel:
|
|
502
|
+
(metamodel: FunctionTestData, context: ObserverContext) => {
|
|
503
503
|
makeObservable(metamodel, {
|
|
504
|
-
|
|
504
|
+
element: observable,
|
|
505
505
|
data: observable,
|
|
506
506
|
hashCode: computed,
|
|
507
507
|
});
|
|
@@ -369,6 +369,7 @@ import {
|
|
|
369
369
|
V1_LineageInput,
|
|
370
370
|
type V1_RawLineageModel,
|
|
371
371
|
} from './model/lineage/V1_Lineage.js';
|
|
372
|
+
import { V1_IngestDefinition } from './model/packageableElements/ingest/V1_IngestDefinition.js';
|
|
372
373
|
|
|
373
374
|
class V1_PureModelContextDataIndex {
|
|
374
375
|
elements: V1_PackageableElement[] = [];
|
|
@@ -4587,6 +4588,9 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
4587
4588
|
protocol instanceof V1_INTERNAL__UnknownFunctionActivator ||
|
|
4588
4589
|
protocol instanceof V1_INTERNAL__UnknownStore
|
|
4589
4590
|
) {
|
|
4591
|
+
if (protocol instanceof V1_IngestDefinition) {
|
|
4592
|
+
return CORE_PURE_PATH.INGEST_DEFINITION;
|
|
4593
|
+
}
|
|
4590
4594
|
const _type = protocol.content._type;
|
|
4591
4595
|
const classifierPath = isString(_type)
|
|
4592
4596
|
? this.elementClassifierPathMap.get(_type)
|
|
@@ -31,6 +31,7 @@ export interface V1_EmbeddedDataVisitor<T> {
|
|
|
31
31
|
|
|
32
32
|
visit_ExternalFormatData(data: V1_ExternalFormatData): T;
|
|
33
33
|
visit_ModelStoreData(data: V1_ModelStoreData): T;
|
|
34
|
+
visit_RelationElementsData(data: V1_RelationElementsData): T;
|
|
34
35
|
visit_DataElementReference(data: V1_DataElementReference): T;
|
|
35
36
|
visit_RelationalData(data: V1_RelationalCSVData): T;
|
|
36
37
|
}
|
|
@@ -125,3 +126,47 @@ export class V1_ModelStoreData extends V1_EmbeddedData implements Hashable {
|
|
|
125
126
|
return visitor.visit_ModelStoreData(this);
|
|
126
127
|
}
|
|
127
128
|
}
|
|
129
|
+
|
|
130
|
+
export class V1_RelationRowTestData implements Hashable {
|
|
131
|
+
values!: string[];
|
|
132
|
+
|
|
133
|
+
get hashCode(): string {
|
|
134
|
+
return hashArray([
|
|
135
|
+
CORE_HASH_STRUCTURE.RELATION_ROW_TEST_DATA,
|
|
136
|
+
hashArray(this.values),
|
|
137
|
+
]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export class V1_RelationElement implements Hashable {
|
|
142
|
+
paths!: string[];
|
|
143
|
+
columns!: string[];
|
|
144
|
+
rows: V1_RelationRowTestData[] = [];
|
|
145
|
+
|
|
146
|
+
get hashCode(): string {
|
|
147
|
+
return hashArray([
|
|
148
|
+
CORE_HASH_STRUCTURE.RELATION_ELEMENT,
|
|
149
|
+
hashArray(this.paths),
|
|
150
|
+
hashArray(this.columns),
|
|
151
|
+
hashArray(this.rows),
|
|
152
|
+
]);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export class V1_RelationElementsData
|
|
157
|
+
extends V1_EmbeddedData
|
|
158
|
+
implements Hashable
|
|
159
|
+
{
|
|
160
|
+
relationElements: V1_RelationElement[] = [];
|
|
161
|
+
|
|
162
|
+
get hashCode(): string {
|
|
163
|
+
return hashArray([
|
|
164
|
+
CORE_HASH_STRUCTURE.RELATION_ELEMENTS_DATA,
|
|
165
|
+
hashArray(this.relationElements),
|
|
166
|
+
]);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
accept_EmbeddedDataVisitor<T>(visitor: V1_EmbeddedDataVisitor<T>): T {
|
|
170
|
+
return visitor.visit_RelationElementsData(this);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -19,16 +19,16 @@ import type { V1_EmbeddedData } from '../../../data/V1_EmbeddedData.js';
|
|
|
19
19
|
import { CORE_HASH_STRUCTURE } from '../../../../../../../../graph/Core_HashUtils.js';
|
|
20
20
|
import type { V1_PackageableElementPointer } from '../../V1_PackageableElement.js';
|
|
21
21
|
|
|
22
|
-
export class
|
|
22
|
+
export class V1_FunctionTestData implements Hashable {
|
|
23
23
|
doc: string | undefined;
|
|
24
|
-
|
|
24
|
+
packageableElementPointer!: V1_PackageableElementPointer;
|
|
25
25
|
data!: V1_EmbeddedData;
|
|
26
26
|
|
|
27
27
|
get hashCode(): string {
|
|
28
28
|
return hashArray([
|
|
29
29
|
CORE_HASH_STRUCTURE.FUNCTION_STORE_TEST_DATA,
|
|
30
30
|
this.doc ?? '',
|
|
31
|
-
this.
|
|
31
|
+
this.packageableElementPointer.path,
|
|
32
32
|
this.data,
|
|
33
33
|
]);
|
|
34
34
|
}
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
import { hashArray } from '@finos/legend-shared';
|
|
18
18
|
import { V1_TestSuite } from '../../../test/V1_TestSuite.js';
|
|
19
19
|
import { CORE_HASH_STRUCTURE } from '../../../../../../../../graph/Core_HashUtils.js';
|
|
20
|
-
import type {
|
|
20
|
+
import type { V1_FunctionTestData } from './V1_FunctionTestData.js';
|
|
21
21
|
|
|
22
22
|
export class V1_FunctionTestSuite extends V1_TestSuite {
|
|
23
|
-
testData:
|
|
23
|
+
testData: V1_FunctionTestData[] | undefined;
|
|
24
24
|
|
|
25
25
|
override get hashCode(): string {
|
|
26
26
|
return hashArray([
|
|
@@ -23,6 +23,7 @@ import type { V1_Join } from './V1_Join.js';
|
|
|
23
23
|
import type { V1_Filter } from './V1_Filter.js';
|
|
24
24
|
import type { V1_StereotypePtr } from '../../../domain/V1_StereotypePtr.js';
|
|
25
25
|
import type { V1_TaggedValue } from '../../../domain/V1_TaggedValue.js';
|
|
26
|
+
import type { V1_IncludeStore } from './V1_IncludeStore.js';
|
|
26
27
|
|
|
27
28
|
export class V1_Database extends V1_Store implements Hashable {
|
|
28
29
|
schemas: V1_Schema[] = [];
|
|
@@ -30,6 +31,7 @@ export class V1_Database extends V1_Store implements Hashable {
|
|
|
30
31
|
filters: V1_Filter[] = [];
|
|
31
32
|
stereotypes: V1_StereotypePtr[] = [];
|
|
32
33
|
taggedValues: V1_TaggedValue[] = [];
|
|
34
|
+
includedStoreSpecifications: V1_IncludeStore[] = [];
|
|
33
35
|
|
|
34
36
|
override get hashCode(): string {
|
|
35
37
|
return hashArray([
|
|
@@ -41,6 +43,7 @@ export class V1_Database extends V1_Store implements Hashable {
|
|
|
41
43
|
hashArray(this.filters),
|
|
42
44
|
hashArray(this.stereotypes),
|
|
43
45
|
hashArray(this.taggedValues),
|
|
46
|
+
hashArray(this.includedStoreSpecifications),
|
|
44
47
|
]);
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { type Hashable, hashArray } from '@finos/legend-shared';
|
|
18
|
+
import { type V1_PackageableElementPointer } from '../../../../../model/packageableElements/V1_PackageableElement.js';
|
|
19
|
+
import { CORE_HASH_STRUCTURE } from '../../../../../../../../../graph/Core_HashUtils.js';
|
|
20
|
+
|
|
21
|
+
export class V1_IncludeStore implements Hashable {
|
|
22
|
+
packageableElementPointer!: V1_PackageableElementPointer;
|
|
23
|
+
storeType!: string;
|
|
24
|
+
|
|
25
|
+
get hashCode(): string {
|
|
26
|
+
return hashArray([
|
|
27
|
+
CORE_HASH_STRUCTURE.DATABASE_INCLUDE_STORE,
|
|
28
|
+
this.packageableElementPointer.path,
|
|
29
|
+
this.storeType,
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_CoreTransformerHelper.ts
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
export const V1_transformElementReferencePointer = <
|
|
27
27
|
T extends PackageableElement,
|
|
28
28
|
>(
|
|
29
|
-
pointerType: string,
|
|
29
|
+
pointerType: string | undefined,
|
|
30
30
|
ref: PackageableElementReference<T>,
|
|
31
31
|
): V1_PackageableElementPointer =>
|
|
32
32
|
new V1_PackageableElementPointer(
|