From 611e3bcfb56ff233b3d4f55b7e763213ec744424 Mon Sep 17 00:00:00 2001 From: Sai Sriharsha Annepu <72639930+gs-ssh16@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:39:05 +0530 Subject: [PATCH] Use platform function to convert type in relational store accessor compilation (#3121) --- .../RelationalCompilerExtension.java | 52 +++---------------- .../TestRelationStoreAccessorFromGrammar.java | 32 ++++++++++++ 2 files changed, 40 insertions(+), 44 deletions(-) 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 d3e525bfac6..7cc4930c94e 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 @@ -83,6 +83,7 @@ import org.finos.legend.engine.shared.core.function.Function4; import org.finos.legend.engine.shared.core.function.Procedure3; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; +import org.finos.legend.pure.generated.platform_store_relational_functions; import org.finos.legend.pure.generated.Root_meta_core_runtime_Connection; import org.finos.legend.pure.generated.Root_meta_external_store_relational_runtime_RelationalDatabaseConnection; import org.finos.legend.pure.generated.Root_meta_external_store_relational_runtime_RelationalDatabaseConnection_Impl; @@ -136,14 +137,10 @@ import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAlias; import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasAccessor; import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.datatype.*; -import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.datatype.Double; -import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.datatype.Float; -import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.datatype.Integer; import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.NamedRelation; import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.Relation; import org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.Table; import org.finos.legend.pure.m3.navigation.ProcessorSupport; -import org.finos.legend.pure.m3.navigation._package._Package; import org.finos.legend.pure.m3.navigation.relation._Column; import org.finos.legend.pure.m3.navigation.relation._RelationType; import org.finos.legend.pure.m4.coreinstance.CoreInstance; @@ -801,7 +798,7 @@ public List{test::myDB.dataTable}#->filter(c|$c.pk == 1);" + + "}"); + } + @Test public void testCompilationWithSchema() {