Skip to content

Commit

Permalink
BigQuery Activator: Sandbox (#2438)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasirmod17 authored Nov 6, 2023
1 parent d08df61 commit 050cb60
Show file tree
Hide file tree
Showing 45 changed files with 2,109 additions and 1 deletion.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/legend-engine-xts-analytics/** @finos/legend-engine-maintainers
/legend-engine-xts-authentication/** @finos/legend-engine-maintainers
/legend-engine-xts-avro/** @finos/legend-engine-maintainers
/legend-engine-xts-bigqueryFunction/** @finos/legend-engine-maintainers
/legend-engine-xts-changetoken/** @finos/legend-engine-maintainers
/legend-engine-xts-daml/** @finos/legend-engine-maintainers
/legend-engine-xts-data-push/** @finos/legend-engine-maintainers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,21 @@
</dependency>
<!-- Snowflake App -->

<!-- BigQuery Function -->
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-compiler</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-grammar</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-protocol</artifactId>
</dependency>
<!-- BigQuery Function -->

<!-- Text -->
<dependency>
<groupId>org.finos.legend.engine</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import org.finos.legend.engine.generation.DataSpaceAnalyticsArtifactGenerationExtension;
import org.finos.legend.engine.generation.OpenApiArtifactGenerationExtension;
import org.finos.legend.engine.generation.SearchDocumentArtifactGenerationExtension;
import org.finos.legend.engine.language.bigqueryFunction.compiler.toPureGraph.BigQueryFunctionCompilerExtension;
import org.finos.legend.engine.language.bigqueryFunction.grammar.from.BigQueryFunctionGrammarParserExtension;
import org.finos.legend.engine.language.bigqueryFunction.grammar.to.BigQueryFunctionGrammarComposer;
import org.finos.legend.engine.language.graphQL.grammar.integration.GraphQLGrammarParserExtension;
import org.finos.legend.engine.language.graphQL.grammar.integration.GraphQLPureGrammarComposerExtension;
import org.finos.legend.engine.language.pure.compiler.toPureGraph.PureModel;
Expand Down Expand Up @@ -77,7 +80,7 @@
import org.finos.legend.engine.language.sql.grammar.integration.SQLGrammarParserExtension;
import org.finos.legend.engine.language.sql.grammar.integration.SQLPureGrammarComposerExtension;
import org.finos.legend.engine.language.stores.elasticsearch.v7.from.ElasticsearchGrammarParserExtension;
import org.finos.legend.engine.protocol.mongodb.schema.metamodel.MongoDBPureProtocolExtension;
import org.finos.legend.engine.protocol.bigqueryFunction.metamodel.BigQueryFunctionProtocolExtension;
import org.finos.legend.pure.code.core.ElasticsearchPureCoreExtension;
import org.finos.legend.engine.language.stores.elasticsearch.v7.to.ElasticsearchGrammarComposerExtension;
import org.finos.legend.engine.protocol.pure.v1.extension.PureProtocolExtension;
Expand Down Expand Up @@ -267,6 +270,7 @@ protected Iterable<? extends Class<? extends PureProtocolExtension>> getExpected
.with(org.finos.legend.engine.protocol.pure.v1.CorePureProtocolExtension.class)
.with(org.finos.legend.engine.protocol.pure.v1.DataSpaceProtocolExtension.class)
.with(SnowflakeAppProtocolExtension.class)
.with(BigQueryFunctionProtocolExtension.class)
.with(org.finos.legend.engine.protocol.pure.v1.DiagramProtocolExtension.class)
.with(org.finos.legend.engine.protocol.pure.v1.GenerationProtocolExtension.class)
.with(org.finos.legend.engine.protocol.pure.v1.PersistenceProtocolExtension.class)
Expand Down Expand Up @@ -311,6 +315,7 @@ protected Iterable<? extends Class<? extends PureGrammarParserExtension>> getExp
.with(CorePureGrammarParser.class)
.with(DataSpaceParserExtension.class)
.with(SnowflakeAppGrammarParserExtension.class)
.with(BigQueryFunctionGrammarParserExtension.class)
.with(DiagramParserExtension.class)
.with(ExternalFormatGrammarParserExtension.class)
.with(GenerationParserExtension.class)
Expand All @@ -337,6 +342,7 @@ protected Iterable<? extends Class<? extends PureGrammarComposerExtension>> getE
.with(CorePureGrammarComposer.class)
.with(DataSpaceGrammarComposerExtension.class)
.with(SnowflakeAppGrammarComposer.class)
.with(BigQueryFunctionGrammarComposer.class)
.with(DiagramGrammarComposerExtension.class)
.with(ExternalFormatGrammarComposerExtension.class)
.with(GenerationGrammarComposerExtension.class)
Expand Down Expand Up @@ -368,6 +374,7 @@ protected Iterable<? extends Class<? extends CompilerExtension>> getExpectedComp
return Lists.mutable.<Class<? extends CompilerExtension>>empty()
.with(org.finos.legend.engine.language.pure.compiler.toPureGraph.DiagramCompilerExtension.class)
.with(SnowflakeAppCompilerExtension.class)
.with(BigQueryFunctionCompilerExtension.class)
.with(org.finos.legend.engine.language.pure.compiler.toPureGraph.DataSpaceCompilerExtension.class)
.with(org.finos.legend.engine.language.pure.compiler.toPureGraph.TextCompilerExtension.class)
.with(org.finos.legend.engine.language.pure.compiler.toPureGraph.CoreCompilerExtension.class)
Expand Down Expand Up @@ -519,6 +526,7 @@ protected Iterable<String> getExpectedCodeRepositories()
.with("core_servicestore")
.with("core_authentication")
.with("core_snowflakeapp")
.with("core_bigqueryfunction")
.with("core_text_metamodel")
.with("core_external_language_java")
.with("core_java_platform_binding")
Expand Down
19 changes: 19 additions & 0 deletions legend-engine-config/legend-engine-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-functionActivator-protocol</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-protocol</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-artifact-generation-api</artifactId>
Expand Down Expand Up @@ -341,6 +345,21 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-snowflakeApp-generator</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-compiler</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-grammar</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-hostedService-compiler</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
import org.finos.legend.engine.plan.execution.stores.service.plugin.ServiceStoreExecutor;
import org.finos.legend.engine.plan.execution.stores.service.plugin.ServiceStoreExecutorBuilder;
import org.finos.legend.engine.plan.generation.extension.PlanGeneratorExtension;
import org.finos.legend.engine.protocol.bigqueryFunction.metamodel.BigQueryFunctionDeploymentConfiguration;
import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory;
import org.finos.legend.engine.protocol.pure.v1.model.PureProtocol;
import org.finos.legend.engine.pure.code.core.PureCoreExtensionLoader;
Expand Down Expand Up @@ -219,6 +220,7 @@ protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(
bootstrap.getObjectMapper().registerSubtypes(new NamedType(LegendDefaultDatabaseAuthenticationFlowProviderConfiguration.class, "legendDefault"));
bootstrap.getObjectMapper().registerSubtypes(new NamedType(HostedServiceDeploymentConfiguration.class, "hostedServiceConfig"));
bootstrap.getObjectMapper().registerSubtypes(new NamedType(SnowflakeAppDeploymentConfiguration.class, "snowflakeAppConfig"));
bootstrap.getObjectMapper().registerSubtypes(new NamedType(BigQueryFunctionDeploymentConfiguration.class, "snowflakeAppConfig"));
}

public CredentialProviderProvider configureCredentialProviders(List<VaultConfiguration> vaultConfigurations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected MutableList<RepositoryCodeStorage> buildRepositories(SourceLocationCon
.with(this.buildCore("legend-engine-xts-mastery/legend-engine-xt-mastery-pure", "mastery"))
.with(this.buildCore("legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-pure", "function_activator"))
.with(this.buildCore("legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-pure", "snowflakeapp"))
.with(this.buildCore("legend-engine-xts-bigqueryFunction/legend-engine-xt-bigqueryFunction-pure", "bigqueryfunction"))
.with(this.buildCore("legend-engine-xts-hostedService/legend-engine-xt-hostedService-pure", "hostedservice"))
.with(this.buildCore("legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure", "relational"))
.with(this.buildCore("legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-javaPlatformBinding-pure", "relational-java-platform-binding"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xts-bigqueryFunction</artifactId>
<version>4.34.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>legend-engine-xt-bigqueryFunction-api</artifactId>
<packaging>jar</packaging>
<name>Legend Engine - XT - BigQuery Function - API</name>

<dependencies>
<!-- Pure -->
<dependency>
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-m3-core</artifactId>
</dependency>
<!-- Pure -->

<!-- ENGINE -->
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-language-pure-compiler</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-language-pure-modelManager</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-pure-code-compiled-core</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-pure-code-core-extension</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-executionPlan-generation</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-core</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-functionActivator-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-protocol-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-functionActivator-api</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-relationalStore-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-relationalStore-bigquery-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-relationalStore-protocol</artifactId>
</dependency>

<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-protocol</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-compiler</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-bigqueryFunction-grammar</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-language-pure-dsl-generation</artifactId>
</dependency>
<!-- ENGINE -->

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<!-- BigQuery -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>2.29.0</version>
<exclusions>
<exclusion>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-format</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- BigQuery -->

<!-- ECLIPSE COLLECTIONS -->
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
</dependency>
<!-- ECLIPSE COLLECTIONS -->

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- Logging -->

<!-- TEST -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-relationalStore-grammar</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-configuration</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<scope>test</scope>
</dependency>
<!-- TEST -->
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 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.language.bigqueryFunction.api;

import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.api.list.ImmutableList;
import org.finos.legend.engine.functionActivator.service.FunctionActivatorError;

public class BigQueryFunctionError extends FunctionActivatorError
{
public ImmutableList<String> foundSQLs;

public BigQueryFunctionError(String message, Iterable<String> foundSQLs)
{
super(message);
this.foundSQLs = Lists.immutable.withAll(foundSQLs);
}
}
Loading

0 comments on commit 050cb60

Please sign in to comment.