From cc1753069b75d2c0e16ecf04688811171414a209 Mon Sep 17 00:00:00 2001 From: Yannan <73408381+YannanGao-gs@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:00:43 -0400 Subject: [PATCH] Revert "Connection equality added for relational database connections - legend using equality key based checks (#2315)" (#2359) This reverts commit 1039d488414697dea27b644cf6bd2d52f3009443. --- .../core_relational_athena.definition.json | 2 +- .../connection/connectionEqualityTest.pure | 46 ------- .../relational/connection/metamodel.pure | 6 +- ...st_Pure_Relational_ConnectionEquality.java | 31 ----- .../core_relational_bigquery.definition.json | 2 +- .../connection/bigQuerySpecification.pure | 8 +- .../connection/connectionEqualityTest.pure | 47 ------- ...st_Pure_Relational_ConnectionEquality.java | 31 ----- ...core_relational_databricks.definition.json | 2 +- .../connection/connectionEqualityTest.pure | 47 ------- .../relational/connection/metamodel.pure | 8 +- ...st_Pure_Relational_ConnectionEquality.java | 31 ----- ...core_relational___dbtype__.definition.json | 2 +- .../connection/connectionEqualityTest.pure | 47 ------- ...st_Pure_Relational_ConnectionEquality.java | 31 ----- .../relational/connection/metamodel.pure | 12 +- .../core_relational_snowflake.definition.json | 2 +- .../connection/connectionEqualityTest.pure | 48 -------- .../relational/connection/metamodel.pure | 26 ++-- ...st_Pure_Relational_ConnectionEquality.java | 31 ----- .../connection/spannerSpecification.pure | 10 +- .../relational/contract/storeContract.pure | 27 ---- .../relational/extensions/extension.pure | 7 +- .../connection/authenticationStrategy.pure | 17 +-- .../connection/datasourceSpecification.pure | 17 ++- .../tests/testRelationalExtension.pure | 115 ------------------ 26 files changed, 60 insertions(+), 593 deletions(-) delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena/relational/connection/connectionEqualityTest.pure delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery/relational/runtime/connection/connectionEqualityTest.pure delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks/relational/connection/connectionEqualityTest.pure delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/main/resources/core_relational___dbtype__/relational/connection/connectionEqualityTest.pure delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake/relational/connection/connectionEqualityTest.pure delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena.definition.json b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena.definition.json index 7a71e1f48c8..608b107464f 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena.definition.json +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena.definition.json @@ -1,6 +1,6 @@ { "name": "core_relational_athena", - "pattern": "(meta::relational::functions::sqlQueryToString::athena|meta::relational::tests::sqlQueryToString::athena|meta::relational::tests::connEquality|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", + "pattern": "(meta::relational::functions::sqlQueryToString::athena|meta::relational::tests::sqlQueryToString::athena|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", "dependencies": [ "platform", "platform_functions", diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena/relational/connection/connectionEqualityTest.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena/relational/connection/connectionEqualityTest.pure deleted file mode 100644 index ad754b2feda..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena/relational/connection/connectionEqualityTest.pure +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import meta::relational::metamodel::execute::tests::*; -import meta::pure::alloy::connections::*; -import meta::pure::runtime::*; -import meta::relational::translation::*; -import meta::pure::extension::*; -import meta::relational::extension::*; -import meta::relational::runtime::*; -import meta::relational::tests::csv::*; -import meta::relational::metamodel::execute::*; -import meta::relational::metamodel::*; -import meta::pure::mapping::*; - -function <> meta::relational::tests::connEquality::testConnectionEqualityAllSameAthena() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.Athena, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::AthenaDatasourceSpecification(awsRegion='awsR', s3OutputLocation='s3OL', databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.Athena, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::AthenaDatasourceSpecification(awsRegion='awsR', s3OutputLocation='s3OL', databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - assert(runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena/relational/connection/metamodel.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena/relational/connection/metamodel.pure index 3d5185442bd..5af0eea4fad 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena/relational/connection/metamodel.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/main/resources/core_relational_athena/relational/connection/metamodel.pure @@ -14,7 +14,7 @@ Class meta::pure::alloy::connections::alloy::specification::AthenaDatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> awsRegion: String[1]; - <> s3OutputLocation: String[1]; - <> databaseName: String[1]; + awsRegion: String[1]; + s3OutputLocation: String[1]; + databaseName: String[1]; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java deleted file mode 100644 index c072278365f..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-athena/legend-engine-xt-relationalStore-athena-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package org.finos.legend.pure.code.core; - -import junit.framework.TestSuite; -import org.finos.legend.pure.m3.execution.test.PureTestBuilder; -import org.finos.legend.pure.m3.execution.test.TestCollection; -import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport; -import org.finos.legend.pure.runtime.java.compiled.testHelper.PureTestBuilderCompiled; - -public class Test_Pure_Relational_ConnectionEquality -{ - public static TestSuite suite() - { - String testPackage = "meta::relational::tests::connEquality"; - CompiledExecutionSupport executionSupport = PureTestBuilderCompiled.getClassLoaderExecutionSupport(); - return PureTestBuilderCompiled.buildSuite(TestCollection.collectTests(testPackage, executionSupport.getProcessorSupport(), ci -> PureTestBuilder.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport); - } -} diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery.definition.json b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery.definition.json index c6169ba4970..a0d5f3d1981 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery.definition.json +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery.definition.json @@ -1,6 +1,6 @@ { "name": "core_relational_bigquery", - "pattern": "(meta::relational::functions::sqlQueryToString::bigQuery|meta::relational::tests::connEquality|meta::relational::tests::sqlQueryToString::bigQuery|meta::relational::bigQuery::tests|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", + "pattern": "(meta::relational::functions::sqlQueryToString::bigQuery|meta::relational::tests::sqlQueryToString::bigQuery|meta::relational::bigQuery::tests|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", "dependencies": [ "platform", "platform_functions", diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery/relational/runtime/connection/bigQuerySpecification.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery/relational/runtime/connection/bigQuerySpecification.pure index b2fd2efd681..2a26ad1a66c 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery/relational/runtime/connection/bigQuerySpecification.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery/relational/runtime/connection/bigQuerySpecification.pure @@ -14,8 +14,8 @@ Class meta::pure::alloy::connections::alloy::specification::BigQueryDatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> projectId:String[1]; - <> defaultDataset:String[1]; - <> proxyHost: String[0..1]; - <> proxyPort: String[0..1]; + projectId:String[1]; + defaultDataset:String[1]; + proxyHost: String[0..1]; + proxyPort: String[0..1]; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery/relational/runtime/connection/connectionEqualityTest.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery/relational/runtime/connection/connectionEqualityTest.pure deleted file mode 100644 index f418fc295bf..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/main/resources/core_relational_bigquery/relational/runtime/connection/connectionEqualityTest.pure +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import meta::relational::metamodel::execute::tests::*; -import meta::pure::alloy::connections::*; -import meta::pure::runtime::*; -import meta::relational::translation::*; -import meta::pure::extension::*; -import meta::relational::extension::*; -import meta::relational::runtime::*; -import meta::relational::tests::csv::*; -import meta::relational::metamodel::execute::*; -import meta::relational::metamodel::*; -import meta::pure::mapping::*; - - -function <> meta::relational::tests::connEquality::testConnectionEqualityAllSameBigQuery() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.Snowflake, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::BigQueryDatasourceSpecification(projectId='project', defaultDataset='defDs', proxyHost='ph', proxyPort='8080'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.Snowflake, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::BigQueryDatasourceSpecification(projectId='project', defaultDataset='defDs', proxyHost='ph', proxyPort='8080'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - assert(runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java deleted file mode 100644 index c072278365f..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-bigquery/legend-engine-xt-relationalStore-bigquery-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package org.finos.legend.pure.code.core; - -import junit.framework.TestSuite; -import org.finos.legend.pure.m3.execution.test.PureTestBuilder; -import org.finos.legend.pure.m3.execution.test.TestCollection; -import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport; -import org.finos.legend.pure.runtime.java.compiled.testHelper.PureTestBuilderCompiled; - -public class Test_Pure_Relational_ConnectionEquality -{ - public static TestSuite suite() - { - String testPackage = "meta::relational::tests::connEquality"; - CompiledExecutionSupport executionSupport = PureTestBuilderCompiled.getClassLoaderExecutionSupport(); - return PureTestBuilderCompiled.buildSuite(TestCollection.collectTests(testPackage, executionSupport.getProcessorSupport(), ci -> PureTestBuilder.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport); - } -} diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks.definition.json b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks.definition.json index 9f1b5e9e0ba..878f243e236 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks.definition.json +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks.definition.json @@ -1,5 +1,5 @@ { "name" : "core_relational_databricks", - "pattern" : "(meta::relational::functions::sqlQueryToString::databricks|meta::relational::tests::sqlQueryToString::databricks|meta::relational::tests::connEquality|meta::relational::databricks::tests|meta::relational::tests::functions::sqlstring::databricks|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", + "pattern" : "(meta::relational::functions::sqlQueryToString::databricks|meta::relational::tests::sqlQueryToString::databricks|meta::relational::databricks::tests|meta::relational::tests::functions::sqlstring::databricks|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", "dependencies" : ["platform", "platform_functions", "platform_store_relational", "platform_dsl_mapping", "core_functions", "core", "core_relational"] } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks/relational/connection/connectionEqualityTest.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks/relational/connection/connectionEqualityTest.pure deleted file mode 100644 index 5af95394f2b..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks/relational/connection/connectionEqualityTest.pure +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import meta::relational::metamodel::execute::tests::*; -import meta::pure::alloy::connections::*; -import meta::pure::runtime::*; -import meta::relational::translation::*; -import meta::pure::extension::*; -import meta::relational::extension::*; -import meta::relational::runtime::*; -import meta::relational::tests::csv::*; -import meta::relational::metamodel::execute::*; -import meta::relational::metamodel::*; -import meta::pure::mapping::*; - -function <> meta::relational::tests::connEquality::testConnectionEqualityAllSameDataBricks() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.Databricks, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::DatabricksDatasourceSpecification(hostname='host', port='8080', protocol='http', httpPath='http://path'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.Databricks, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::DatabricksDatasourceSpecification(hostname='host', port='8080', protocol='http', httpPath='http://path'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - assert(runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - - diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks/relational/connection/metamodel.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks/relational/connection/metamodel.pure index fec225e36c7..6c3138786f6 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks/relational/connection/metamodel.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/main/resources/core_relational_databricks/relational/connection/metamodel.pure @@ -14,8 +14,8 @@ Class meta::pure::alloy::connections::alloy::specification::DatabricksDatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> hostname:String[1]; - <> port:String[1]; - <> protocol:String[1]; - <> httpPath:String[1]; + hostname:String[1]; + port:String[1]; + protocol:String[1]; + httpPath:String[1]; } \ No newline at end of file diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java deleted file mode 100644 index c072278365f..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-databricks/legend-engine-xt-relationalStore-databricks-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package org.finos.legend.pure.code.core; - -import junit.framework.TestSuite; -import org.finos.legend.pure.m3.execution.test.PureTestBuilder; -import org.finos.legend.pure.m3.execution.test.TestCollection; -import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport; -import org.finos.legend.pure.runtime.java.compiled.testHelper.PureTestBuilderCompiled; - -public class Test_Pure_Relational_ConnectionEquality -{ - public static TestSuite suite() - { - String testPackage = "meta::relational::tests::connEquality"; - CompiledExecutionSupport executionSupport = PureTestBuilderCompiled.getClassLoaderExecutionSupport(); - return PureTestBuilderCompiled.buildSuite(TestCollection.collectTests(testPackage, executionSupport.getProcessorSupport(), ci -> PureTestBuilder.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport); - } -} diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/main/resources/core_relational___dbtype__.definition.json b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/main/resources/core_relational___dbtype__.definition.json index 2c147d30fc1..d199b747ec2 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/main/resources/core_relational___dbtype__.definition.json +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/main/resources/core_relational___dbtype__.definition.json @@ -1,5 +1,5 @@ { "name" : "core_relational_${dbtype}", - "pattern" : "(meta::relational::functions::sqlQueryToString::${dbType}|meta::relational::tests::connEquality|meta::relational::tests::sqlQueryToString::${dbType}|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", + "pattern" : "(meta::relational::functions::sqlQueryToString::${dbType}|meta::relational::tests::sqlQueryToString::${dbType}|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", "dependencies" : ["platform", "platform_functions", "platform_store_relational", "core", "core_relational"] } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/main/resources/core_relational___dbtype__/relational/connection/connectionEqualityTest.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/main/resources/core_relational___dbtype__/relational/connection/connectionEqualityTest.pure deleted file mode 100644 index 8467968aaca..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/main/resources/core_relational___dbtype__/relational/connection/connectionEqualityTest.pure +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import meta::relational::metamodel::execute::tests::*; -import meta::pure::alloy::connections::*; -import meta::pure::runtime::*; -import meta::relational::translation::*; -import meta::pure::extension::*; -import meta::relational::extension::*; -import meta::relational::runtime::*; -import meta::relational::tests::csv::*; -import meta::relational::metamodel::execute::*; -import meta::relational::metamodel::*; -import meta::pure::mapping::*; - - -function <> meta::relational::tests::connEquality::testConnectionEqualityAllSame__dbtype__() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.__dbtype__, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::__dbtype__DatasourceSpecification(), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.Snowflake, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::BigQueryDatasourceSpecification(projectId='project', defaultDataset='defDs', proxyHost='ph', proxyPort='8080'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - assert(runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java deleted file mode 100644 index c072278365f..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-dbExtension-archetype/src/main/resources/archetype-resources/legend-engine-xt-relationalStore-__dbtype__-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package org.finos.legend.pure.code.core; - -import junit.framework.TestSuite; -import org.finos.legend.pure.m3.execution.test.PureTestBuilder; -import org.finos.legend.pure.m3.execution.test.TestCollection; -import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport; -import org.finos.legend.pure.runtime.java.compiled.testHelper.PureTestBuilderCompiled; - -public class Test_Pure_Relational_ConnectionEquality -{ - public static TestSuite suite() - { - String testPackage = "meta::relational::tests::connEquality"; - CompiledExecutionSupport executionSupport = PureTestBuilderCompiled.getClassLoaderExecutionSupport(); - return PureTestBuilderCompiled.buildSuite(TestCollection.collectTests(testPackage, executionSupport.getProcessorSupport(), ci -> PureTestBuilder.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport); - } -} diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-redshift/legend-engine-xt-relationalStore-redshift-pure/src/main/resources/core_relational_redshift/relational/connection/metamodel.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-redshift/legend-engine-xt-relationalStore-redshift-pure/src/main/resources/core_relational_redshift/relational/connection/metamodel.pure index 49c2e1c7f73..e7f45966730 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-redshift/legend-engine-xt-relationalStore-redshift-pure/src/main/resources/core_relational_redshift/relational/connection/metamodel.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-redshift/legend-engine-xt-relationalStore-redshift-pure/src/main/resources/core_relational_redshift/relational/connection/metamodel.pure @@ -14,10 +14,10 @@ Class {doc.doc ='Specification for the AWS redshift database'} meta::pure::legend::connections::legend::specification::RedshiftDatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> {doc.doc ='clusterID'} clusterID:String[1]; - <> {doc.doc ='The aws region'} region:String[1]; - <> {doc.doc ='the full host url'} host:String[1]; - <> {doc.doc ='database name'} databaseName:String[1]; - <> {doc.doc ='port'} port:Integer[1]; - <> {doc.doc ='Optional URL used for redshift service execution'} endpointURL:String[0..1]; + {doc.doc ='clusterID'} clusterID:String[1]; + {doc.doc ='The aws region'} region:String[1]; + {doc.doc ='the full host url'} host:String[1]; + {doc.doc ='database name'} databaseName:String[1]; + {doc.doc ='port'} port:Integer[1]; + {doc.doc ='Optional URL used for redshift service execution'} endpointURL:String[0..1]; } \ No newline at end of file diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake.definition.json b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake.definition.json index c0aa332c785..26e2977f5f2 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake.definition.json +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake.definition.json @@ -1,5 +1,5 @@ { "name" : "core_relational_snowflake", - "pattern" : "(meta::relational::functions::sqlQueryToString::snowflake|meta::relational::tests::connEquality|meta::relational::tests::sqlQueryToString::snowflake|meta::relational::tests::sqlToString::snowflake|meta::pure::executionPlan::tests::snowflake|meta::relational::tests::projection::snowflake|meta::relational::tests::query::snowflake|meta::relational::tests::tds::snowflake|meta::relational::tests::mapping::function::snowflake|meta::relational::tests::postProcessor::snowflake|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", + "pattern" : "(meta::relational::functions::sqlQueryToString::snowflake|meta::relational::tests::sqlQueryToString::snowflake|meta::relational::tests::sqlToString::snowflake|meta::pure::executionPlan::tests::snowflake|meta::relational::tests::projection::snowflake|meta::relational::tests::query::snowflake|meta::relational::tests::tds::snowflake|meta::relational::tests::mapping::function::snowflake|meta::relational::tests::postProcessor::snowflake|meta::pure::alloy::connections|meta::protocols::pure)(::.*)?", "dependencies" : ["platform", "platform_functions", "platform_store_relational", "platform_dsl_mapping", "core_functions", "core", "core_relational"] } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake/relational/connection/connectionEqualityTest.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake/relational/connection/connectionEqualityTest.pure deleted file mode 100644 index 4cd7c4e4a8b..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake/relational/connection/connectionEqualityTest.pure +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2021 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import meta::relational::metamodel::execute::tests::*; -import meta::pure::alloy::connections::*; -import meta::pure::runtime::*; -import meta::relational::translation::*; -import meta::pure::extension::*; -import meta::relational::extension::*; -import meta::relational::runtime::*; -import meta::relational::tests::csv::*; -import meta::relational::metamodel::execute::*; -import meta::relational::metamodel::*; -import meta::pure::mapping::*; - - - -function <> meta::relational::tests::connEquality::testConnectionEqualityAllSameSnowflake() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.Snowflake, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::SnowflakeDatasourceSpecification(accountName='account', region='region', warehouseName='wh', databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::SnowflakePublicAuthenticationStrategy(privateKeyVaultReference='pkvr', publicUserName ='public', passPhraseVaultReference='ppVR') - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.Snowflake, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::SnowflakeDatasourceSpecification(accountName='account', region='region', warehouseName='wh', databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::SnowflakePublicAuthenticationStrategy(privateKeyVaultReference='pkvr', publicUserName ='public', passPhraseVaultReference='ppVR') - ); - - assert(runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake/relational/connection/metamodel.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake/relational/connection/metamodel.pure index 19fb053d8f0..5cd3bff5dbb 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake/relational/connection/metamodel.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/main/resources/core_relational_snowflake/relational/connection/metamodel.pure @@ -19,28 +19,28 @@ Enum meta::pure::alloy::connections::alloy::specification::SnowflakeAccountType Class meta::pure::alloy::connections::alloy::specification::SnowflakeDatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> accountName:String[1]; - <> region:String[1]; - <> warehouseName:String[1]; - <> databaseName:String[1]; - <> role:String[0..1]; + accountName:String[1]; + region:String[1]; + warehouseName:String[1]; + databaseName:String[1]; + role:String[0..1]; proxyHost:String[0..1]; proxyPort:String[0..1]; nonProxyHosts:String[0..1]; - <> accountType: meta::pure::alloy::connections::alloy::specification::SnowflakeAccountType[0..1]; - <> organization:String[0..1]; - <> cloudType:String[0..1]; + accountType: meta::pure::alloy::connections::alloy::specification::SnowflakeAccountType[0..1]; + organization:String[0..1]; + cloudType:String[0..1]; - <> quotedIdentifiersIgnoreCase:Boolean[0..1]; - <> enableQueryTags: Boolean[0..1]; + quotedIdentifiersIgnoreCase:Boolean[0..1]; + enableQueryTags: Boolean[0..1]; } Class meta::pure::alloy::connections::alloy::authentication::SnowflakePublicAuthenticationStrategy extends meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy { - <> privateKeyVaultReference:String[1]; - <> passPhraseVaultReference:String[1]; - <> publicUserName:String[1]; + privateKeyVaultReference:String[1]; + passPhraseVaultReference:String[1]; + publicUserName:String[1]; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java deleted file mode 100644 index c072278365f..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-pure/src/test/java/org/finos/legend/pure/code/core/Test_Pure_Relational_ConnectionEquality.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package org.finos.legend.pure.code.core; - -import junit.framework.TestSuite; -import org.finos.legend.pure.m3.execution.test.PureTestBuilder; -import org.finos.legend.pure.m3.execution.test.TestCollection; -import org.finos.legend.pure.runtime.java.compiled.execution.CompiledExecutionSupport; -import org.finos.legend.pure.runtime.java.compiled.testHelper.PureTestBuilderCompiled; - -public class Test_Pure_Relational_ConnectionEquality -{ - public static TestSuite suite() - { - String testPackage = "meta::relational::tests::connEquality"; - CompiledExecutionSupport executionSupport = PureTestBuilderCompiled.getClassLoaderExecutionSupport(); - return PureTestBuilderCompiled.buildSuite(TestCollection.collectTests(testPackage, executionSupport.getProcessorSupport(), ci -> PureTestBuilder.satisfiesConditions(ci, executionSupport.getProcessorSupport())), executionSupport); - } -} diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-spanner/legend-engine-xt-relationalStore-spanner-pure/src/main/resources/core_relational_spanner/relational/runtime/connection/spannerSpecification.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-spanner/legend-engine-xt-relationalStore-spanner-pure/src/main/resources/core_relational_spanner/relational/runtime/connection/spannerSpecification.pure index 42aec568886..fd243423c9e 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-spanner/legend-engine-xt-relationalStore-spanner-pure/src/main/resources/core_relational_spanner/relational/runtime/connection/spannerSpecification.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-spanner/legend-engine-xt-relationalStore-spanner-pure/src/main/resources/core_relational_spanner/relational/runtime/connection/spannerSpecification.pure @@ -14,9 +14,9 @@ Class meta::pure::alloy::connections::alloy::specification::SpannerDatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> projectId:String[1]; - <> instanceId:String[1]; - <> databaseId:String[1]; - <> proxyHost: String[0..1]; - <> proxyPort: Integer[0..1]; + projectId:String[1]; + instanceId:String[1]; + databaseId:String[1]; + proxyHost: String[0..1]; + proxyPort: Integer[0..1]; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/contract/storeContract.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/contract/storeContract.pure index 946e2cbabc2..161a866cfab 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/contract/storeContract.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/contract/storeContract.pure @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import meta::relational::contract::*; import meta::pure::router::metamodel::*; import meta::pure::router::systemMapping::tests::*; import meta::relational::mapping::*; @@ -30,7 +29,6 @@ import meta::pure::executionPlan::toString::*; import meta::pure::router::clustering::*; import meta::pure::graphFetch::executionPlan::*; import meta::pure::graphFetch::routing::*; -import meta::pure::alloy::connections::*; function meta::relational::contract::relationalStoreContract():StoreContract[1] { @@ -42,20 +40,6 @@ function meta::relational::contract::relationalStoreContract():StoreContract[1] planGraphFetchExecution = meta::relational::contract::planGraphFetchExecution_StoreMappingLocalGraphFetchExecutionNodeGenerationInput_1__LocalGraphFetchExecutionNode_1_, planCrossGraphFetchExecution = meta::relational::contract::planCrossGraphFetchExecution_StoreMappingCrossLocalGraphFetchExecutionNodeGenerationInput_1__LocalGraphFetchExecutionNode_1_, - connectionEquality = { b : Connection [1] | - [ - d: RelationalDatabaseConnection[1]| - let bAsRDB = $b->cast(@RelationalDatabaseConnection); - // connection element is the store name and we dont compare those - let comparison = $d.type == $bAsRDB.type && - $d.timeZone == $bAsRDB.timeZone && - $d.quoteIdentifiers == $bAsRDB.quoteIdentifiers && - $d.datasourceSpecification == $bAsRDB.datasourceSpecification && - compareObjectsWithPossiblyNoProperties($d.authenticationStrategy,$bAsRDB.authenticationStrategy) && - (($d.postProcessors->isEmpty() && $bAsRDB.postProcessors->isEmpty()) || ($d.postProcessors->isNotEmpty() && $bAsRDB.postProcessors->isNotEmpty() && $d.postProcessors == $bAsRDB.postProcessors)); - ] - }, - supports = meta::relational::contract::supports_FunctionExpression_1__Boolean_1_, supportsStreamFunction = meta::relational::contract::supportsStream_FunctionExpression_1__Boolean_1_, shouldStopRouting = [ @@ -238,17 +222,6 @@ function meta::relational::contract::planExecution(sq:meta::pure::mapping::Store ); } -function meta::relational::contract::compareObjectsWithPossiblyNoProperties(obj1: Any[1], obj2: Any[1]): Boolean[1] -{ - let propertyCountForObj1 = $obj1->type()->cast(@Class)->hierarchicalProperties()->size(); - let propertyCountForObj2 = $obj2->type()->cast(@Class)->hierarchicalProperties()->size(); - - if($propertyCountForObj1 == 0 && $propertyCountForObj2 == 0 - ,| true - ,| $obj1 == $obj2 - ); -} - function meta::relational::contract::planGraphFetchExecution(input: StoreMappingLocalGraphFetchExecutionNodeGenerationInput[1]): LocalGraphFetchExecutionNode[1] { meta::relational::graphFetch::executionPlan::planRootGraphFetchExecutionRelational($input.storeQuery, $input.ext, $input.clusteredTree, $input.orderedPaths, $input.mapping, $input.runtime, $input.exeCtx, $input.enableConstraints, $input.checked, $input.extensions, $input.debug) diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/extensions/extension.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/extensions/extension.pure index f2a5abfb86c..ead7599a286 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/extensions/extension.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/extensions/extension.pure @@ -15,8 +15,6 @@ import meta::external::language::java::factory::project::*; import meta::external::language::java::metamodel::project::*; import meta::pure::alloy::connections::*; -import meta::pure::alloy::connections::alloy::specification::*; -import meta::pure::alloy::connections::alloy::authentication::*; import meta::pure::executionPlan::*; import meta::pure::executionPlan::engine::java::*; import meta::pure::executionPlan::toString::*; @@ -224,11 +222,12 @@ function meta::relational::extension::relationalExtension() : meta::pure::extens }, testExtension_testedBy = {allReferenceUses:ReferenceUsage[*], extensions:Extension[*] | {soFarr:TestedByResult[1]| $allReferenceUses.owner->filter(o|$o->instanceOf(Database))->cast(@Database)->fold({db,tbr|$db->testedBy($tbr, $extensions)}, $soFarr)}}, validTestPackages = 'meta::relational::tests' - - ) + ) } + + //Helper Functions function meta::pure::router::clustering::getResolvedStore(rr: meta::relational::mapping::RootRelationalInstanceSetImplementation[*], mapping: Mapping[1]):Store[*] diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/runtime/connection/authenticationStrategy.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/runtime/connection/authenticationStrategy.pure index 46f7b8f2500..cea7442a70b 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/runtime/connection/authenticationStrategy.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/runtime/connection/authenticationStrategy.pure @@ -23,22 +23,23 @@ Class <> meta::pure::alloy::connections::alloy::authent Class meta::pure::alloy::connections::alloy::authentication::DelegatedKerberosAuthenticationStrategy extends meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy { - <> serverPrincipal: String[0..1]; + serverPrincipal: String[0..1]; } Class {doc.doc = 'Authentication using a middle tier user/password'} meta::pure::alloy::connections::alloy::authentication::MiddleTierUserNamePasswordAuthenticationStrategy extends meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy { - <> {doc.doc = 'Username/pasword vault reference'} vaultReference: String[1]; + {doc.doc = 'Username/pasword vault reference'} + vaultReference: String[1]; } Class meta::pure::alloy::connections::alloy::authentication::UserNamePasswordAuthenticationStrategy extends meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy { - <> baseVaultReference: String[0..1]; - <> userNameVaultReference: String[1]; - <> passwordVaultReference: String[1]; + baseVaultReference: String[0..1]; + userNameVaultReference: String[1]; + passwordVaultReference: String[1]; } Class meta::pure::alloy::connections::alloy::authentication::GCPApplicationDefaultCredentialsAuthenticationStrategy extends meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy @@ -51,7 +52,7 @@ Class meta::pure::alloy::connections::alloy::authentication::DefaultH2Authentica Class meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy extends meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy { - <> apiToken:String[1]; + apiToken:String[1]; } Class meta::pure::alloy::connections::alloy::authentication::TestDatabaseAuthenticationStrategy extends meta::pure::alloy::connections::alloy::authentication::DefaultH2AuthenticationStrategy @@ -60,6 +61,6 @@ Class meta::pure::alloy::connections::alloy::authentication::TestDatabaseAuthent Class meta::pure::alloy::connections::alloy::authentication::GCPWorkloadIdentityFederationAuthenticationStrategy extends meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy { - <> serviceAccountEmail : String[1]; - <> additionalGcpScopes: String[*]; + serviceAccountEmail : String[1]; + additionalGcpScopes: String[*]; } \ No newline at end of file diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/runtime/connection/datasourceSpecification.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/runtime/connection/datasourceSpecification.pure index 0eec4ed5d67..cc96e0c03b0 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/runtime/connection/datasourceSpecification.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/runtime/connection/datasourceSpecification.pure @@ -18,21 +18,20 @@ Class <> meta::pure::alloy::connections::alloy::specific Class meta::pure::alloy::connections::alloy::specification::StaticDatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> host: String[1]; - <> port: Integer[1]; - <> databaseName: String[1]; + host: String[1]; + port: Integer[1]; + databaseName: String[1]; } Class meta::pure::alloy::connections::alloy::specification::EmbeddedH2DatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> databaseName:String[1]; - <> directory:String[1]; - <> autoServerMode:Boolean[1]; - + databaseName:String[1]; + directory:String[1]; + autoServerMode:Boolean[1]; } Class meta::pure::alloy::connections::alloy::specification::LocalH2DatasourceSpecification extends meta::pure::alloy::connections::alloy::specification::DatasourceSpecification { - <> testDataSetupCsv:String[0..1]; - <> testDataSetupSqls:String[*]; + testDataSetupCsv:String[0..1]; + testDataSetupSqls:String[*]; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/tests/testRelationalExtension.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/tests/testRelationalExtension.pure index ec9c4db84d7..6244fa06434 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/tests/testRelationalExtension.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/tests/testRelationalExtension.pure @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import meta::relational::metamodel::execute::tests::*; -import meta::pure::alloy::connections::*; import meta::pure::runtime::*; import meta::relational::translation::*; import meta::pure::extension::*; @@ -24,119 +22,6 @@ import meta::relational::metamodel::execute::*; import meta::relational::metamodel::*; import meta::pure::mapping::*; -function meta::relational::metamodel::execute::tests::runRelationalRouterExtensionConnectionEquality(c1: RelationalDatabaseConnection[1], - c2: RelationalDatabaseConnection[1]) : Boolean[1] -{ - let extensions = meta::relational::extension::relationalExtensions().routerExtensions(); - $c1->match( - $extensions.connectionEquality->map(e | $e->eval($c2))->concatenate([ - a:Connection[1] | true - ])->toOneMany()); -} - -function <> meta::relational::metamodel::execute::tests::testConnectionEqualityAllSameStatic() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.SybaseIQ, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::StaticDatasourceSpecification(host='host', port=8080, databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::DefaultH2AuthenticationStrategy() - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.SybaseIQ, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::StaticDatasourceSpecification(host='host', port=8080, databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::DefaultH2AuthenticationStrategy() - ); - - assert(runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - -function <> meta::relational::metamodel::execute::tests::testConnectionEqualityAllButOnePropertySame() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.Snowflake, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::StaticDatasourceSpecification(host='host', port=8090, databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::DefaultH2AuthenticationStrategy() - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.Snowflake, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::StaticDatasourceSpecification(host='host', port=8080, databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - assert(!runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - -function <> meta::relational::metamodel::execute::tests::testConnectionEqualityTypeDiff() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.H2, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::LocalH2DatasourceSpecification(), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::DefaultH2AuthenticationStrategy() - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.Snowflake, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::StaticDatasourceSpecification(host='host', port=8080, databaseName='db'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - - assert(!runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - - -function <> meta::relational::metamodel::execute::tests::testConnectionEqualityTypeSameSpecDiff() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.H2, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::LocalH2DatasourceSpecification(), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::DefaultH2AuthenticationStrategy() - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.H2, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::LocalH2DatasourceSpecification(testDataSetupCsv='something'), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::DefaultH2AuthenticationStrategy() - ); - - - assert(!runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} - -function <> meta::relational::metamodel::execute::tests::testConnectionEqualityTypeSpecSameAuthDiff() : Boolean[1] -{ - let c1 = ^RelationalDatabaseConnection( - element = 'Store1', - type = DatabaseType.H2, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::LocalH2DatasourceSpecification(), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::DefaultH2AuthenticationStrategy() - ); - - let c2 = ^RelationalDatabaseConnection( - element = '', - type = DatabaseType.H2, - datasourceSpecification = ^meta::pure::alloy::connections::alloy::specification::LocalH2DatasourceSpecification(), - authenticationStrategy = ^meta::pure::alloy::connections::alloy::authentication::ApiTokenAuthenticationStrategy(apiToken='token') - ); - - - assert(!runRelationalRouterExtensionConnectionEquality($c1, $c2)); - -} function <> meta::relational::metamodel::execute::tests::testExecuteInDbToTDS() : Boolean[1] {