From 874ecec954c7ca4fcd49f75d56ba49e66a34f010 Mon Sep 17 00:00:00 2001 From: Sai Sriharsha Annepu <72639930+gs-ssh16@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:00:38 +0530 Subject: [PATCH] Revert "Add query timeout to database connection (#3218)" (#3247) This reverts commit 01e452898a8bf6d64e8019473ad8d45e6fec52f3. --- .../stores/relational/RelationalExecutor.java | 2 +- .../manager/ConnectionManagerSelector.java | 1 - .../relational/result/SQLExecutionResult.java | 2 +- .../stores/relational/result/SQLResult.java | 7 +- .../relational/result/SQLUpdateResult.java | 5 +- .../connection/TestQueryTimeOut.java | 137 ------------------ ...elationalDatabaseConnectionLexerGrammar.g4 | 1 - ...lationalDatabaseConnectionParserGrammar.g4 | 8 +- ...erRelationalDatabaseConnectionBuilder.java | 6 +- .../RelationalCompilerExtension.java | 2 +- ...onalDatabaseConnectionParseTreeWalker.java | 3 - .../RelationalGrammarComposerExtension.java | 1 - ...ationalConnectionCompilationRoundtrip.java | 4 - ...TestRelationalConnectionGrammarParser.java | 14 -- ...tRelationalConnectionGrammarRoundtrip.java | 16 -- .../connection/DatabaseConnection.java | 1 - .../execution_relational_testConnection.pure | 1 - .../v1_33_0/models/metamodel_connection.pure | 1 - .../transfers/connection_relational.pure | 7 +- .../execution_relational_testConnection.pure | 1 - .../vX_X_X/models/metamodel_connection.pure | 1 - .../transfers/connection_relational.pure | 7 +- .../relationalMappingExecution.pure | 9 +- .../service/ServiceTestGenerationHelper.java | 1 - 24 files changed, 16 insertions(+), 222 deletions(-) delete mode 100644 legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/connection/TestQueryTimeOut.java diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/RelationalExecutor.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/RelationalExecutor.java index a53e2ba2555..478597f5a83 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/RelationalExecutor.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/RelationalExecutor.java @@ -264,7 +264,7 @@ public SQLUpdateResult execute(RelationalSaveNode node, Identity identity, Execu this.prepareForSQLExecution(node.sqlQuery, node.sqlComment, connectionManagerConnection, databaseTimeZone, databaseType, tempTableList, identity, executionState, false); - return new SQLUpdateResult(executionState.activities, databaseType, connectionManagerConnection, node.connection, identity, tempTableList, executionState.getRequestContext()); + return new SQLUpdateResult(executionState.activities, databaseType, connectionManagerConnection, identity, tempTableList, executionState.getRequestContext()); } private void prepareForSQLExecution(String sqlQuery, String sqlComment, Connection connection, String databaseTimeZone, String databaseTypeName, List tempTableList, Identity identity, ExecutionState executionState, boolean shouldLogSQL) diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/connection/manager/ConnectionManagerSelector.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/connection/manager/ConnectionManagerSelector.java index 2060423929b..5633354375e 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/connection/manager/ConnectionManagerSelector.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/connection/manager/ConnectionManagerSelector.java @@ -140,7 +140,6 @@ public static org.finos.legend.engine.protocol.pure.v1.model.packageableElement. db.type = DatabaseType.H2; db.element = originalConnection.element; db.timeZone = originalConnection instanceof DatabaseConnection ? ((DatabaseConnection) originalConnection).timeZone : null; - db.queryTimeOutInSeconds = originalConnection instanceof DatabaseConnection ? ((DatabaseConnection) originalConnection).queryTimeOutInSeconds : null; db.quoteIdentifiers = originalConnection instanceof DatabaseConnection ? ((DatabaseConnection) originalConnection).quoteIdentifiers : null; return db; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLExecutionResult.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLExecutionResult.java index 6f8496c91ba..8a1899fd164 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLExecutionResult.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLExecutionResult.java @@ -68,7 +68,7 @@ public SQLExecutionResult(List activities, SQLExecutionNode S public SQLExecutionResult(List activities, SQLExecutionNode SQLExecutionNode, String databaseType, String databaseTimeZone, Connection connection, Identity identity, List temporaryTables, Span topSpan, RequestContext requestContext, boolean logSQLWithParamValues) { - super("success", connection, SQLExecutionNode.connection, activities, databaseType, temporaryTables, requestContext); + super("success", connection, activities, databaseType, temporaryTables, requestContext); this.SQLExecutionNode = SQLExecutionNode; this.databaseTimeZone = databaseTimeZone; this.calendar = new GregorianCalendar(TimeZone.getTimeZone(databaseTimeZone)); diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLResult.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLResult.java index 4c39e743f4b..4b4ebf034d6 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLResult.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLResult.java @@ -22,7 +22,6 @@ import org.finos.legend.engine.plan.execution.stores.StoreExecutable; import org.finos.legend.engine.plan.execution.stores.relational.connection.driver.DatabaseManager; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.connection.DatabaseType; -import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.connection.DatabaseConnection; import org.finos.legend.engine.shared.core.api.request.RequestContext; import org.finos.legend.engine.shared.core.identity.Identity; import org.finos.legend.engine.shared.core.identity.factory.*; @@ -46,7 +45,7 @@ public abstract class SQLResult extends Result implements StoreExecutable private final RequestContext requestContext; - public SQLResult(String status, Connection connection, DatabaseConnection protocolConnection, List activities, String databaseType, List temporaryTables, RequestContext requestContext) + public SQLResult(String status, Connection connection, List activities, String databaseType, List temporaryTables, RequestContext requestContext) { super(status, activities); @@ -62,10 +61,6 @@ public SQLResult(String status, Connection connection, DatabaseConnection protoc { this.statement.setFetchSize(100); } - if (protocolConnection.queryTimeOutInSeconds != null) - { - this.statement.setQueryTimeout(protocolConnection.queryTimeOutInSeconds); - } } catch (Throwable e) { diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLUpdateResult.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLUpdateResult.java index 94a99dfef1c..1f29cd2295f 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLUpdateResult.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/result/SQLUpdateResult.java @@ -19,7 +19,6 @@ import org.finos.legend.engine.plan.execution.stores.relational.activity.RelationalExecutionActivity; import org.finos.legend.engine.shared.core.api.request.RequestContext; import org.finos.legend.engine.shared.core.identity.Identity; -import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.connection.DatabaseConnection; import org.finos.legend.engine.shared.core.operational.logs.LogInfo; import org.finos.legend.engine.shared.core.operational.logs.LoggingEventType; import org.slf4j.Logger; @@ -33,9 +32,9 @@ public class SQLUpdateResult extends SQLResult private final int updateCount; - public SQLUpdateResult(List activities, String databaseType, Connection connection, DatabaseConnection dbConnection, Identity identity, List temporaryTables, RequestContext requestContext) + public SQLUpdateResult(List activities, String databaseType, Connection connection, Identity identity, List temporaryTables, RequestContext requestContext) { - super("success", connection, dbConnection, activities, databaseType, temporaryTables, requestContext); + super("success", connection, activities, databaseType, temporaryTables, requestContext); try { long start = System.currentTimeMillis(); diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/connection/TestQueryTimeOut.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/connection/TestQueryTimeOut.java deleted file mode 100644 index f3e47479d77..00000000000 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/connection/TestQueryTimeOut.java +++ /dev/null @@ -1,137 +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.engine.plan.execution.stores.relational.connection; - -import org.eclipse.collections.api.factory.Maps; -import org.finos.legend.engine.protocol.pure.v1.model.executionPlan.SingleExecutionPlan; -import org.junit.Assert; -import org.junit.Test; - -import java.sql.SQLException; -import java.sql.Statement; -import java.time.LocalDate; -import java.time.LocalDateTime; - -public class TestQueryTimeOut extends AlloyTestServer -{ - - private static final String TEST_FUNCTION = "###Pure\n" + - "function test::fetch(): Any[1]\n" + - "{\n" + - " {names:String[*] | test::Person.all()\n" + - " ->project([x | $x.fullName, x | $x.firmName], ['fullName', 'firmName'])\n" + - " ->extend([col(row:TDSRow[1] | $row.getString('fullName'), 'string')])\n" + - " ->olapGroupBy(['fullName'], asc('firmName'), func(y | $y->meta::pure::functions::math::olap::rank()), 'RANK 1')\n" + - " ->olapGroupBy(['fullName'], desc('firmName'), func(y | $y->meta::pure::functions::math::olap::rowNumber()), 'ROW 1')\n" + - " ->olapGroupBy(['fullName'], asc('firmName'), func(y | $y->meta::pure::functions::math::olap::denseRank()), 'DENSE RANK 1')\n" + - " ->olapGroupBy(['fullName'], desc('firmName'), func(y | $y->meta::pure::functions::math::olap::rank()), 'RANK 2')\n" + - " ->olapGroupBy(['firmName'], asc('fullName'), func(y | $y->meta::pure::functions::math::olap::rank()), 'RANK 3')\n" + - " ->olapGroupBy(['firmName'], desc('fullName'), func(y | $y->meta::pure::functions::math::olap::rowNumber()), 'ROW 2')\n" + - " ->olapGroupBy(['firmName'], asc('fullName'), func(y | $y->meta::pure::functions::math::olap::denseRank()), 'DENSE RANK 2')\n" + - " ->olapGroupBy(['firmName'], desc('fullName'), func(y | $y->meta::pure::functions::math::olap::rank()), 'RANK 3')\n" + - " }\n" + - "}"; - - private static final String LOGICAL_MODEL = "###Pure\n" + - "Class test::Person\n" + - "{\n" + - " fullName: String[1];\n" + - " addressName: String[1];\n" + - " firmName: String[1];\n" + - "}\n\n\n"; - - private static final String STORE_MODEL = "###Relational\n" + - "Database test::DB\n" + - "(\n" + - " Table PERSON (\n" + - " fullName VARCHAR(100) PRIMARY KEY,\n" + - " firmName VARCHAR(100),\n" + - " addressName VARCHAR(100)\n" + - " )\n" + - ")\n\n\n"; - - private static final String MAPPING = "###Mapping\n" + - "Mapping test::Map\n" + - "(\n" + - " test::Person: Relational\n" + - " {\n" + - " ~primaryKey\n" + - " (\n" + - " [test::DB]PERSON.fullName\n" + - " )\n" + - " ~mainTable [test::DB]PERSON\n" + - " fullName: [test::DB]PERSON.fullName,\n" + - " firmName: [test::DB]PERSON.firmName,\n" + - " addressName: [test::DB]PERSON.addressName\n" + - " }\n" + - ")\n\n\n"; - - private static final String RUNTIME = "###Runtime\n" + - "Runtime test::Runtime\n" + - "{\n" + - " mappings:\n" + - " [\n" + - " test::Map\n" + - " ];\n" + - " connections:\n" + - " [\n" + - " test::DB:\n" + - " [\n" + - " c1: #{\n" + - " RelationalDatabaseConnection\n" + - " {\n" + - " type: H2;\n" + - " specification: LocalH2 {};\n" + - " auth: DefaultH2;\n" + - " queryTimeOutInSeconds: 1;\n" + - " }\n" + - " }#\n" + - " ]\n" + - " ];\n" + - "}\n"; - - public static final String TEST_EXECUTION_PLAN = LOGICAL_MODEL + STORE_MODEL + MAPPING + RUNTIME + TEST_FUNCTION; - - - @Override - protected void insertTestData(Statement statement) throws SQLException - { - statement.execute("Drop table if exists PERSON;"); - statement.execute("Create Table PERSON(fullName VARCHAR(100) NOT NULL,firmName VARCHAR(100) NULL,addressName VARCHAR(100) NULL,PRIMARY KEY(fullName));"); - - Integer personTableLength = 100000; - for (int i = 1; i <= personTableLength; i++) - { - statement.execute(String.format("insert into PERSON (fullName,firmName,addressName) values ('fullName%d','firmName%d','addressName%d');", personTableLength - i, i, personTableLength - i)); - } - } - - @Test - public void testQueryTimeOutInSeconds() - { - try - { - SingleExecutionPlan executionPlan = buildPlan(TEST_EXECUTION_PLAN); - Assert.assertNotNull(executionPlan); - Assert.assertNotNull(executePlan(executionPlan, Maps.mutable.empty())); - } - catch (Exception e) - { - Assert.assertEquals("org.h2.jdbc.JdbcSQLTimeoutException: Statement was canceled or the session timed out; SQL statement:", e.getMessage().substring(0, e.getMessage().indexOf('\n'))); - return; - } - Assert.fail("Cannot test QueryTimeOut as query runs for less than 1 second"); - } -} diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/connection/RelationalDatabaseConnectionLexerGrammar.g4 b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/connection/RelationalDatabaseConnectionLexerGrammar.g4 index ab414bc3941..1993d4d0357 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/connection/RelationalDatabaseConnectionLexerGrammar.g4 +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/connection/RelationalDatabaseConnectionLexerGrammar.g4 @@ -11,7 +11,6 @@ MODE: 'mode'; RELATIONAL_DATASOURCE_SPEC: 'specification'; RELATIONAL_AUTH_STRATEGY: 'auth'; RELATIONAL_POST_PROCESSORS: 'postProcessors'; -QUERY_TIMEOUT: 'queryTimeOutInSeconds'; DB_TIMEZONE: 'timezone'; TIMEZONE: TimeZone; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/connection/RelationalDatabaseConnectionParserGrammar.g4 b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/connection/RelationalDatabaseConnectionParserGrammar.g4 index 8f1a76287cf..7d9a4b1c8c4 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/connection/RelationalDatabaseConnectionParserGrammar.g4 +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/connection/RelationalDatabaseConnectionParserGrammar.g4 @@ -12,7 +12,7 @@ options identifier: VALID_STRING | STRING | STORE - | TYPE | QUERY_TIMEOUT | RELATIONAL_DATASOURCE_SPEC | RELATIONAL_AUTH_STRATEGY + | TYPE | RELATIONAL_DATASOURCE_SPEC | RELATIONAL_AUTH_STRATEGY | DB_TIMEZONE | QUOTE_IDENTIFIERS ; @@ -22,7 +22,6 @@ identifier: VALID_STRING | STRING definition: ( connectionStore | dbType - | queryTimeOutInSeconds | connectionMode | dbConnectionTimezone | dbQuoteIdentifiers @@ -40,8 +39,6 @@ dbQuoteIdentifiers: QUOTE_IDENTIFIERS COLON BOOLEAN SEMI_COL ; dbType: TYPE COLON identifier SEMI_COLON ; -queryTimeOutInSeconds: QUERY_TIMEOUT COLON INTEGER SEMI_COLON -; connectionMode: MODE COLON identifier SEMI_COLON ; @@ -70,5 +67,4 @@ specificationValueBody: BRACE_OPEN (specificationValue)* ; specificationValue: SPECIFICATION_BRACE_OPEN | SPECIFICATION_CONTENT | SPECIFICATION_BRACE_CLOSE -; - +; \ No newline at end of file diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperRelationalDatabaseConnectionBuilder.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperRelationalDatabaseConnectionBuilder.java index 346d5f55dbb..4b06754cf94 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperRelationalDatabaseConnectionBuilder.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperRelationalDatabaseConnectionBuilder.java @@ -42,14 +42,10 @@ public static void addTestDataSetUp(Root_meta_external_store_relational_runtime_ } } - public static void addDatabaseConnectionProperties(Root_meta_external_store_relational_runtime_DatabaseConnection pureConnection, String element, SourceInformation elementSourceInformation, String connectionType, String timeZone, Integer queryTimeOutInSeconds, Boolean quoteIdentifiers, CompileContext context) + public static void addDatabaseConnectionProperties(Root_meta_external_store_relational_runtime_DatabaseConnection pureConnection, String element, SourceInformation elementSourceInformation, String connectionType, String timeZone, Boolean quoteIdentifiers, CompileContext context) { Root_meta_external_store_relational_runtime_DatabaseConnection connection = pureConnection._type(context.pureModel.getEnumValue("meta::relational::runtime::DatabaseType", connectionType)); connection._timeZone(timeZone); - if (queryTimeOutInSeconds != null) - { - connection._queryTimeOutInSeconds(Long.valueOf(queryTimeOutInSeconds)); - } connection._quoteIdentifiers(quoteIdentifiers); if (element != null) { diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationalCompilerExtension.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationalCompilerExtension.java index 0e9fa59e97c..5738b689924 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationalCompilerExtension.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationalCompilerExtension.java @@ -451,7 +451,7 @@ public List extensions = IRelationalCompilerExtension.getExtensions(context); diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/RelationalDatabaseConnectionParseTreeWalker.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/RelationalDatabaseConnectionParseTreeWalker.java index 252ec56c4d5..848debb5114 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/RelationalDatabaseConnectionParseTreeWalker.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/RelationalDatabaseConnectionParseTreeWalker.java @@ -61,9 +61,6 @@ public void visitRelationalDatabaseConnectionValue(RelationalDatabaseConnectionP { throw new EngineException("Unknown database type '" + PureGrammarParserUtility.fromIdentifier(dbTypeCtx.identifier()) + "'", this.walkerSourceInformation.getSourceInformation(dbTypeCtx), EngineErrorType.PARSER); } - //queryTimeoutInSeconds (optional) - RelationalDatabaseConnectionParserGrammar.QueryTimeOutInSecondsContext queryTimeOutInSecondsCtx = PureGrammarParserUtility.validateAndExtractOptionalField(ctx.queryTimeOutInSeconds(), "queryTimeOutInSeconds", connectionValue.sourceInformation); - connectionValue.queryTimeOutInSeconds = queryTimeOutInSecondsCtx != null ? Integer.parseInt(queryTimeOutInSecondsCtx.INTEGER().getText()) : null; // timezone (optional) RelationalDatabaseConnectionParserGrammar.DbConnectionTimezoneContext timezoneCtx = PureGrammarParserUtility.validateAndExtractOptionalField(ctx.dbConnectionTimezone(), "timezone", connectionValue.sourceInformation); connectionValue.timeZone = timezoneCtx != null ? timezoneCtx.TIMEZONE().getText() : null; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/RelationalGrammarComposerExtension.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/RelationalGrammarComposerExtension.java index 408044f0f24..a07d5bd1ef1 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/RelationalGrammarComposerExtension.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/RelationalGrammarComposerExtension.java @@ -246,7 +246,6 @@ public List postProcessorWithParameter = Collections.emptyList(); } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/invocations/execution_relational_testConnection.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/invocations/execution_relational_testConnection.pure index e05f26a0877..baec4cb25e3 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/invocations/execution_relational_testConnection.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/invocations/execution_relational_testConnection.pure @@ -91,7 +91,6 @@ function meta::protocols::pure::v1_33_0::transformation::toPureGraph::connection ^meta::external::store::relational::runtime::RelationalDatabaseConnection( timeZone = $conn.timeZone, quoteIdentifiers = $conn.quoteIdentifiers, - queryTimeOutInSeconds = $conn.queryTimeOutInSeconds, type = $type, datasourceSpecification = $conn.datasourceSpecification->meta::protocols::pure::v1_33_0::transformation::toPureGraph::connection::transformDatasourceSpecification($extensions), authenticationStrategy = $conn.authenticationStrategy->meta::protocols::pure::v1_33_0::transformation::toPureGraph::connection::transformAuthenticationStrategy($extensions), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/models/metamodel_connection.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/models/metamodel_connection.pure index c755e30d0ab..bf6b043c3cb 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/models/metamodel_connection.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/models/metamodel_connection.pure @@ -96,7 +96,6 @@ Class meta::protocols::pure::v1_33_0::metamodel::store::relational::connection:: type : String[1]; timeZone : String[0..1]; quoteIdentifiers : Boolean[0..1]; - queryTimeOutInSeconds: Integer[0..1]; postProcessorWithParameter: meta::protocols::pure::v1_33_0::metamodel::store::relational::PostProcessorWithParameter[*]; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/transfers/connection_relational.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/transfers/connection_relational.pure index e141ae42b2e..a2117ead3eb 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/transfers/connection_relational.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/v1_33_0/transfers/connection_relational.pure @@ -43,7 +43,6 @@ function meta::protocols::pure::v1_33_0::transformation::fromPureGraph::connecti type = $type, timeZone = $test.timeZone, quoteIdentifiers = $test.quoteIdentifiers, - queryTimeOutInSeconds = $test.queryTimeOutInSeconds, element = $element, datasourceSpecification = ^meta::protocols::pure::v1_33_0::metamodel::store::relational::connection::alloy::specification::LocalH2DatasourceSpecification( _type = 'h2Local', @@ -57,13 +56,12 @@ function meta::protocols::pure::v1_33_0::transformation::fromPureGraph::connecti ), relational:meta::external::store::relational::runtime::RelationalDatabaseConnection[1] | let processors = transformPostProcessors($relational.postProcessors, $extensions); - relational($type, $element, $relational.timeZone, $relational.quoteIdentifiers, $relational.queryTimeOutInSeconds, $processors, $relational.datasourceSpecification, $relational.authenticationStrategy, $extensions);, + relational($type, $element, $relational.timeZone, $relational.quoteIdentifiers, $processors, $relational.datasourceSpecification, $relational.authenticationStrategy, $extensions);, dbCon:meta::external::store::relational::runtime::DatabaseConnection[1]| ^meta::protocols::pure::v1_33_0::metamodel::store::relational::connection::DatabaseConnection( _type = $_type, timeZone = $dbCon.timeZone, quoteIdentifiers = $dbCon.quoteIdentifiers, - queryTimeOutInSeconds = $dbCon.queryTimeOutInSeconds, element = $element, postProcessorWithParameter = $postProcessorsWithParams, type = $type) @@ -103,7 +101,7 @@ function meta::protocols::pure::v1_33_0::transformation::fromPureGraph::connecti ) } -function meta::protocols::pure::v1_33_0::transformation::fromPureGraph::connection::relational(type:String[1], element:String[1], timeZone:String[0..1], quoteIdentifiers:Boolean[0..1], queryTimeOutInSeconds: Integer[0..1], +function meta::protocols::pure::v1_33_0::transformation::fromPureGraph::connection::relational(type:String[1], element:String[1], timeZone:String[0..1], quoteIdentifiers:Boolean[0..1], processors:meta::protocols::pure::v1_33_0::metamodel::store::relational::postProcessor::PostProcessor[*], spec:meta::pure::alloy::connections::alloy::specification::DatasourceSpecification[1], auth:meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy[1], @@ -113,7 +111,6 @@ function meta::protocols::pure::v1_33_0::transformation::fromPureGraph::connecti _type = 'RelationalDatabaseConnection', timeZone = $timeZone, quoteIdentifiers = $quoteIdentifiers, - queryTimeOutInSeconds = $queryTimeOutInSeconds, element = $element, type = $type, datasourceSpecification = $spec->meta::protocols::pure::v1_33_0::transformation::fromPureGraph::connection::transformDatasourceSpecification($extensions), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/invocations/execution_relational_testConnection.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/invocations/execution_relational_testConnection.pure index 687654f14ae..009607d477c 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/invocations/execution_relational_testConnection.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/invocations/execution_relational_testConnection.pure @@ -91,7 +91,6 @@ function meta::protocols::pure::vX_X_X::transformation::toPureGraph::connection: connection=^meta::external::store::relational::runtime::RelationalDatabaseConnection( timeZone = $conn.timeZone, quoteIdentifiers = $conn.quoteIdentifiers, - queryTimeOutInSeconds = $conn.queryTimeOutInSeconds, type = $type, datasourceSpecification = $conn.datasourceSpecification->meta::protocols::pure::vX_X_X::transformation::toPureGraph::connection::transformDatasourceSpecification($extensions), authenticationStrategy = $conn.authenticationStrategy->meta::protocols::pure::vX_X_X::transformation::toPureGraph::connection::transformAuthenticationStrategy($extensions), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/models/metamodel_connection.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/models/metamodel_connection.pure index 3942512ef55..2cf66190f14 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/models/metamodel_connection.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/models/metamodel_connection.pure @@ -96,7 +96,6 @@ Class meta::protocols::pure::vX_X_X::metamodel::store::relational::connection::D type : String[1]; timeZone : String[0..1]; quoteIdentifiers : Boolean[0..1]; - queryTimeOutInSeconds: Integer[0..1]; postProcessorWithParameter: meta::protocols::pure::vX_X_X::metamodel::store::relational::PostProcessorWithParameter[*]; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/transfers/connection_relational.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/transfers/connection_relational.pure index 192ff5b3fdc..1b3282c848b 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/transfers/connection_relational.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/protocols/pure/vX_X_X/transfers/connection_relational.pure @@ -43,7 +43,6 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::connectio type = $type, timeZone = $test.timeZone, quoteIdentifiers = $test.quoteIdentifiers, - queryTimeOutInSeconds = $test.queryTimeOutInSeconds, element = $element, datasourceSpecification = ^meta::protocols::pure::vX_X_X::metamodel::store::relational::connection::alloy::specification::LocalH2DatasourceSpecification( _type = 'h2Local', @@ -57,13 +56,12 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::connectio ), relational:meta::external::store::relational::runtime::RelationalDatabaseConnection[1] | let processors = transformPostProcessors($relational.postProcessors, $extensions); - relational($type, $element, $relational.timeZone, $relational.quoteIdentifiers, $relational.queryTimeOutInSeconds, $processors, $relational.datasourceSpecification, $relational.authenticationStrategy, $extensions);, + relational($type, $element, $relational.timeZone, $relational.quoteIdentifiers, $processors, $relational.datasourceSpecification, $relational.authenticationStrategy, $extensions);, dbCon:meta::external::store::relational::runtime::DatabaseConnection[1]| ^meta::protocols::pure::vX_X_X::metamodel::store::relational::connection::DatabaseConnection( _type = $_type, timeZone = $dbCon.timeZone, quoteIdentifiers = $dbCon.quoteIdentifiers, - queryTimeOutInSeconds = $dbCon.queryTimeOutInSeconds, element = $element, postProcessorWithParameter = $postProcessorsWithParams, type = $type) @@ -103,7 +101,7 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::connectio ) } -function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::connection::relational(type:String[1], element:String[1], timeZone:String[0..1], quoteIdentifiers:Boolean[0..1], queryTimeOutInSeconds: Integer[0..1], +function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::connection::relational(type:String[1], element:String[1], timeZone:String[0..1], quoteIdentifiers:Boolean[0..1], processors:meta::protocols::pure::vX_X_X::metamodel::store::relational::postProcessor::PostProcessor[*], spec:meta::pure::alloy::connections::alloy::specification::DatasourceSpecification[1], auth:meta::pure::alloy::connections::alloy::authentication::AuthenticationStrategy[1], @@ -113,7 +111,6 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::connectio _type = 'RelationalDatabaseConnection', timeZone = $timeZone, quoteIdentifiers = $quoteIdentifiers, - queryTimeOutInSeconds = $queryTimeOutInSeconds, element = $element, type = $type, datasourceSpecification = $spec->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::connection::transformDatasourceSpecification($extensions), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/relationalMappingExecution.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/relationalMappingExecution.pure index 793c42e028a..6fbc568466d 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/relationalMappingExecution.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/relationalMappingExecution.pure @@ -367,12 +367,9 @@ function meta::relational::mapping::executeQuery(sql:String[1], query:SQLQuery[0 print(if(!$debug.debug, |'', | $debug.space+'>Execute SQL: '+$sql+'\n')); let queryTimeOutInSeconds = if($g_queryTimeOutInSeconds->isNotEmpty(), - | $g_queryTimeOutInSeconds->toOne(), - | if($connection.queryTimeOutInSeconds->isNotEmpty(), - | $connection.queryTimeOutInSeconds->toOne(), - | 3600 - ); - ); + | $g_queryTimeOutInSeconds->toOne(), + | 3600 //1 hour + ); let sqlComment = sqlCommentPureExecution(); let res = executeInDb($sqlComment + '\n' + $sql, $connection->cast(@DatabaseConnection), $queryTimeOutInSeconds, 1000); //let res = ^ResultSet(connectionAcquisitionTimeInNanoSecond=1,executionTimeInNanoSecond=2); diff --git a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ServiceTestGenerationHelper.java b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ServiceTestGenerationHelper.java index e54051edfef..81bbab9b22c 100644 --- a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ServiceTestGenerationHelper.java +++ b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ServiceTestGenerationHelper.java @@ -449,7 +449,6 @@ private static Connection newRelationalConnection(Connection connection, String if (connection instanceof DatabaseConnection) { relationalDatabaseConnection.timeZone = ((DatabaseConnection) connection).timeZone; - relationalDatabaseConnection.queryTimeOutInSeconds = ((DatabaseConnection) connection).queryTimeOutInSeconds; } LocalH2DatasourceSpecification localH2DatasourceSpecification = new LocalH2DatasourceSpecification();