Skip to content

Commit

Permalink
Memsql function (#2833)
Browse files Browse the repository at this point in the history
* changes realted to memsql tvf

* rebased with master

* rebased with master

* changes related to memsql TVF function activator

* minor changes related to singleStore TVF

* minor changes related to singleStore TVF

* code refactoring

* added Server Extenal.xml

* changes in memsql function generation.pure

* cosmetic changes

* removed duplicate extension class

* changes related to review comments

* rebase from upstream master

* revert back to mysql driver

* fixed test cases

* fixed test cases

* fixed test cases

* added a sample model request

* set USAGE_CONTEXT_PARAM for memsqlFunction

* set USAGE_CONTEXT_PARAM for memsqlFunction
  • Loading branch information
satendra-sahu committed May 8, 2024
1 parent bed83e1 commit 973745d
Show file tree
Hide file tree
Showing 3 changed files with 819 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-executionPlan-generation</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-executionPlan-execution-authorizer</artifactId>
</dependency>

<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@

package org.finos.legend.engine.language.memsql.deployment;

import org.eclipse.collections.api.factory.Maps;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.impl.factory.Lists;
import org.finos.legend.engine.functionActivator.deployment.DeploymentManager;
import org.finos.legend.engine.plan.execution.PlanExecutor;
import org.finos.legend.engine.plan.execution.authorization.PlanExecutionAuthorizerInput;
import org.finos.legend.engine.plan.execution.stores.StoreExecutionState;
import org.finos.legend.engine.plan.execution.stores.relational.connection.manager.ConnectionManagerSelector;
import org.finos.legend.engine.plan.execution.stores.relational.plugin.RelationalStoreExecutor;
import org.finos.legend.engine.plan.execution.stores.relational.plugin.RelationalStoreState;
Expand Down Expand Up @@ -111,7 +114,12 @@ private RelationalDatabaseConnection extractConnectionFromArtifact(MemSqlFunctio
public Connection getDeploymentConnection(Identity identity, MemSqlFunctionArtifact artifact)
{
RelationalDatabaseConnection connection = extractConnectionFromArtifact(artifact);
return this.connectionManager.getDatabaseConnection(identity, connection);
StoreExecutionState.RuntimeContext runtimeContext = StoreExecutionState.newRuntimeContext(Maps.immutable.of(
PlanExecutionAuthorizerInput.USAGE_CONTEXT_PARAM, "SERVICE_EXECUTION",
PlanExecutionAuthorizerInput.RESOURCE_CONTEXT_PARAM, "reserved-for-future-use"
));
return this.connectionManager.getDatabaseConnection(identity, connection, runtimeContext);
//return this.connectionManager.getDatabaseConnection(identity, connection);
}

public Connection getDeploymentConnection(Identity identity, RelationalDatabaseConnection connection)
Expand Down
Loading

0 comments on commit 973745d

Please sign in to comment.