diff --git a/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/DeploymentResult.java b/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/DeploymentResult.java index f63aa8f8b95..c6b6fa25b2c 100644 --- a/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/DeploymentResult.java +++ b/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/DeploymentResult.java @@ -18,4 +18,5 @@ public class DeploymentResult { public String activatorIdentifier; public boolean successful; + public String deploymentLocation; } diff --git a/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/FunctionActivatorArtifact.java b/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/FunctionActivatorArtifact.java index c16fee7c2c2..e811e5ee046 100644 --- a/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/FunctionActivatorArtifact.java +++ b/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/FunctionActivatorArtifact.java @@ -14,11 +14,14 @@ package org.finos.legend.engine.protocol.functionActivator.deployment; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonTypeInfo; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "_type") +@JsonIgnoreProperties(ignoreUnknown = true) public class FunctionActivatorArtifact { public FunctionActivatorDeploymentContent content; public FunctionActivatorDeploymentConfiguration deploymentConfiguration; + public String deployedLocation; } diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeAppDeploymentManager.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeAppDeploymentManager.java index b003814bd66..715ed4692b9 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeAppDeploymentManager.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeAppDeploymentManager.java @@ -54,6 +54,13 @@ public class SnowflakeAppDeploymentManager implements DeploymentManager generateStatements(String catalogName, SnowflakeAppContent content) { MutableList statements = Lists.mutable.empty(); - if (content.type.equals("STAGE")) - { - String deploymentTableName = String.format("%s.%s." + deploymentTable, catalogName, deploymentSchema); - statements.add(String.format("insert into %s(CREATE_DATETIME, APP_NAME, SQL_FRAGMENT, VERSION_NUMBER, OWNER, DESCRIPTION) values('%s', '%s', '%s', '%s', '%s', '%s');", - deploymentTableName, content.creationTime, content.applicationName, content.sqlExpressions.getFirst(), content.getVersionInfo(), Lists.mutable.withAll(content.owners).makeString(","), content.description)); - - } - else - { - statements.add(String.format("CREATE OR REPLACE FUNCTION %S.%S.%s() RETURNS TABLE (%s) as $$ %s $$;", catalogName, deploymentSchema, content.applicationName, content.functionArguments, content.sqlExpressions.getFirst(), content.description)); - statements.add(String.format("CREATE OR REPLACE SECURE FUNCTION %S.%S.%s() RETURNS TABLE (%s) as $$ %s $$;", catalogName, deploymentSchema, content.applicationName, content.functionArguments, content.sqlExpressions.getFirst(), content.description)); - } + statements.add(String.format("CREATE OR REPLACE SECURE FUNCTION %S.%S.%s() RETURNS TABLE (%s) as $$ %s $$;", catalogName, deploymentSchema, content.applicationName, content.functionArguments, content.sqlExpressions.getFirst(), content.description)); return statements; } diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeDeploymentResult.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeDeploymentResult.java index 8bfc1a49de6..e8fe931d241 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeDeploymentResult.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeDeploymentResult.java @@ -22,10 +22,11 @@ public class SnowflakeDeploymentResult extends DeploymentResult public MutableList errors; - public SnowflakeDeploymentResult(String activatorIdentifier, boolean result) + public SnowflakeDeploymentResult(String activatorIdentifier, boolean result, String deploymentLocation) { this.successful = result; this.activatorIdentifier = activatorIdentifier; + this.deploymentLocation = deploymentLocation; } public SnowflakeDeploymentResult(MutableList errors) diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-compiler/src/main/java/org/finos/legend/engine/language/snowflakeApp/compiler/toPureGraph/SnowflakeAppCompilerExtension.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-compiler/src/main/java/org/finos/legend/engine/language/snowflakeApp/compiler/toPureGraph/SnowflakeAppCompilerExtension.java index da0d044e18c..ee7e8082f4b 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-compiler/src/main/java/org/finos/legend/engine/language/snowflakeApp/compiler/toPureGraph/SnowflakeAppCompilerExtension.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-compiler/src/main/java/org/finos/legend/engine/language/snowflakeApp/compiler/toPureGraph/SnowflakeAppCompilerExtension.java @@ -63,7 +63,6 @@ public Root_meta_external_function_activator_snowflakeApp_SnowflakeApp buildSnow ._function(func) ._description(app.description) ._owner(app.owner) - ._type(app.type != null ? context.pureModel.getEnumValue("meta::external::function::activator::snowflakeApp::SnowflakeDeploymentType", app.type.toString()) : context.pureModel.getEnumValue("meta::external::function::activator::snowflakeApp::SnowflakeDeploymentType", "FULL")) ._activationConfiguration(app.activationConfiguration != null ? buildDeploymentConfig((SnowflakeAppDeploymentConfiguration) app.activationConfiguration, context) : null); } catch (Exception e) diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-generator/src/main/java/org/finos/legend/engine/language/snowflakeApp/generator/SnowflakeAppGenerator.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-generator/src/main/java/org/finos/legend/engine/language/snowflakeApp/generator/SnowflakeAppGenerator.java index aa7e4335e97..ec1687597bb 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-generator/src/main/java/org/finos/legend/engine/language/snowflakeApp/generator/SnowflakeAppGenerator.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-generator/src/main/java/org/finos/legend/engine/language/snowflakeApp/generator/SnowflakeAppGenerator.java @@ -58,7 +58,7 @@ public static SnowflakeAppArtifact generateArtifact(PureModel pureModel, Root_me sdlc = (AlloySDLC) sdlcInfo; } } - SnowflakeAppContent content = new SnowflakeAppContent(activator._applicationName(), Lists.mutable.withAll(sqlExpressions), activator._description(), functionColumns, activator._type()._name(), Lists.mutable.with(activator._owner()), sdlc); + SnowflakeAppContent content = new SnowflakeAppContent(activator._applicationName(), Lists.mutable.withAll(sqlExpressions), activator._description(), functionColumns, Lists.mutable.with(activator._owner()), sdlc); if (activator._activationConfiguration() != null) { //identify connection @@ -67,7 +67,9 @@ public static SnowflakeAppArtifact generateArtifact(PureModel pureModel, Root_me .getFirst(); connection = (RelationalDatabaseConnection) Lists.mutable.withAll(((PureModelContextData) inputModel).getElementsOfType(PackageableConnection.class)) .select(c -> c.getPath().equals(((org.finos.legend.engine.protocol.snowflakeApp.metamodel.SnowflakeAppDeploymentConfiguration)protocolActivator.activationConfiguration).activationConnection.connection)).getFirst().connectionValue; - return new SnowflakeAppArtifact(content, new SnowflakeAppDeploymentConfiguration(connection)); + SnowflakeDatasourceSpecification ds = (SnowflakeDatasourceSpecification)connection.datasourceSpecification; + String deployedLocation = String.format("https://app.%s.privatelink.snowflakecomputing.com/%s/%s/data/databases/%S", ds.region, ds.region, ds.accountName, ds.databaseName); + return new SnowflakeAppArtifact(content, new SnowflakeAppDeploymentConfiguration(connection), deployedLocation); } return new SnowflakeAppArtifact(content); diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/pom.xml b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/pom.xml index 33666980e0e..d7a4e6c3ce9 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/pom.xml +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/pom.xml @@ -120,10 +120,6 @@ org.finos.legend.engine legend-engine-protocol-pure - - org.finos.legend.engine - legend-engine-shared-core - diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/SnowflakeAppLexerGrammar.g4 b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/SnowflakeAppLexerGrammar.g4 index 180679616ee..8a1eb1451c6 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/SnowflakeAppLexerGrammar.g4 +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/SnowflakeAppLexerGrammar.g4 @@ -7,7 +7,6 @@ SNOWFLAKE_APP__APPLICATION_NAME: 'applicationName'; SNOWFLAKE_APP__DESCRIPTION: 'description'; SNOWFLAKE_APP__FUNCTION: 'function'; SNOWFLAKE_APP__OWNER: 'owner'; -SNOWFLAKE_APP__TYPE: 'type'; SNOWFLAKE_APP__ACTIVATION: 'activationConfiguration'; // ------------------------------------- CONFIGURATION ------------------------------- diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/SnowflakeAppParserGrammar.g4 b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/SnowflakeAppParserGrammar.g4 index 666e316e235..be29564551c 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/SnowflakeAppParserGrammar.g4 +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/SnowflakeAppParserGrammar.g4 @@ -13,7 +13,6 @@ identifier: VALID_STRING | STRING | SNOWFLAKE_APP__DESCRIPTION | SNOWFLAKE_APP__FUNCTION | SNOWFLAKE_APP__OWNER | - SNOWFLAKE_APP__TYPE | SNOWFLAKE_APP__ACTIVATION| CONFIGURATION| DEPLOYMENT_STAGE | ACTIVATION_CONNECTION | @@ -35,7 +34,6 @@ snowflakeApp: SNOWFLAKE_APP stereotypes? taggedValues? qualifi | description | function | owner - | type | activation )* BRACE_CLOSE; @@ -53,8 +51,6 @@ function: SNOWFLAKE_APP__FUNCTION COLON functionIdentifier owner : SNOWFLAKE_APP__OWNER COLON STRING SEMI_COLON; -type : SNOWFLAKE_APP__TYPE COLON identifier SEMI_COLON; - activation: SNOWFLAKE_APP__ACTIVATION COLON qualifiedName SEMI_COLON ; // ----------------------------------- Deployment ------------------------------------------------------ diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/java/org/finos/legend/engine/language/snowflakeApp/grammar/from/SnowflakeAppTreeWalker.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/java/org/finos/legend/engine/language/snowflakeApp/grammar/from/SnowflakeAppTreeWalker.java index a733f04b428..354971d2fe4 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/java/org/finos/legend/engine/language/snowflakeApp/grammar/from/SnowflakeAppTreeWalker.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/java/org/finos/legend/engine/language/snowflakeApp/grammar/from/SnowflakeAppTreeWalker.java @@ -31,7 +31,6 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.section.DefaultCodeSection; import org.finos.legend.engine.protocol.snowflakeApp.metamodel.SnowflakeApp; import org.finos.legend.engine.protocol.snowflakeApp.metamodel.SnowflakeAppDeploymentConfiguration; -import org.finos.legend.engine.protocol.snowflakeApp.metamodel.SnowflakeAppType; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import java.util.Collections; @@ -83,19 +82,6 @@ private SnowflakeApp visitSnowflakeApp(SnowflakeAppParserGrammar.SnowflakeAppCon { snowflakeApp.owner = PureGrammarParserUtility.fromGrammarString(ownerContext.STRING().getText(), true); } - SnowflakeAppParserGrammar.TypeContext typeContext = PureGrammarParserUtility.validateAndExtractOptionalField(ctx.type(), "type", snowflakeApp.sourceInformation); - if (typeContext != null) - { - try - { - snowflakeApp.type = SnowflakeAppType.valueOf(PureGrammarParserUtility.fromIdentifier(typeContext.identifier())); - } - catch (Exception e) - { - throw new EngineException("Unknown type '" + PureGrammarParserUtility.fromIdentifier(typeContext.identifier()) + "'", this.walkerSourceInformation.getSourceInformation(typeContext), EngineErrorType.PARSER); - } - } - SnowflakeAppParserGrammar.DescriptionContext descriptionContext = PureGrammarParserUtility.validateAndExtractOptionalField(ctx.description(), "description", snowflakeApp.sourceInformation); if (descriptionContext != null) { diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/java/org/finos/legend/engine/language/snowflakeApp/grammar/to/SnowflakeAppGrammarComposer.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/java/org/finos/legend/engine/language/snowflakeApp/grammar/to/SnowflakeAppGrammarComposer.java index 4d7ece0c413..8ca5f4d8c93 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/java/org/finos/legend/engine/language/snowflakeApp/grammar/to/SnowflakeAppGrammarComposer.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/main/java/org/finos/legend/engine/language/snowflakeApp/grammar/to/SnowflakeAppGrammarComposer.java @@ -54,7 +54,6 @@ private static String renderSnowflakeApp(SnowflakeApp app) " function : " + app.function.path + ";\n" + (app.owner == null ? "" : " owner : '" + app.owner + "';\n") + (app.description == null ? "" : " description : '" + app.description + "';\n") + - (app.type == null ? "" : " type : " + app.type.name() + ";\n") + (app.activationConfiguration == null ? "" : " activationConfiguration : " + ((SnowflakeAppDeploymentConfiguration)app.activationConfiguration).activationConnection.connection + ";\n") + "}"; } diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/test/java/org/finos/legend/engine/language/snowflakeApp/grammar/test/TestSnowflakeAppRoundtrip.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/test/java/org/finos/legend/engine/language/snowflakeApp/grammar/test/TestSnowflakeAppRoundtrip.java index a733a083c52..16dd98acddf 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/test/java/org/finos/legend/engine/language/snowflakeApp/grammar/test/TestSnowflakeAppRoundtrip.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/test/java/org/finos/legend/engine/language/snowflakeApp/grammar/test/TestSnowflakeAppRoundtrip.java @@ -29,7 +29,6 @@ public void testSnowflakeApp() " function : zxx(Integer[1]):String[1];\n" + " owner : 'pierre';\n" + " description : 'A super nice app!';\n" + - " type : STAGE;\n" + " activationConfiguration : a::b::connection;\n" + "}\n"); } diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/test/java/org/finos/legend/engine/language/snowflakeApp/grammar/test/TestSnowflakeParsing.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/test/java/org/finos/legend/engine/language/snowflakeApp/grammar/test/TestSnowflakeParsing.java index 2beafe81dc7..1edd7bbe4f7 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/test/java/org/finos/legend/engine/language/snowflakeApp/grammar/test/TestSnowflakeParsing.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-grammar/src/test/java/org/finos/legend/engine/language/snowflakeApp/grammar/test/TestSnowflakeParsing.java @@ -48,7 +48,7 @@ public void testGetParserErrorWrongProperty() "SnowflakeApp x::A\n" + "{\n" + " applicatioName : 'sass';\n" + - "}\n", "PARSER error at [4:4-17]: Unexpected token 'applicatioName'. Valid alternatives: ['applicationName', 'description', 'function', 'owner', 'type', 'activationConfiguration']"); + "}\n", "PARSER error at [4:4-17]: Unexpected token 'applicatioName'. Valid alternatives: ['applicationName', 'description', 'function', 'owner', 'activationConfiguration']"); } @Test diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/pom.xml b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/pom.xml index 6e792d44b61..2ad4998914d 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/pom.xml +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/pom.xml @@ -44,6 +44,11 @@ eclipse-collections-api + + com.fasterxml.jackson.core + jackson-annotations + + junit diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/deployment/SnowflakeAppArtifact.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/deployment/SnowflakeAppArtifact.java index 3115f9b154c..21281c83514 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/deployment/SnowflakeAppArtifact.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/deployment/SnowflakeAppArtifact.java @@ -29,10 +29,11 @@ public SnowflakeAppArtifact(SnowflakeAppContent content) this.content = content; } - public SnowflakeAppArtifact(SnowflakeAppContent content, SnowflakeAppDeploymentConfiguration config) + public SnowflakeAppArtifact(SnowflakeAppContent content, SnowflakeAppDeploymentConfiguration config, String deployedLocation) { this(content); this.deploymentConfiguration = config; + this.deployedLocation = deployedLocation; } } diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/deployment/SnowflakeAppContent.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/deployment/SnowflakeAppContent.java index 6bbe1c1b9db..35ef6ff4ad7 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/deployment/SnowflakeAppContent.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/deployment/SnowflakeAppContent.java @@ -27,7 +27,6 @@ public class SnowflakeAppContent extends FunctionActivatorDeploymentContent { public MutableList sqlExpressions = Lists.mutable.empty(); public String functionArguments; - public String type; public String applicationName; public String description; public List owners; @@ -41,13 +40,12 @@ public SnowflakeAppContent() //Empty constructor for Jackson } - public SnowflakeAppContent(String applicationName, MutableList sqlExpressions, String functionArguments, String type, AlloySDLC sdlc) + public SnowflakeAppContent(String applicationName, MutableList sqlExpressions, String functionArguments, AlloySDLC sdlc) { this.applicationName = applicationName; this.sqlExpressions = sqlExpressions; this.creationTime = convertToValidDate(new Date()); this.functionArguments = functionArguments; - this.type = type; if (sdlc != null) { this.groupId = sdlc.groupId; @@ -56,9 +54,9 @@ public SnowflakeAppContent(String applicationName, MutableList sqlExpres } } - public SnowflakeAppContent(String applicationName, MutableList sqlExpressions, String description, String functionArguments, String type,List owners, AlloySDLC sdlc) + public SnowflakeAppContent(String applicationName, MutableList sqlExpressions, String description, String functionArguments, List owners, AlloySDLC sdlc) { - this(applicationName, sqlExpressions, functionArguments, type, sdlc); + this(applicationName, sqlExpressions, functionArguments, sdlc); this.description = description; this.owners = owners; diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/metamodel/SnowflakeApp.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/metamodel/SnowflakeApp.java index 7c0aedc93a4..b0547a4b2d2 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/metamodel/SnowflakeApp.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/metamodel/SnowflakeApp.java @@ -14,21 +14,17 @@ package org.finos.legend.engine.protocol.snowflakeApp.metamodel; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.finos.legend.engine.protocol.functionActivator.metamodel.FunctionActivator; -import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; -import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.StereotypePtr; -import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TaggedValue; -import java.util.Collections; -import java.util.List; //------------------------------------------------------------ // Should be generated out of the Pure protocol specification //------------------------------------------------------------ +@JsonIgnoreProperties(ignoreUnknown = true) public class SnowflakeApp extends FunctionActivator { public String applicationName; public String description; public String owner; - public SnowflakeAppType type; } diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/metamodel/SnowflakeAppType.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/metamodel/SnowflakeAppType.java deleted file mode 100644 index f362f5f1674..00000000000 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-protocol/src/main/java/org/finos/legend/engine/protocol/snowflakeApp/metamodel/SnowflakeAppType.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2023 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.engine.protocol.snowflakeApp.metamodel; - -public enum SnowflakeAppType -{ - STAGE, FULL -} diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-pure/src/main/resources/core_snowflakeapp/metamodel/metamodel.pure b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-pure/src/main/resources/core_snowflakeapp/metamodel/metamodel.pure index eec22e2b59d..da4b584f68a 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-pure/src/main/resources/core_snowflakeapp/metamodel/metamodel.pure +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-pure/src/main/resources/core_snowflakeapp/metamodel/metamodel.pure @@ -6,7 +6,6 @@ Class meta::external::function::activator::snowflakeApp::SnowflakeApp extends Fu applicationName : String[1]; description : String[0..1]; owner : String[0..1]; - type: SnowflakeDeploymentType[0..1] ;//default to full } Class meta::external::function::activator::snowflakeApp::SnowflakeDeploymentConfiguration extends DeploymentConfiguration @@ -19,10 +18,6 @@ Class meta::external::function::activator::snowflakeApp::SnowflakeApp extends Fu } -Enum meta::external::function::activator::snowflakeApp::SnowflakeDeploymentType -{ - STAGE, FULL -} // This section needs to be code generated from the section above Class meta::protocols::pure::vX_X_X::metamodel::function::activator::snowflakeApp::SnowflakeApp extends meta::protocols::pure::vX_X_X::metamodel::function::activator::FunctionActivator