generated from finos/software-project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Legend SQl - add new source providers (#2413)
- Loading branch information
Showing
50 changed files
with
2,931 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-core/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
|
||
<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-xt-sql-providers</artifactId> | ||
<version>4.32.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>legend-engine-xt-sql-providers-core</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Legend Engine - XT - SQL - Providers - Core</name> | ||
|
||
<dependencies> | ||
|
||
<!-- ENGINE --> | ||
<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-sql-protocol</artifactId> | ||
</dependency> | ||
<!-- ENGINE --> | ||
|
||
<!-- 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 --> | ||
|
||
<!-- AUTHENTICATION --> | ||
<dependency> | ||
<groupId>org.pac4j</groupId> | ||
<artifactId>pac4j-core</artifactId> | ||
</dependency> | ||
<!-- AUTHENTICATION --> | ||
|
||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
</dependency> | ||
|
||
<!-- TEST --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- TEST --> | ||
</dependencies> | ||
</project> |
31 changes: 31 additions & 0 deletions
31
...roviders-core/src/main/java/org/finos/legend/engine/query/sql/api/sources/SQLContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// 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.query.sql.api.sources; | ||
|
||
import org.finos.legend.engine.protocol.sql.metamodel.Node; | ||
|
||
/** | ||
* @deprecated | ||
* Use {@link org.finos.legend.engine.query.sql.providers.core.SQLContext} | ||
*/ | ||
@Deprecated | ||
public class SQLContext extends org.finos.legend.engine.query.sql.providers.core.SQLContext | ||
{ | ||
public SQLContext(Node query) | ||
{ | ||
super(query); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...providers-core/src/main/java/org/finos/legend/engine/query/sql/api/sources/SQLSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// 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.query.sql.api.sources; | ||
|
||
import org.eclipse.collections.impl.utility.ListIterate; | ||
import org.finos.legend.engine.protocol.pure.v1.model.executionOption.ExecutionOption; | ||
import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.runtime.Runtime; | ||
import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; | ||
import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.executionContext.ExecutionContext; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @deprecated | ||
* Use {@link org.finos.legend.engine.query.sql.providers.core.SQLSource} | ||
*/ | ||
@Deprecated | ||
public class SQLSource extends org.finos.legend.engine.query.sql.providers.core.SQLSource | ||
{ | ||
public SQLSource(String type, Lambda func, String mapping, Runtime runtime, List<ExecutionOption> executionOptions, List<SQLSourceArgument> key) | ||
{ | ||
this(type, func, mapping, runtime, executionOptions, null, key); | ||
} | ||
|
||
public SQLSource(String type, Lambda func, String mapping, Runtime runtime, List<ExecutionOption> executionOptions, ExecutionContext executionContext, List<SQLSourceArgument> key) | ||
{ | ||
super(type, func, mapping, runtime, executionOptions, executionContext, ListIterate.collect(key, k -> new org.finos.legend.engine.query.sql.providers.core.SQLSourceArgument(k.getName(), k.getIndex(), k.getValue()))); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...s-core/src/main/java/org/finos/legend/engine/query/sql/api/sources/SQLSourceArgument.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 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.query.sql.api.sources; | ||
|
||
/** | ||
* @deprecated | ||
* Use {@link org.finos.legend.engine.query.sql.providers.core.SQLSourceArgument} | ||
*/ | ||
@Deprecated | ||
public class SQLSourceArgument extends org.finos.legend.engine.query.sql.providers.core.SQLSourceArgument | ||
{ | ||
public SQLSourceArgument(String name, Integer index, Object value) | ||
{ | ||
super(name, index, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...src/main/java/org/finos/legend/engine/query/sql/api/sources/SQLSourceResolvedContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// 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.query.sql.api.sources; | ||
|
||
import org.eclipse.collections.impl.list.mutable.FastList; | ||
import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContext; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @deprecated | ||
* Use {@link org.finos.legend.engine.query.sql.providers.core.SQLSourceResolvedContext} | ||
*/ | ||
@Deprecated | ||
public class SQLSourceResolvedContext | ||
{ | ||
private final List<PureModelContext> pureModelContexts; | ||
private final List<SQLSource> sources; | ||
|
||
public SQLSourceResolvedContext(PureModelContext pureModelContext, List<SQLSource> sources) | ||
{ | ||
this(FastList.newListWith(pureModelContext), sources); | ||
} | ||
|
||
public SQLSourceResolvedContext(List<PureModelContext> pureModelContexts, List<SQLSource> sources) | ||
{ | ||
this.pureModelContexts = pureModelContexts != null ? pureModelContexts : FastList.newList(); | ||
this.sources = sources; | ||
} | ||
|
||
@Deprecated | ||
public PureModelContext getPureModelContext() | ||
{ | ||
return pureModelContexts.get(0); | ||
} | ||
|
||
public List<PureModelContext> getPureModelContexts() | ||
{ | ||
return pureModelContexts; | ||
} | ||
|
||
public List<SQLSource> getSources() | ||
{ | ||
return sources; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.