From 83d2dcca20562ee48a3f4792fb390439e523dbe0 Mon Sep 17 00:00:00 2001 From: Pierre De Belen Date: Wed, 28 Aug 2024 11:06:22 -0400 Subject: [PATCH] Use the Alloy compiler in the relational PCT Tests (#3044) --- .../legend/engine/repl/TestCompleter.java | 6 + .../toPureGraph/HelperMappingBuilder.java | 2 +- .../PackageableElementFirstPassBuilder.java | 4 +- .../pure/compiler/toPureGraph/PureModel.java | 29 ++- .../ValueSpecificationBuilder.java | 83 +++--- .../ValueSpecificationBuilderForFuncExpr.java | 4 +- .../toPureGraph/handlers/FunctionHandler.java | 8 + .../toPureGraph/handlers/Handlers.java | 94 ++++--- .../builder/FunctionExpressionBuilder.java | 25 +- .../test/TestCompilationFromGrammar.java | 20 ++ .../TestDomainCompilationFromGrammar.java | 26 +- .../from/antlr4/core/M3ParserGrammar.g4 | 11 +- .../from/domain/DateParseTreeWalker.java | 11 +- .../from/domain/DomainParseTreeWalker.java | 29 +-- .../test/parser/TestDomainGrammarParser.java | 1 - .../test/roundtrip/TestLambdaRoundtrip.java | 13 + .../pure/corefunctions/metaExtension.pure | 18 ++ .../core/pure/router/preeval/preeval.pure | 7 +- .../pure/router/routing/router_routing.pure | 110 ++++++-- .../core/pure/router/store/routing.pure | 1 - .../pure/serialization/toPureGrammar.pure | 242 +++++++++++------- .../core/pure/treepath/treePath.pure | 6 +- .../relation/functions/order/ascending.pure | 22 ++ .../relation/functions/order/descending.pure | 22 ++ .../relation/functions/order/sort.pure | 10 - .../relation/functions/slice/lag.pure | 6 +- .../relation/functions/slice/lead.pure | 6 +- .../functions/transformation/extend.pure | 37 --- .../pom.xml | 19 ++ .../legend/engine/ide/PureIDEServer.java | 15 ++ .../engine/ide/api/execution/go/GoRun.java | 1 + .../LegendCompileMixedProcessorSupport.java | 35 ++- .../DataSpaceCompilerExtension.java | 2 +- .../Test_JAVA_EssentialFunction_PCT.java | 16 +- .../Test_JAVA_GrammarFunction_PCT.java | 10 +- .../Test_JAVA_RelationFunction_PCT.java | 1 - .../pom.xml | 5 + ...e_external_test_connection.definition.json | 1 + .../pct_relational.pure | 237 +++++++++++++---- .../pom.xml | 10 + ...ational_DuckDB_EssentialFunctions_PCT.java | 129 +++++----- ...elational_DuckDB_GrammarFunctions_PCT.java | 35 ++- .../sqlQueryToString/duckdbExtension.pure | 8 +- ..._Relational_H2_EssentialFunctions_PCT.java | 137 +++++----- ...st_Relational_H2_GrammarFunctions_PCT.java | 41 ++- ...t_Relational_H2_RelationFunctions_PCT.java | 2 +- ...t_Relational_H2_StandardFunctions_PCT.java | 18 +- ...ional_Postgres_EssentialFunctions_PCT.java | 128 ++++----- ...ational_Postgres_GrammarFunctions_PCT.java | 31 +-- ...tional_Postgres_RelationFunctions_PCT.java | 2 +- ...tional_Postgres_StandardFunctions_PCT.java | 18 +- ...onal_Snowflake_EssentialFunctions_PCT.java | 124 +++++---- ...tional_Snowflake_GrammarFunctions_PCT.java | 33 ++- ...ional_Snowflake_RelationFunctions_PCT.java | 13 +- ...ional_Snowflake_StandardFunctions_PCT.java | 20 +- .../toPureGraph/HelperRelationalBuilder.java | 29 ++- .../RelationalCompilerExtension.java | 3 +- .../pureToSQLQuery/pureToSQLQuery.pure | 46 +++- .../sqlQueryToString/dbExtension.pure | 1 + .../sqlQueryToString/extensionDefaults.pure | 7 +- .../ServiceCompilerExtensionImpl.java | 4 +- pom.xml | 4 +- 62 files changed, 1295 insertions(+), 743 deletions(-) create mode 100644 legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/ascending.pure create mode 100644 legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/descending.pure diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-relational/src/test/java/org/finos/legend/engine/repl/TestCompleter.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-relational/src/test/java/org/finos/legend/engine/repl/TestCompleter.java index 30d48d155db..9322b8b5cae 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-relational/src/test/java/org/finos/legend/engine/repl/TestCompleter.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-relational/src/test/java/org/finos/legend/engine/repl/TestCompleter.java @@ -141,6 +141,12 @@ public void testExtendWithOver() Assert.assertEquals("[count , count(], [joinStrings , joinStrings(]", checkResultNoException(new Completer("###Relational\nDatabase a::A(Table t(col VARCHAR(200), val INT))", Lists.mutable.with(new RelationalCompleterExtension())).complete("#>{a::A.t}#->extend(over(~col->ascending()), ~nc:{p,f,r|$r.col}:y|$y->"))); } + @Test + public void testExtendWithOverError() + { + Assert.assertEquals("COMPILATION error at [6:55-56]: Can't find variable class for variable 'p' in the graph", new Completer("###Relational\nDatabase a::A(Table t(col VARCHAR(200), val INT))", Lists.mutable.with(new RelationalCompleterExtension())).complete("#>{a::A.t}#->extend(over(~Name->descending()), {p,f,r|$p->lead($r).").getEngineException().toPretty()); + } + //--------- // GroupBy //--------- diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java index f56c5aef8dd..f2d5e4ebc1d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java @@ -165,7 +165,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Enumeratio ._name(id) ._parent(pureMapping) ._enumeration(context.resolveEnumeration(em.enumeration.path, em.enumeration.sourceInformation)) - ._enumValueMappings(ListIterate.collect(em.enumValueMappings, v -> new Root_meta_pure_mapping_EnumValueMapping_Impl(null, SourceInformationHelper.toM3SourceInformation(v.sourceInformation), null) + ._enumValueMappings(ListIterate.collect(em.enumValueMappings, v -> new Root_meta_pure_mapping_EnumValueMapping_Impl(null, SourceInformationHelper.toM3SourceInformation(v.sourceInformation), context.pureModel.getClass("meta::pure::mapping::EnumValueMapping")) ._enum(context.resolveEnumValue(em.enumeration.path, v.enumValue)) ._sourceValues(convertSourceValues(em, v.sourceValues, context)) )); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PackageableElementFirstPassBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PackageableElementFirstPassBuilder.java index 55690f7c5f7..8582dc76a4f 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PackageableElementFirstPassBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PackageableElementFirstPassBuilder.java @@ -59,7 +59,6 @@ import org.finos.legend.pure.generated.Root_meta_pure_runtime_PackageableRuntime_Impl; import org.finos.legend.pure.generated.Root_meta_core_runtime_Runtime; import org.finos.legend.pure.generated.Root_meta_core_runtime_Runtime_Impl; -import org.finos.legend.pure.m3.coreinstance.Package; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.Stereotype; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.Tag; @@ -70,7 +69,6 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; import java.util.List; -import java.util.Objects; public class PackageableElementFirstPassBuilder implements PackageableElementVisitor { @@ -212,7 +210,7 @@ public PackageableElement visit(Function function) @Override public PackageableElement visit(Mapping mapping) { - org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping pureMapping = new Root_meta_pure_mapping_Mapping_Impl(mapping.name, SourceInformationHelper.toM3SourceInformation(mapping.sourceInformation), null); + org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping pureMapping = new Root_meta_pure_mapping_Mapping_Impl(mapping.name, SourceInformationHelper.toM3SourceInformation(mapping.sourceInformation), this.context.pureModel.getClass("meta::pure::mapping::Mapping")); this.context.pureModel.mappingsIndex.put(this.context.pureModel.buildPackageString(mapping._package, mapping.name), pureMapping); GenericType mappingGenericType = newGenericType(this.context.pureModel.getType("meta::pure::mapping::Mapping")); pureMapping._classifierGenericType(mappingGenericType); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java index 4c1fd1358d9..a219befdedc 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java @@ -79,6 +79,8 @@ import org.finos.legend.pure.generated.Root_meta_pure_runtime_PackageableRuntime; import org.finos.legend.pure.m3.coreinstance.Package; import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping; +import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.ConcreteFunctionDefinition; +import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.NativeFunction; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.PackageableMultiplicity; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enumeration; @@ -665,6 +667,11 @@ public org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElem { return packageableElement; } + packageableElement = getGraphFunctions(fullPath); + if (packageableElement != null) + { + return packageableElement; + } packageableElement = getAssociation_safe(fullPath); if (packageableElement != null) { @@ -927,6 +934,26 @@ public org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.As return association; } + public org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.PackageableFunction getGraphFunctions(String fullPath) + { + try + { + return (ConcreteFunctionDefinition) this.executionSupport.getMetadata("meta::pure::metamodel::function::ConcreteFunctionDefinition", "Root::" + fullPath); + } + catch (Exception e) + { + try + { + return (NativeFunction) this.executionSupport.getMetadata("meta::pure::metamodel::function::NativeFunction", "Root::" + fullPath); + } + catch (Exception ee) + { + // do nothing + } + } + return null; + } + public org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Association getAssociation_safe(String fullPath) { String fullPathWithPrefix = addPrefixToTypeReference(fullPath); @@ -1268,7 +1295,7 @@ public Multiplicity getMultiplicity(org.finos.legend.engine.protocol.pure.v1.mod public static GenericType buildFunctionType(MutableList parameters, GenericType returnType, Multiplicity returnMultiplicity, PureModel pureModel) { - return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(new Root_meta_pure_metamodel_type_FunctionType_Impl("", null, pureModel.getClass("meta::pure::metamodel::type::FunctionType"))._parameters(parameters)._returnType(returnType)._returnMultiplicity(returnMultiplicity)); + return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass(M3Paths.GenericType))._rawType(new Root_meta_pure_metamodel_type_FunctionType_Impl("", null, pureModel.getClass(M3Paths.FunctionType))._parameters(parameters)._returnType(returnType)._returnMultiplicity(returnMultiplicity)); } public String buildPackageString(String pack, String name) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java index 9ad1f625938..aba986e7ecf 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java @@ -99,11 +99,10 @@ public ValueSpecification visit(org.finos.legend.engine.protocol.pure.v1.model.v public ValueSpecification visit(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr packageableElementPtr) { org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement packageableElement = this.context.resolvePackageableElement(packageableElementPtr.fullPath, packageableElementPtr.sourceInformation); - return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", SourceInformationHelper.toM3SourceInformation(packageableElementPtr.sourceInformation), context.pureModel.getClass("meta::pure::metamodel::valuespecification::InstanceValue")) ._genericType(packageableElement._classifierGenericType()) ._multiplicity(this.context.pureModel.getMultiplicity("one")) - ._values(this.processingContext.peek().equals("Applying new") ? FastList.newList() : FastList.newListWith(packageableElement)); + ._values(FastList.newListWith(packageableElement)); } @Override @@ -130,7 +129,7 @@ public ValueSpecification visit(CDateTime cDateTime) return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", SourceInformationHelper.toM3SourceInformation(cDateTime.sourceInformation), context.pureModel.getClass("meta::pure::metamodel::valuespecification::InstanceValue")) ._genericType(this.context.pureModel.getGenericType("DateTime")) ._multiplicity(this.context.pureModel.getMultiplicity(cDateTime.multiplicity)) - ._values(Lists.immutable.of(DateFormat.parseDateTime(cDateTime.value))); + ._values(Lists.immutable.of(DateFormat.parsePureDate(cDateTime.value))); } @Override @@ -294,40 +293,49 @@ private ValueSpecification proccessColSpecArray(ColSpecArray value) "meta::pure::metamodel::relation::AggColSpecArray" : "meta::pure::metamodel::relation::FuncColSpecArray"; - GenericType colSpecGT = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getClass(className)) - ._typeArguments( - Lists.mutable.with( - new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType( - _RelationType.build( - cols.collect(c -> - { - Column theCol = ((RelationType) c._genericType()._typeArguments().getLast()._rawType())._columns().getFirst(); - return _Column.getColumnInstance(theCol._name(), false, _Column.getColumnType(theCol), _Column.getColumnMultiplicity(theCol), null, processorSupport); - }), - null, - processorSupport - ) - ) + GenericType inferredType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) + ._rawType( + _RelationType.build( + cols.collect(c -> + { + Column theCol = ((RelationType) c._genericType()._typeArguments().getLast()._rawType())._columns().getFirst(); + return _Column.getColumnInstance(theCol._name(), false, _Column.getColumnType(theCol), _Column.getColumnMultiplicity(theCol), null, processorSupport); + }), + null, + processorSupport ) ); Object valueToInsert = null; + GenericType colSpecGT = null; if (resO instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation.ColSpec) { + colSpecGT = buildColArrayGenType(className, Lists.mutable.with(inferredType)); valueToInsert = new Root_meta_pure_metamodel_relation_ColSpecArray_Impl<>("") ._classifierGenericType(colSpecGT) ._names(processedValues.collect(c -> ((org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation.ColSpec) c)._name())); } else if (resO instanceof FuncColSpec) { + colSpecGT = buildColArrayGenType(className, + Lists.mutable.with( + MostCommonType.mostCommon(processedValues.collect(x -> ((FuncColSpec) x)._function()._classifierGenericType()).toList(), context.pureModel)._typeArguments().getFirst(), + inferredType + ) + ); valueToInsert = new Root_meta_pure_metamodel_relation_FuncColSpecArray_Impl<>("") ._classifierGenericType(colSpecGT) ._funcSpecs(processedValues.collect(x -> (FuncColSpec) x)); } else if (resO instanceof AggColSpec) { + colSpecGT = buildColArrayGenType(className, + Lists.mutable.with( + MostCommonType.mostCommon(processedValues.collect(x -> ((AggColSpec) x)._map()._classifierGenericType()).toList(), context.pureModel)._typeArguments().getFirst(), + MostCommonType.mostCommon(processedValues.collect(x -> ((AggColSpec) x)._reduce()._classifierGenericType()).toList(), context.pureModel)._typeArguments().getFirst(), + inferredType + ) + ); valueToInsert = new Root_meta_pure_metamodel_relation_AggColSpecArray_Impl<>("") ._classifierGenericType(colSpecGT) ._aggSpecs(processedValues.collect(x -> (AggColSpec) x)); @@ -337,7 +345,7 @@ else if (resO instanceof AggColSpec) throw new RuntimeException("Not Possible: " + resO.getClass()); } - return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("") + return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::InstanceValue")) ._multiplicity(context.pureModel.getMultiplicity("one")) ._genericType(colSpecGT) ._values(Lists.mutable.with( @@ -346,6 +354,13 @@ else if (resO instanceof AggColSpec) ); } + private GenericType buildColArrayGenType(String className, MutableList args) + { + return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) + ._rawType(context.pureModel.getClass(className)) + ._typeArguments(args); + } + private ValueSpecification proccessColSpec(ColSpec colSpec) { ProcessorSupport processorSupport = context.pureModel.getExecutionSupport().getProcessorSupport(); @@ -356,13 +371,16 @@ private ValueSpecification proccessColSpec(ColSpec colSpec) else if (colSpec.function2 == null) { InstanceValue funcVS = (InstanceValue) colSpec.function1.accept(new ValueSpecificationBuilder(context, openVariables, processingContext)); - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.Function func = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.Function) funcVS._values().getFirst(); + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.FunctionDefinition func = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.FunctionDefinition) funcVS._values().getFirst(); + + FunctionType func1Type = (FunctionType) org.finos.legend.pure.m3.navigation.function.Function.computeFunctionType(func, context.pureModel.getExecutionSupport().getProcessorSupport()); - GenericType colSpecGT = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) + GenericType colSpecGT = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass(M3Paths.GenericType)) ._rawType(context.pureModel.getClass("meta::pure::metamodel::relation::FuncColSpec")) ._typeArguments( - Lists.mutable.with(func._classifierGenericType()._typeArguments().getFirst(), - new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) + Lists.mutable.with( + new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass(M3Paths.GenericType))._rawType(func1Type), + new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass(M3Paths.GenericType)) ._rawType( _RelationType.build( Lists.mutable.with(_Column.getColumnInstance(colSpec.name, false, funcReturnType(funcVS, context.pureModel), funcReturnMul(funcVS, context.pureModel), null, processorSupport)), @@ -373,11 +391,11 @@ else if (colSpec.function2 == null) ) ); - return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("") + return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::InstanceValue")) ._multiplicity(context.pureModel.getMultiplicity("one")) ._genericType(colSpecGT) ._values(Lists.mutable.with( - new Root_meta_pure_metamodel_relation_FuncColSpec_Impl<>("") + new Root_meta_pure_metamodel_relation_FuncColSpec_Impl<>("", null, context.pureModel.getClass("meta::pure::metamodel::relation::FuncColSpec")) ._classifierGenericType(colSpecGT) ._name(colSpec.name) ._function(func) @@ -387,10 +405,10 @@ else if (colSpec.function2 == null) else { InstanceValue funcVS = (InstanceValue) colSpec.function1.accept(new ValueSpecificationBuilder(context, openVariables, processingContext)); - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.Function func1 = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.Function) funcVS._values().getFirst(); + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.FunctionDefinition func1 = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.FunctionDefinition) funcVS._values().getFirst(); InstanceValue func2VS = (InstanceValue) colSpec.function2.accept(new ValueSpecificationBuilder(context, openVariables, processingContext)); - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.Function func2 = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.Function) func2VS._values().getFirst(); + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.FunctionDefinition func2 = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.FunctionDefinition) func2VS._values().getFirst(); FunctionType func1Type = (FunctionType) org.finos.legend.pure.m3.navigation.function.Function.computeFunctionType(func1, context.pureModel.getExecutionSupport().getProcessorSupport()); FunctionType func2Type = (FunctionType) org.finos.legend.pure.m3.navigation.function.Function.computeFunctionType(func2, context.pureModel.getExecutionSupport().getProcessorSupport()); @@ -399,9 +417,8 @@ else if (colSpec.function2 == null) ._rawType(context.pureModel.getClass("meta::pure::metamodel::relation::AggColSpec")) ._typeArguments( Lists.mutable.with( - func1Type._parameters().getFirst()._genericType(), - func1Type._returnType(), - func2Type._returnType(), + new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(func1Type), + new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(func2Type), new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) ._rawType( _RelationType.build( @@ -413,11 +430,11 @@ else if (colSpec.function2 == null) ) ); - return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("") + return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::InstanceValue")) ._multiplicity(context.pureModel.getMultiplicity("one")) ._genericType(aggColSpecGT) ._values(Lists.mutable.with( - new Root_meta_pure_metamodel_relation_AggColSpec_Impl<>("") + new Root_meta_pure_metamodel_relation_AggColSpec_Impl<>("", null, context.pureModel.getClass("meta::pure::metamodel::relation::AggColSpec")) ._classifierGenericType(aggColSpecGT) ._name(colSpec.name) ._map(func1) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java index 3111ad5a5d8..4af1a388fab 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java @@ -51,7 +51,7 @@ public ValueSpecification visit(org.finos.legend.engine.protocol.pure.v1.model.v return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", SourceInformationHelper.toM3SourceInformation(packageableElementPtr.sourceInformation), context.pureModel.getClass("meta::pure::metamodel::valuespecification::InstanceValue")) ._genericType(runtimeGenericType) ._multiplicity(this.context.pureModel.getMultiplicity("one")) - ._values(this.processingContext.peek().equals("Applying new") ? FastList.newList() : FastList.newListWith(resolvedRuntime)); + ._values(FastList.newListWith(resolvedRuntime)); } ImmutableList values = this.context.getCompilerExtensions().getExtraValueSpecificationBuilderForFuncExpr().collect(x -> x.value(packageableElement, context, processingContext)).select(Objects::nonNull); @@ -60,7 +60,7 @@ public ValueSpecification visit(org.finos.legend.engine.protocol.pure.v1.model.v return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", SourceInformationHelper.toM3SourceInformation(packageableElementPtr.sourceInformation), context.pureModel.getClass("meta::pure::metamodel::valuespecification::InstanceValue")) ._genericType(packageableElement._classifierGenericType()) ._multiplicity(this.context.pureModel.getMultiplicity("one")) - ._values(this.processingContext.peek().equals("Applying new") ? FastList.newList() : FastList.newListWith(packageableElement)); + ._values(FastList.newListWith(packageableElement)); } else { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/FunctionHandler.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/FunctionHandler.java index fa5a4ea058b..8dc973fd2e4 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/FunctionHandler.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/FunctionHandler.java @@ -31,12 +31,14 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; +import org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement; import org.finos.legend.pure.m3.navigation.type.Type; import java.util.List; public class FunctionHandler { + private final String _package; private final String fullName; private final org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.Function func; private final String functionSignature; @@ -65,6 +67,7 @@ public class FunctionHandler public FunctionHandler(PureModel pureModel, String name, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.Function func, ReturnInference returnInference, ResolveTypeParameterInference resolvedTypeParametersInference, Dispatch dispatch) { this.pureModel = pureModel; + this._package = PackageableElement.getUserPathForPackageableElement(((org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement) func)._package()); this.func = func; this.functionSignature = func._name(); this.fullName = name; @@ -116,6 +119,11 @@ public Dispatch getDispatch() return dispatch; } + public String getPackage() + { + return this._package; + } + public String getFunctionSignature() { return functionSignature; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java index cb0972c7766..b60c83458d9 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java @@ -225,7 +225,7 @@ private static void aggInferenceAll(List processedParameters; if (parameters.size() == 3) { - if (parameters.get(1) instanceof AppliedFunction && ((AppliedFunction) parameters.get(1)).function.equals("over")) + if (parameters.get(1) instanceof AppliedFunction)// && ((AppliedFunction) parameters.get(1)).function.endsWith("over")) { AppliedFunction func = (AppliedFunction) parameters.get(1); func.parameters.forEach(x -> @@ -367,6 +367,20 @@ public static TypeAndMultiplicity ExtendReturnInference(List } + public static TypeAndMultiplicity OverReturnInference(List ps, PureModel pureModel) + { + + return res( + new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass(M3Paths.GenericType)) + ._rawType(pureModel.getType("meta::pure::functions::relation::_Window")) + // Should eventually write the right type... + ._typeArguments(Lists.mutable.with(pureModel.getGenericType(pureModel.getType("meta::pure::metamodel::type::Any")))), + "one", + pureModel + ); + } + + public static final ParametersInference LambdaCollectionInference = (parameters, ov, cc, pc) -> { ValueSpecification firstProcessedParameter = parameters.get(0).accept(new ValueSpecificationBuilder(cc, ov, pc)); @@ -390,6 +404,15 @@ public static TypeAndMultiplicity ExtendReturnInference(List return Stream.concat(Stream.of(firstProcessedParameter, secondProcessedParameter), parameters.stream().skip(2).map(p -> p.accept(new ValueSpecificationBuilder(cc, ov, pc)))).collect(Collectors.toList()); }; + public static final ParametersInference EvalInference2 = (parameters, ov, cc, pc) -> + { + ValueSpecification secondProcessedParameter = parameters.get(1).accept(new ValueSpecificationBuilder(cc, ov, pc)); + ValueSpecification thirdProcessedParameter = parameters.get(2).accept(new ValueSpecificationBuilder(cc, ov, pc)); + updateTwoParamsLambdaDiffTypes(parameters.get(0), secondProcessedParameter._genericType(), thirdProcessedParameter._genericType(), new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity(1, 1), new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity(1, 1)); + ValueSpecification firstProcessedParameter = parameters.get(0).accept(new ValueSpecificationBuilder(cc, ov, pc)); + return Stream.concat(Stream.of(firstProcessedParameter, secondProcessedParameter, thirdProcessedParameter), parameters.stream().skip(3).map(p -> p.accept(new ValueSpecificationBuilder(cc, ov, pc)))).collect(Collectors.toList()); + }; + public static final ParametersInference RenameColInference = (parameters, ov, cc, pc) -> { ProcessorSupport ps = cc.pureModel.getExecutionSupport().getProcessorSupport(); @@ -436,7 +459,7 @@ public static InstanceValue wrapInstanceValue(Any val, PureModel pureModel) public static InstanceValue wrapInstanceValue(MutableList values, GenericType genericType, String multiplicity, PureModel pureModel) { - return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("") + return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", null, pureModel.getClass(M3Paths.InstanceValue)) ._multiplicity(pureModel.getMultiplicity(multiplicity)) ._genericType(genericType) ._values(values); @@ -444,7 +467,7 @@ public static InstanceValue wrapInstanceValue(MutableList values, public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation.ColSpec buildColSpec(String name, GenericType colType, Multiplicity multiplicity, PureModel pureModel, ProcessorSupport ps) { - GenericType firstGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) + GenericType firstGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass(M3Paths.GenericType)) ._rawType( _RelationType.build( Lists.mutable.with(_Column.getColumnInstance(name, false, colType, multiplicity, null, ps)), @@ -453,7 +476,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation ) ); - return new Root_meta_pure_metamodel_relation_ColSpec_Impl<>("") + return new Root_meta_pure_metamodel_relation_ColSpec_Impl<>("", null, pureModel.getClass("meta::pure::metamodel::relation::ColSpec")) ._name(name) ._classifierGenericType( new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass(M3Paths.GenericType)) @@ -862,15 +885,15 @@ public Handlers(PureModel pureModel) register(m( m( - h("meta::pure::functions::relation::over_ColSpec_1___Window_1_", false, ps -> res("meta::pure::functions::relation::_Window", "one"), ps -> true), - h("meta::pure::functions::relation::over_Frame_1___Window_1_", false, ps -> res("meta::pure::functions::relation::_Window", "one"), ps -> true), - h("meta::pure::functions::relation::over_ColSpecArray_1___Window_1_", false, ps -> res("meta::pure::functions::relation::_Window", "one"), ps -> true), - h("meta::pure::functions::relation::over_SortInfo_MANY___Window_1_", false, ps -> res("meta::pure::functions::relation::_Window", "one"), ps -> true)), + h("meta::pure::functions::relation::over_ColSpec_1___Window_1_", false, ps -> OverReturnInference(ps, this.pureModel), ps -> Lists.fixedSize.of(ps.get(0)._genericType()), ps -> true), + h("meta::pure::functions::relation::over_Frame_1___Window_1_", false, ps -> OverReturnInference(ps, this.pureModel), ps -> Lists.fixedSize.of(ps.get(0)._genericType()), ps -> true), + h("meta::pure::functions::relation::over_ColSpecArray_1___Window_1_", false, ps -> OverReturnInference(ps, this.pureModel), ps -> Lists.fixedSize.of(ps.get(0)._genericType()), ps -> true), + h("meta::pure::functions::relation::over_SortInfo_MANY___Window_1_", false, ps -> OverReturnInference(ps, this.pureModel), ps -> Lists.fixedSize.of(ps.get(0)._genericType()), ps -> true)), m( - h("meta::pure::functions::relation::over_ColSpecArray_1__SortInfo_MANY___Window_1_", false, ps -> res("meta::pure::functions::relation::_Window", "one"), ps -> true), - h("meta::pure::functions::relation::over_ColSpec_1__Frame_1___Window_1_", false, ps -> res("meta::pure::functions::relation::_Window", "one"), ps -> true), - h("meta::pure::functions::relation::over_ColSpec_1__SortInfo_MANY___Window_1_", false, ps -> res("meta::pure::functions::relation::_Window", "one"), ps -> true), - h("meta::pure::functions::relation::over_SortInfo_MANY__Frame_1___Window_1_", false, ps -> res("meta::pure::functions::relation::_Window", "one"), ps -> true) + h("meta::pure::functions::relation::over_ColSpecArray_1__SortInfo_MANY___Window_1_", false, ps -> OverReturnInference(ps, this.pureModel), ps -> Lists.fixedSize.of(ps.get(0)._genericType()), ps -> true), + h("meta::pure::functions::relation::over_ColSpec_1__Frame_1___Window_1_", false, ps -> OverReturnInference(ps, this.pureModel), ps -> Lists.fixedSize.of(ps.get(0)._genericType()), ps -> true), + h("meta::pure::functions::relation::over_ColSpec_1__SortInfo_MANY___Window_1_", false, ps -> OverReturnInference(ps, this.pureModel), ps -> Lists.fixedSize.of(ps.get(0)._genericType()), ps -> true), + h("meta::pure::functions::relation::over_SortInfo_MANY__Frame_1___Window_1_", false, ps -> OverReturnInference(ps, this.pureModel), ps -> Lists.fixedSize.of(ps.get(0)._genericType()), ps -> true) ) ) ); @@ -883,9 +906,14 @@ public Handlers(PureModel pureModel) register(m( // meta::pure::functions::lang::eval(func:Function<{T[n]->V[m]}>[1], param:T[n]):V[m]; - grp(EvalInference, h("meta::pure::functions::lang::eval_Function_1__T_n__V_m_", true, ps -> res(funcReturnType(ps.get(0)), funcReturnMul(ps.get(0))), ps -> ps.size() == 2)), + grp(EvalInference, + h("meta::pure::functions::lang::eval_Function_1__T_n__V_m_", true, ps -> res(funcReturnType(ps.get(0)), funcReturnMul(ps.get(0)))) + ), // meta::pure::functions::lang::eval(func:Function<{->V[m]}>[1]):V[m]; - m(h("meta::pure::functions::lang::eval_Function_1__V_m_", true, ps -> res(funcReturnType(ps.get(0)), funcReturnMul(ps.get(0))), ps -> ps.size() == 1)) + m(h("meta::pure::functions::lang::eval_Function_1__V_m_", true, ps -> res(funcReturnType(ps.get(0)), funcReturnMul(ps.get(0))))), + grp(EvalInference2, + h("meta::pure::functions::lang::eval_Function_1__T_n__U_p__V_m_", true, ps -> res(funcReturnType(ps.get(0)), funcReturnMul(ps.get(0)))) + ) ) ); @@ -1297,8 +1325,8 @@ private void registerTDS() register("meta::pure::tds::asc_String_1__SortInformation_1_", false, ps -> res("meta::pure::tds::SortInformation", "one")); register("meta::pure::tds::desc_String_1__SortInformation_1_", false, ps -> res("meta::pure::tds::SortInformation", "one")); - register(h("meta::pure::functions::relation::ascending_ColSpec_1__SortInfo_1_", false, ps -> res("meta::pure::functions::relation::SortInfo", "one"))); - register(h("meta::pure::functions::relation::descending_ColSpec_1__SortInfo_1_", false, ps -> res("meta::pure::functions::relation::SortInfo", "one"))); + register(h("meta::pure::functions::relation::ascending_ColSpec_1__SortInfo_1_", false, ps -> res("meta::pure::functions::relation::SortInfo", "one"), ps -> Lists.fixedSize.of(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> true)); + register(h("meta::pure::functions::relation::descending_ColSpec_1__SortInfo_1_", false, ps -> res("meta::pure::functions::relation::SortInfo", "one"), ps -> Lists.fixedSize.of(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> true)); register(grp(JoinInference, h("meta::pure::functions::relation::join_Relation_1__Relation_1__JoinKind_1__Function_1__Relation_1_", true, ps -> JoinReturnInference(ps, this.pureModel), ps -> true))); @@ -1749,6 +1777,8 @@ private void registerAggregations() h("meta::pure::functions::math::sum_Integer_MANY__Integer_1_", false, ps -> res("Integer", "one"), ps -> typeMany(ps.get(0), "Integer")), h("meta::pure::functions::math::sum_Number_MANY__Number_1_", false, ps -> res("Number", "one"), ps -> typeMany(ps.get(0), "Number"))); + register(h("meta::pure::functions::math::variance_Number_MANY__Boolean_1__Number_1_", false, ps -> res("Number", "one"))); + register(m(m(h("meta::pure::functions::math::percentile_Number_MANY__Float_1__Boolean_1__Boolean_1__Number_$0_1$_", false, ps -> res("Number", "zeroOne"), ps -> ps.size() == 4)), m(h("meta::pure::functions::math::percentile_Number_MANY__Float_1__Number_$0_1$_", false, ps -> res("Number", "zeroOne"), ps -> true)))); } @@ -2518,12 +2548,13 @@ private Map buildDispatch() map.put("meta::pure::functions::lang::compare_T_1__T_1__Integer_1_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && isOne(ps.get(1)._multiplicity())); map.put("meta::pure::functions::lang::eval_Function_1__T_n__V_m_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || check(funcType(ps.get(0)._genericType()), (FunctionType ft) -> check(ft._parameters().toList(), (List nps) -> nps.size() == 1)))); map.put("meta::pure::functions::lang::eval_Function_1__V_m_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || check(funcType(ps.get(0)._genericType()), (FunctionType ft) -> check(ft._parameters().toList(), (List nps) -> nps.size() == 0)))); + map.put("meta::pure::functions::lang::eval_Function_1__T_n__U_p__V_m_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || check(funcType(ps.get(0)._genericType()), (FunctionType ft) -> check(ft._parameters().toList(), (List nps) -> nps.size() == 2)))); map.put("meta::pure::functions::lang::if_Boolean_1__Function_1__Function_1__T_m_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || "Boolean".equals(ps.get(0)._genericType()._rawType()._name())) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || check(funcType(ps.get(1)._genericType()), (FunctionType ft) -> check(ft._parameters().toList(), (List nps) -> nps.size() == 0))) && isOne(ps.get(2)._multiplicity()) && ("Nil".equals(ps.get(2)._genericType()._rawType()._name()) || check(funcType(ps.get(2)._genericType()), (FunctionType ft) -> check(ft._parameters().toList(), (List nps) -> nps.size() == 0)))); map.put("meta::pure::functions::lang::letFunction_String_1__T_m__T_m_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || "String".equals(ps.get(0)._genericType()._rawType()._name()))); map.put("meta::pure::functions::lang::match_Any_MANY__Function_$1_MANY$__T_m_", (List ps) -> ps.size() == 2 && matchOneMany(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || check(funcType(ps.get(1)._genericType()), (FunctionType ft) -> check(ft._parameters().toList(), (List nps) -> nps.size() == 1)))); map.put("meta::pure::functions::lang::new_Class_1__String_1__KeyExpression_MANY__T_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Class", "MappingClass", "ClassProjection").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "String".equals(ps.get(1)._genericType()._rawType()._name())) && ("Nil".equals(ps.get(2)._genericType()._rawType()._name()) || "KeyExpression".equals(ps.get(2)._genericType()._rawType()._name()))); map.put("meta::pure::functions::lang::subType_Any_m__T_1__T_m_", (List ps) -> ps.size() == 2 && isOne(ps.get(1)._multiplicity())); - map.put("meta::pure::functions::math::sign_Number_1__Integer_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || "Integer".equals(ps.get(0)._genericType()._rawType()._name()))); + map.put("meta::pure::functions::math::sign_Number_1__Integer_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Number","Float","Integer","Decimal").contains(ps.get(0)._genericType()._rawType()._name())); map.put("meta::pure::functions::math::abs_Float_1__Float_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || "Float".equals(ps.get(0)._genericType()._rawType()._name()))); map.put("meta::pure::functions::math::abs_Integer_1__Integer_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || "Integer".equals(ps.get(0)._genericType()._rawType()._name()))); map.put("meta::pure::functions::math::abs_Number_1__Number_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); @@ -2595,6 +2626,7 @@ private Map buildDispatch() map.put("meta::pure::functions::math::stdDevPopulation_Number_MANY__Number_1_", (List ps) -> ps.size() == 1 && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); map.put("meta::pure::functions::math::stdDevSample_Number_$1_MANY$__Number_1_", (List ps) -> ps.size() == 1 && matchOneMany(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); map.put("meta::pure::functions::math::stdDevSample_Number_MANY__Number_1_", (List ps) -> ps.size() == 1 && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); + map.put("meta::pure::functions::math::variance_Number_MANY__Boolean_1__Number_1_", (List ps) -> ps.size() == 2 && Sets.immutable.with("Nil","Number","Float","Integer","Decimal").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "Boolean".equals(ps.get(1)._genericType()._rawType()._name()))); map.put("meta::pure::functions::math::variancePopulation_Number_MANY__Number_1_", (List ps) -> ps.size() == 1 && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); map.put("meta::pure::functions::math::varianceSample_Number_MANY__Number_1_", (List ps) -> ps.size() == 1 && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); map.put("meta::pure::functions::math::sum_Float_MANY__Float_1_", (List ps) -> ps.size() == 1 && ("Nil".equals(ps.get(0)._genericType()._rawType()._name()) || "Float".equals(ps.get(0)._genericType()._rawType()._name()))); @@ -2609,6 +2641,7 @@ private Map buildDispatch() map.put("meta::pure::functions::math::toDegrees_Number_1__Float_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); map.put("meta::pure::functions::math::toFloat_Number_1__Float_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); map.put("meta::pure::functions::math::toRadians_Number_1__Float_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Number", "Integer", "Float", "Decimal").contains(ps.get(0)._genericType()._rawType()._name())); + map.put("meta::pure::functions::meta::enumName_Enumeration_1__String_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity())); map.put("meta::pure::functions::meta::enumValues_Enumeration_1__T_MANY_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity())); map.put("meta::pure::functions::meta::extractEnumValue_Enumeration_1__String_1__T_1_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "String".equals(ps.get(1)._genericType()._rawType()._name()))); @@ -2831,19 +2864,20 @@ private Map buildDispatch() map.put("meta::pure::functions::relation::project_C_MANY__FuncColSpecArray_1__Relation_1_", (List ps) -> ps.size() == 2 && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "FuncColSpecArray".equals(ps.get(1)._genericType()._rawType()._name()))); map.put("meta::pure::functions::relation::size_Relation_1__Integer_1_", (List ps) -> ps.size() == 1 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name())); - map.put("meta::pure::functions::relation::cumulativeDistribution_Relation_1___Window_1__T_1__Float_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); - map.put("meta::pure::functions::relation::denseRank_Relation_1___Window_1__T_1__Integer_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); - map.put("meta::pure::functions::relation::first_Relation_1___Window_1__T_1__T_$0_1$_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); - map.put("meta::pure::functions::relation::lag_Relation_1__T_1__Integer_1__T_$0_1$_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && isOne(ps.get(2)._multiplicity()) && ("Nil".equals(ps.get(2)._genericType()._rawType()._name()) || "Integer".equals(ps.get(2)._genericType()._rawType()._name()))); - map.put("meta::pure::functions::relation::lag_Relation_1__T_1__T_$0_1$_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity())); - map.put("meta::pure::functions::relation::last_Relation_1___Window_1__T_1__T_$0_1$_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); - map.put("meta::pure::functions::relation::lead_Relation_1__T_1__Integer_1__T_$0_1$_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && isOne(ps.get(2)._multiplicity()) && ("Nil".equals(ps.get(2)._genericType()._rawType()._name()) || "Integer".equals(ps.get(2)._genericType()._rawType()._name()))); - map.put("meta::pure::functions::relation::lead_Relation_1__T_1__T_$0_1$_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity())); - map.put("meta::pure::functions::relation::nth_Relation_1___Window_1__T_1__Integer_1__T_$0_1$_", (List ps) -> ps.size() == 4 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity()) && isOne(ps.get(3)._multiplicity()) && ("Nil".equals(ps.get(3)._genericType()._rawType()._name()) || "Integer".equals(ps.get(3)._genericType()._rawType()._name()))); - map.put("meta::pure::functions::relation::ntile_Relation_1__T_1__Integer_1__Integer_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && isOne(ps.get(2)._multiplicity()) && ("Nil".equals(ps.get(2)._genericType()._rawType()._name()) || "Integer".equals(ps.get(2)._genericType()._rawType()._name()))); - map.put("meta::pure::functions::relation::percentRank_Relation_1___Window_1__T_1__Float_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); - map.put("meta::pure::functions::relation::rank_Relation_1___Window_1__T_1__Integer_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); - map.put("meta::pure::functions::relation::rowNumber_Relation_1__T_1__Integer_1_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil","Relation","RelationElementAccessor","TDS","RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity())); + map.put("meta::pure::functions::relation::cumulativeDistribution_Relation_1___Window_1__T_1__Float_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); + map.put("meta::pure::functions::relation::denseRank_Relation_1___Window_1__T_1__Integer_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); + map.put("meta::pure::functions::relation::first_Relation_1___Window_1__T_1__T_$0_1$_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); + map.put("meta::pure::functions::relation::lag_Relation_1__T_1__Integer_1__T_$0_1$_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && isOne(ps.get(2)._multiplicity()) && ("Nil".equals(ps.get(2)._genericType()._rawType()._name()) || "Integer".equals(ps.get(2)._genericType()._rawType()._name()))); + map.put("meta::pure::functions::relation::lag_Relation_1__T_1__T_$0_1$_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity())); + map.put("meta::pure::functions::relation::last_Relation_1___Window_1__T_1__T_$0_1$_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); + map.put("meta::pure::functions::relation::lead_Relation_1__T_1__Integer_1__T_$0_1$_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && isOne(ps.get(2)._multiplicity()) && ("Nil".equals(ps.get(2)._genericType()._rawType()._name()) || "Integer".equals(ps.get(2)._genericType()._rawType()._name()))); + map.put("meta::pure::functions::relation::lead_Relation_1__T_1__T_$0_1$_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity())); + map.put("meta::pure::functions::relation::nth_Relation_1___Window_1__T_1__Integer_1__T_$0_1$_", (List ps) -> ps.size() == 4 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity()) && isOne(ps.get(3)._multiplicity()) && ("Nil".equals(ps.get(3)._genericType()._rawType()._name()) || "Integer".equals(ps.get(3)._genericType()._rawType()._name()))); + map.put("meta::pure::functions::relation::ntile_Relation_1__T_1__Integer_1__Integer_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && isOne(ps.get(2)._multiplicity()) && ("Nil".equals(ps.get(2)._genericType()._rawType()._name()) || "Integer".equals(ps.get(2)._genericType()._rawType()._name()))); + map.put("meta::pure::functions::relation::percentRank_Relation_1___Window_1__T_1__Float_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); + map.put("meta::pure::functions::relation::rank_Relation_1___Window_1__T_1__Integer_1_", (List ps) -> ps.size() == 3 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity()) && ("Nil".equals(ps.get(1)._genericType()._rawType()._name()) || "_Window".equals(ps.get(1)._genericType()._rawType()._name())) && isOne(ps.get(2)._multiplicity())); + map.put("meta::pure::functions::relation::rowNumber_Relation_1__T_1__Integer_1_", (List ps) -> ps.size() == 2 && isOne(ps.get(0)._multiplicity()) && Sets.immutable.with("Nil", "Relation", "RelationElementAccessor", "TDS", "RelationStoreAccessor").contains(ps.get(0)._genericType()._rawType()._name()) && isOne(ps.get(1)._multiplicity())); + // ------------------------------------------------------------------------------------------------ // Please do not update the following code manually! Please check with the team when introducing diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java index d75fb7c53a1..79a409f209a 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java @@ -28,10 +28,12 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; +import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m3.navigation.type.Type; import java.util.List; @@ -62,15 +64,32 @@ public boolean test(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.fu private boolean comp(VariableExpression vv, org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification vs, PureModel pureModel, ProcessingContext processingContext) { boolean isSignatureFunction = vv._genericType()._rawType() != null && Type.subTypeOf(vv._genericType()._rawType(), pureModel.getType("meta::pure::metamodel::function::Function"), pureModel.getExecutionSupport().getProcessorSupport()); - boolean isParamFunction = vs instanceof Lambda || (vs instanceof ClassInstance && ((ClassInstance) vs).type.equals("path")) || isVariableSubtypeOfFunction(vs, processingContext, pureModel) || (vs instanceof Collection && ((Collection) vs).values.stream().allMatch(v -> v instanceof Lambda || (v instanceof ClassInstance && ((ClassInstance) v).type.equals("path")) || isVariableSubtypeOfFunction(v, processingContext, pureModel))); - + boolean isParamFunction = vs instanceof Lambda || + (vs instanceof ClassInstance && ((ClassInstance) vs).type.equals("path")) || + isPackageableElementSubtypeOfFunction(vs, processingContext, pureModel) || + isVariableSubtypeOfFunction(vs, processingContext, pureModel) || + (vs instanceof Collection && ((Collection) vs).values.stream().allMatch(v -> v instanceof Lambda || (v instanceof ClassInstance && ((ClassInstance) v).type.equals("path")) || isVariableSubtypeOfFunction(v, processingContext, pureModel))); boolean isParamEmpty = vs instanceof Collection && ((Collection) vs).values.isEmpty(); return isParamEmpty || (isSignatureFunction && isParamFunction) || (!isSignatureFunction && !isParamFunction); } + private boolean isPackageableElementSubtypeOfFunction(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification valueSpecification, ProcessingContext processingContext, PureModel pureModel) + { + return (valueSpecification instanceof PackageableElementPtr + && pureModel.getExecutionSupport().getProcessorSupport().package_getByUserPath(((PackageableElementPtr) valueSpecification).fullPath) != null + && Type.subTypeOf( + pureModel.getExecutionSupport().getProcessorSupport().package_getByUserPath(((PackageableElementPtr) valueSpecification).fullPath).getClassifier(), + pureModel.getExecutionSupport().getProcessorSupport().package_getByUserPath(M3Paths.Function), + pureModel.getExecutionSupport().getProcessorSupport() + ) + ); + } + private boolean isVariableSubtypeOfFunction(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification valueSpecification, ProcessingContext processingContext, PureModel pureModel) { - return (valueSpecification instanceof Variable && Type.subTypeOf(processingContext.getInferredVariable(((Variable) valueSpecification).name)._genericType()._rawType(), pureModel.getType("meta::pure::metamodel::function::Function"), pureModel.getExecutionSupport().getProcessorSupport())); + return (valueSpecification instanceof Variable + && processingContext.getInferredVariable(((Variable) valueSpecification).name) != null + && Type.subTypeOf(processingContext.getInferredVariable(((Variable) valueSpecification).name)._genericType()._rawType(), pureModel.getType("meta::pure::metamodel::function::Function"), pureModel.getExecutionSupport().getProcessorSupport())); } public abstract MutableList handlers(); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java index 4389e9a4835..d0ae66e4e73 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java @@ -281,6 +281,15 @@ public void testCompileLambdaVariable() "} ", null); } + @Test + public void testCompileEvalUsingPackageableElement() + { + TestCompilationFromGrammarTestSuite.test("function test::func(): Any[*]\n" + + "{\n" + + " meta::pure::functions::math::acos_Number_1__Float_1_->meta::pure::functions::lang::eval(0.5);\n" + + "} ", null); + } + @Test public void testCompilationFromGrammarWithMergeOperation() { @@ -1054,4 +1063,15 @@ public void testCompilationYtd() "}"); } + @Test + public void testCompilationDate() + { + TestCompilationFromGrammarTestSuite.test( + "###Pure\n" + + "function example::testYtd(): Any[*]\n" + + "{" + + " |(%2014 == %2014);" + + "}"); + } + } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/fromGrammar/TestDomainCompilationFromGrammar.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/fromGrammar/TestDomainCompilationFromGrammar.java index e8e9dc9b9ec..d3a7dbfc568 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/fromGrammar/TestDomainCompilationFromGrammar.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/fromGrammar/TestDomainCompilationFromGrammar.java @@ -1608,7 +1608,7 @@ public void testReturnMultiplicityErrorInQualifier() } @Test - public void testEval() + public void testEval1Param() { test("Class test::A" + "{" + @@ -1630,6 +1630,30 @@ public void testEval() "}", "COMPILATION error at [1:63-66]: Can't find a match for function 'plus(Any[2])'"); } + @Test + public void testEval2Param() + { + test("Class test::A" + + "{" + + " name : String[1];" + + "}" + + "" + + "Class test::B" + + "{" + + " z(){ {a,b|$a+$b}->eval(1,2);}:Integer[1];\n" + + "}"); + test("Class test::A" + + "{" + + " name : String[1];" + + "}" + + "" + + "Class test::B" + + "{" + + " z(){ {a,b|$a+$b}->eval(1,'a');}:Integer[1];\n" + + "}", "COMPILATION error at [1:65-67]: Can't find a match for function 'plus(Any[2])'"); + } + + @Test public void testPropertyPostFunction() { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 index c629825a8b6..b7e67548f67 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 @@ -19,15 +19,16 @@ expression: ( | notExpression | signedExpression | expressionsArray + | (PAREN_OPEN combinedExpression PAREN_CLOSE) ) ( (propertyOrFunctionExpression)* (equalNotEqual)? ) ) - | - (PAREN_OPEN combinedExpression PAREN_CLOSE) ; + + instance: NEW_SYMBOL qualifiedName (LESS_THAN typeArguments? (PIPE multiplicityArguments)? GREATER_THAN)? identifier? (FILE_NAME COLON INTEGER COMMA INTEGER COMMA INTEGER COMMA INTEGER COMMA INTEGER COMMA INTEGER FILE_NAME_END)? (AT qualifiedName)? PAREN_OPEN @@ -69,15 +70,13 @@ programLine: combinedExpression | letExpressi ; equalNotEqual: (TEST_EQUAL | TEST_NOT_EQUAL) combinedArithmeticOnly ; -combinedArithmeticOnly: expressionOrExpressionGroup arithmeticPart* +combinedArithmeticOnly: expression arithmeticPart* ; expressionPart: booleanPart | arithmeticPart ; letExpression: LET identifier EQUAL combinedExpression ; -combinedExpression: expressionOrExpressionGroup expressionPart* -; -expressionOrExpressionGroup: expression +combinedExpression: expression expressionPart* ; expressionsArray: BRACKET_OPEN ( expression (COMMA expression)* )? BRACKET_CLOSE ; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java index 24955c8bdd8..98c1139e03f 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java @@ -137,9 +137,7 @@ private CDate parsePureDate(String value, int start, int end) } if (index == end && day != -1) { - CStrictDate cStrictDate = new CStrictDate(value.substring(value.lastIndexOf(DATE_PREFIX) + 1)); - cStrictDate.sourceInformation = walkerSourceInformation.getSourceInformation(this.dateToken.getSymbol()); - return cStrictDate; + return createStrictDate(value.substring(value.lastIndexOf(DATE_PREFIX) + 1)); } if (value.charAt(index++) != DATE_TIME_SEPARATOR) { @@ -155,6 +153,13 @@ private CDateTime createDateTime(String value) return cDateTime; } + private CStrictDate createStrictDate(String value) + { + CStrictDate cStrictDate = new CStrictDate(value); + cStrictDate.sourceInformation = walkerSourceInformation.getSourceInformation(this.dateToken.getSymbol()); + return cStrictDate; + } + private void throwInvalidDateString(String string) { throwInvalidDateString(string, 0, string.length()); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java index feb9c1516a5..08389c3a427 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java @@ -770,7 +770,7 @@ private ValueSpecification programLine(DomainParserGrammar.ProgramLineContext ct public ValueSpecification combinedExpression(DomainParserGrammar.CombinedExpressionContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) { - ValueSpecification result = this.expressionOrExpressionGroup(ctx.expressionOrExpressionGroup(), exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); + ValueSpecification result = this.expressionOrExpressionGroup(ctx.expression(), exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); ValueSpecification boolResult = result; ValueSpecification arithResult = result; @@ -943,15 +943,15 @@ private ValueSpecification processRightSide(DomainParserGrammar.ExpressionInstan ValueSpecification ctx = null; if (rightside.expressionInstanceAtomicRightSide().combinedExpression() != null) { - ctx = expressionOrExpressionGroup(rightside.expressionInstanceAtomicRightSide().combinedExpression().expressionOrExpressionGroup(), null, typeParametersNames, lambdaContext, space, false, addLines); + ctx = expressionOrExpressionGroup(rightside.expressionInstanceAtomicRightSide().combinedExpression().expression(), null, typeParametersNames, lambdaContext, space, false, addLines); } return ctx; } - private ValueSpecification expressionOrExpressionGroup(DomainParserGrammar.ExpressionOrExpressionGroupContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) + private ValueSpecification expressionOrExpressionGroup(DomainParserGrammar.ExpressionContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) { - return this.expression(ctx.expression(), exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); + return this.expression(ctx, exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); } private ValueSpecification expression(DomainParserGrammar.ExpressionContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) @@ -961,9 +961,9 @@ private ValueSpecification expression(DomainParserGrammar.ExpressionContext ctx, List parameters; if (ctx.combinedExpression() != null) { - return this.combinedExpression(ctx.combinedExpression(), exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); + result = this.combinedExpression(ctx.combinedExpression(), exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); } - if (ctx.atomicExpression() != null) + else if (ctx.atomicExpression() != null) { result = this.atomicExpression(ctx.atomicExpression(), typeParametersNames, lambdaContext, space, wrapFlag, addLines); } @@ -1167,7 +1167,7 @@ else if (ctx.TEST_NOT_EQUAL() != null) private ValueSpecification combinedArithmeticOnly(DomainParserGrammar.CombinedArithmeticOnlyContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) { - ValueSpecification result = this.expressionOrExpressionGroup(ctx.expressionOrExpressionGroup(), exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); + ValueSpecification result = this.expressionOrExpressionGroup(ctx.expression(), exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); if (Iterate.notEmpty(ctx.arithmeticPart())) { result = this.arithmeticPart(ctx.arithmeticPart(), result, exprName, typeParametersNames, lambdaContext, space, wrapFlag, addLines); @@ -1245,15 +1245,12 @@ else if (ctx.FLOAT() != null) instance.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); result = instance; } -// else if (ctx.DECIMAL() != null) -// { -// List values = new ArrayList<>(); -// values.add(Double.parseDouble(ctx.getText())); -// CFloat instance = new CFloat(); -// instance.multiplicity = this.getPureOne(); -// instance.values = values; -// result = instance; -// } + else if (ctx.DECIMAL() != null) + { + CFloat instance = getInstanceFloat(ctx.getText()); + instance.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); + result = instance; + } else if (ctx.DATE() != null) { result = new DateParseTreeWalker(ctx.DATE(), this.walkerSourceInformation).visitDefinition(); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java index f1ece9d4f19..5a9df1e107a 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java @@ -21,7 +21,6 @@ import org.eclipse.collections.impl.list.mutable.ListAdapter; import org.finos.legend.engine.language.pure.grammar.from.antlr4.domain.DomainParserGrammar; import org.finos.legend.engine.language.pure.grammar.test.TestGrammarParser; -import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementType; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestLambdaRoundtrip.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestLambdaRoundtrip.java index afe5989ddf2..85fd9212322 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestLambdaRoundtrip.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestLambdaRoundtrip.java @@ -211,6 +211,19 @@ public void testLambdaWithNot() testLambda("|not(true == false)", "|!(true == false)"); } + @Test + public void testLambdaGroupingLeftSide() + { + testLambda("|(1+2)->process();","|process(1 + 2)"); + } + + + @Test + public void testGroup() + { + testLambda("|5 * (1 + 2)"); + } + @Test public void testLambdaWithAnd() { diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/corefunctions/metaExtension.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/corefunctions/metaExtension.pure index 47f1b029438..8d124709cca 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/corefunctions/metaExtension.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/corefunctions/metaExtension.pure @@ -756,3 +756,21 @@ function meta::pure::functions::meta::typePath(any:Any[1]):String[1] { $any->type()->elementToPath(); } + +function meta::pure::functions::meta::removeAutomap(v:ValueSpecification[1]):ValueSpecification[1] +{ + $v->match([fe:FunctionExpression[1] | if($fe.functionName=='map' + ,| let left = $fe.parametersValues->at(0); + let prop = $fe.parametersValues->at(1)->match([x:FunctionRoutedValueSpecification[1]|$x.value,a:Any[1]|$a])->cast(@InstanceValue).values->at(0)->cast(@LambdaFunction).expressionSequence->at(0)->cast(@FunctionExpression); + if($prop.parametersValues->at(0)->instanceOf(VariableExpression) && $prop.parametersValues->at(0)->cast(@VariableExpression).name=='v_automap', + | let leftUnMapped = $left->meta::pure::functions::meta::removeAutomap(); + ^$prop(parametersValues=$leftUnMapped);, + | ^$fe(parametersValues=$fe.parametersValues->at(0)->meta::pure::functions::meta::removeAutomap()->concatenate( $fe.parametersValues->tail())) + ); + + ,| if ($fe.parametersValues->isNotEmpty(), + | ^$fe(parametersValues=$fe.parametersValues->at(0)->meta::pure::functions::meta::removeAutomap()->concatenate( $fe.parametersValues->tail())), + | $fe) + ), + v:ValueSpecification[1] | $v]); +} \ No newline at end of file diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/preeval/preeval.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/preeval/preeval.pure index 323087e1cfe..b25355c80fc 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/preeval/preeval.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/preeval/preeval.pure @@ -89,7 +89,6 @@ function <> meta::pure::router::preeval::preval(f : FunctionDefin let res = $r.value->toOne(); $state->printDebug('Transformed To:'); $state->printDebug(|$res->meta::pure::metamodel::serialization::grammar::printFunctionDefinition('')); - $state->printDebug($res); ); $r; }, 'preval'); @@ -132,8 +131,7 @@ function <> meta::pure::router::preeval::prevalInternal(item : A ->match([ {lambda : LambdaFunction[1]| let fnArgNames = $lambda->functionType().parameters.name; - let fnOpenVariables = $lambda->openVariableValues()->putAll($state.inScopeVars->keyValues()->filter(kv | !$kv.first->in($fnArgNames))->newMap()); - + let fnOpenVariables = $lambda->openVariableValues()->putAll($state.inScopeVars->keyValues()->filter(kv | !$kv.first->in($fnArgNames))->newMap()); $lambda->prevalFunctionDefinition(^$state(inScopeVars = $fnOpenVariables), $extensions); }, {fd : FunctionDefinition[1]| @@ -900,8 +898,7 @@ function <> meta::pure::router::preeval::resolveGenericType(in : ); ); , - | - let value = $state.inScopeTypeParams->get($in.typeParameter->toOne().name); + | let value = $state.inScopeTypeParams->get($in.typeParameter->toOne().name); if($value->isEmpty(), | ^PrevalWrapper(value = $in, canPreval=true, modified = false), | ^PrevalWrapper(value = $value->toOne(), canPreval=true, modified = true) diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/routing/router_routing.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/routing/router_routing.pure index 737f0916e14..234fa16c7e8 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/routing/router_routing.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/routing/router_routing.pure @@ -77,31 +77,31 @@ function meta::pure::router::routing::enrichFunctionExpressions(expressions:Func function meta::pure::router::routing::processCollection(state:RoutingState[1], col:Any[*], executionContext:meta::pure::runtime::ExecutionContext[1], vars:Map[1], inScopeVars:Map>[1], shouldProcess:Function<{Any[1]->Boolean[1]}>[1], extensions:meta::pure::extension::Extension[*], debug:DebugContext[1]):RoutingState[*] { $col->fold({c,a| let last = $a->last()->toOne(); - let newState = if($c->instanceOf(ValueSpecification) && $shouldProcess->eval($c), - |^$last( - value = $c, - depth = $state.depth, - propertyMap = $state.propertyMap - )->routeValueSpecification($executionContext, $vars, $inScopeVars, $extensions, $debug);, - | - if($c->instanceOf(Path) && $shouldProcess->eval($c), - |^$last( - value = $c, - depth = $state.depth, - propertyMap = $state.propertyMap - )->routePath($executionContext, $vars, $inScopeVars, $extensions, $debug);, - | - if ($c->instanceOf(KeyExpression) && $shouldProcess->eval($c), - |let ke = $c->cast(@KeyExpression); - let routedExpression = ^$last(value = $ke.expression, depth = $state.depth, propertyMap = $state.propertyMap)->routeValueSpecification($executionContext, $vars, $inScopeVars, $extensions, $debug); - ^$last(value = ^$ke(expression=$routedExpression.value->cast(@ValueSpecification)->toOne()), - depth = $state.depth, - propertyMap = $state.propertyMap);, + let newState = if([ + pair( |$c->instanceOf(ValueSpecification) && $shouldProcess->eval($c), + |^$last( + value = $c, + depth = $state.depth, + propertyMap = $state.propertyMap + )->routeValueSpecification($executionContext, $vars, $inScopeVars, $extensions, $debug);), + pair( |$c->instanceOf(Path) && $shouldProcess->eval($c), + |^$last( + value = $c, + depth = $state.depth, + propertyMap = $state.propertyMap + )->routePath($executionContext, $vars, $inScopeVars, $extensions, $debug);), + pair( |$c->instanceOf(KeyExpression) && $shouldProcess->eval($c), + |let ke = $c->cast(@KeyExpression); + let routedExpression = ^$last(value = $ke.expression, depth = $state.depth, propertyMap = $state.propertyMap)->routeValueSpecification($executionContext, $vars, $inScopeVars, $extensions, $debug); + ^$last(value = ^$ke(expression=$routedExpression.value->cast(@ValueSpecification)->toOne()), + depth = $state.depth, + propertyMap = $state.propertyMap);) + ], |^$last(value = $c, depth = $state.depth, propertyMap = $state.propertyMap ) - ))); + ); $a->add($newState); }, [$state]->toOneMany() @@ -239,6 +239,33 @@ function meta::pure::router::routing::routeFunctionExpressionColumn(c:Columncast(@ValueSpecification))); } +function meta::pure::router::routing::prevalFuncColSpec(z:FuncColSpec[1], routed:ExtendedRoutedValueSpecification[*], state:RoutingState[1], executionContext:meta::pure::runtime::ExecutionContext[1], vars:Map[1], inScopeVars:Map>[1], extensions:meta::pure::extension::Extension[*], debug:DebugContext[1]):FuncColSpec[1] +{ + let res = processAggregationValueFunction($z.function, $routed, $state, $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); + let newFunc = $res.value->match( + [ + e:ExtendedRoutedValueSpecification[1]|$e.value, + e:FunctionRoutedValueSpecification [1]|$e + ])->cast(@FunctionRoutedValueSpecification).value->cast(@InstanceValue).values->toOne(); + $z->genericType()->toOne()->dynamicNew([ + ^KeyValue(key='name', value = $z.name), + ^KeyValue(key='function', value = $newFunc) + ])->cast(@FuncColSpec); +} + +function meta::pure::router::routing::prevalAggColSpec(z:AggColSpec[1], routed:ExtendedRoutedValueSpecification[*], state:RoutingState[1], executionContext:meta::pure::runtime::ExecutionContext[1], vars:Map[1], inScopeVars:Map>[1], extensions:meta::pure::extension::Extension[*], debug:DebugContext[1]):AggColSpec[1] +{ + let mapR = processAggregationValueFunction($z.map, $routed, $state, $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); + let reduceR = processAggregationValueFunction($z.reduce, $routed, $state, $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); + let newMapF = $mapR.value->match([e:ExtendedRoutedValueSpecification[1]|$e.value, e:FunctionRoutedValueSpecification [1]|$e])->cast(@FunctionRoutedValueSpecification).value->cast(@InstanceValue).values->toOne(); + let newReduceF= $reduceR.value->match([e:ExtendedRoutedValueSpecification[1]|$e.value, e:FunctionRoutedValueSpecification [1]|$e])->cast(@FunctionRoutedValueSpecification).value->cast(@InstanceValue).values->toOne(); + $z->genericType()->toOne()->dynamicNew([ + ^KeyValue(key='name', value = $z.name), + ^KeyValue(key='map', value = $newMapF), + ^KeyValue(key='reduce', value = $newReduceF) + ])->cast(@AggColSpec); +} + function meta::pure::router::routing::routeFunctionExpressionFunctionDefinition(f:Function[1], fe:FunctionExpression[1], state:RoutingState[1], executionContext:meta::pure::runtime::ExecutionContext[1], vars:Map[1], inScopeVars:Map>[1], extensions:meta::pure::extension::Extension[*], debug:DebugContext[1]):RoutingState[1] { if ($fe.parametersValues->isEmpty(), @@ -290,11 +317,16 @@ function meta::pure::router::routing::routeFunctionExpressionFunctionDefinition( ); ); $a->concatenate($res);, - |if($p.genericType.rawType->isNotEmpty() && $p.genericType.rawType != Nil && $p.genericType.rawType->toOne()->_subTypeOf(meta::pure::tds::ColumnSpecification), + | if($p.genericType.rawType->isNotEmpty() && $p.genericType.rawType != Nil && $p.genericType.rawType->toOne()->_subTypeOf(meta::pure::tds::ColumnSpecification), | let res = $p->processColumnSpecification(^$currentLast(pathPrefix=$pathPrefix, routed+=$routed), $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); $a->concatenate($res);, - | if($p->cast(@ValueSpecification).genericType.rawType == meta::pure::functions::collection::AggregateValue || - $p->cast(@ValueSpecification).genericType.rawType == meta::pure::tds::AggregateValue, + | let vsRawType = $p->cast(@ValueSpecification).genericType.rawType; + if($vsRawType->in([ meta::pure::functions::collection::AggregateValue, + meta::pure::tds::AggregateValue, + meta::pure::metamodel::relation::FuncColSpec, + meta::pure::metamodel::relation::FuncColSpecArray, + meta::pure::metamodel::relation::AggColSpec, + meta::pure::metamodel::relation::AggColSpecArray]), | let resolved = $p->match([v:VariableExpression[1]|meta::pure::functions::meta::resolve($v, $vars, $inScopeVars), v:ValueSpecification[1]|$v]); if($resolved->isEmpty(), |$a->concatenate(^$currentLast(value = $p)), @@ -306,6 +338,30 @@ function meta::pure::router::routing::routeFunctionExpressionFunctionDefinition( ->match( [ f:FunctionExpression[1]|$a->concatenate($fe->cast(@FunctionExpression)->processAggregationFunctionExpression($routed, ^$currentLast(routingStrategy = $lastState.routingStrategy, counter = $lastState.counter), $executionContext, $vars, $inScopeVars, $extensions, $debug));, + z:FuncColSpec[1]| + let res = prevalFuncColSpec($z, $routed, ^$currentLast(pathPrefix=$pathPrefix, propertyMap=$state.propertyMap, routingStrategy = $lastState.routingStrategy, counter = $lastState.counter), $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); + $a->concatenate(^$lastState(value=$res));, + d:FuncColSpecArray[1]| + let r = $d.funcSpecs->map(z| + prevalFuncColSpec($z, $routed, ^$currentLast(pathPrefix=$pathPrefix, propertyMap=$state.propertyMap, routingStrategy = $lastState.routingStrategy, counter = $lastState.counter), $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); + ); + // Rebuild the FuncColSpecArray + let other = $p.genericType->dynamicNew([ + ^KeyValue(key='funcSpecs', value = $r) + ]); + $a->concatenate(^$lastState(value=$other));, + x:AggColSpec[1]| + let res = prevalAggColSpec($x, $routed, ^$currentLast(pathPrefix=$pathPrefix, propertyMap=$state.propertyMap, routingStrategy = $lastState.routingStrategy, counter = $lastState.counter), $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); + $a->concatenate(^$lastState(value=$res));, + x:AggColSpecArray[1]| + let r = $x.aggSpecs->map(z| + prevalAggColSpec($z, $routed, ^$currentLast(pathPrefix=$pathPrefix, propertyMap=$state.propertyMap, routingStrategy = $lastState.routingStrategy, counter = $lastState.counter), $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); + ); + // Rebuild the FuncColSpecArray + let other = $p.genericType->dynamicNew([ + ^KeyValue(key='aggSpecs', value = $r) + ]); + $a->concatenate(^$lastState(value=$other));, agg:meta::pure::functions::collection::AggregateValue[1]| let mapFn = processAggregationValueFunction($agg.mapFn, $routed, ^$currentLast(pathPrefix=$pathPrefix, propertyMap=$state.propertyMap, routingStrategy = $lastState.routingStrategy, counter = $lastState.counter), $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); let aggFn = processAggregationValueFunction($agg.aggregateFn, $routed, $mapFn, $executionContext, $vars, $inScopeVars, $extensions, ^$debug(space = $debug.space+' ')); @@ -346,8 +402,8 @@ function meta::pure::router::routing::routeFunctionExpressionFunctionDefinition( ]); );, |$a->concatenate(^$currentLast(value = $p)) - ) - )); + ); + );); }, $lastFirstPass->toOneMany()); @@ -582,7 +638,7 @@ function meta::pure::router::routing::processAggregationValueFunction(fn:Functio $vars, $inScopeVars, $extensions, - $debug); + $debug); } function meta::pure::router::routing::resolveVar(va:VariableExpression[1], state:RoutingState[1], debug:DebugContext[1]):RoutingState[1] diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/store/routing.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/store/routing.pure index 62b21d951ab..1f5ed958bc7 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/store/routing.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/router/store/routing.pure @@ -344,7 +344,6 @@ function meta::pure::router::store::routing::specializedFunctionExpressionRoute f:FunctionExpression[1] |let r = $f->meta::pure::router::preeval::preval($inScopeVars, $extensions, $debug); $r->reactivate($inScopeVars);, i:InstanceValue[1] |$i.values])); - let fromRuntime = $resolvedParameters->at(0)->cast(@Runtime); routeFunctionExpression( $fe.parametersValues->at(0)->cast(@FunctionExpression), diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/serialization/toPureGrammar.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/serialization/toPureGrammar.pure index 8425f68bdf4..e8fcae27ff1 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/serialization/toPureGrammar.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/serialization/toPureGrammar.pure @@ -18,9 +18,42 @@ import meta::pure::metamodel::relation::*; import meta::pure::mapping::*; import meta::pure::metamodel::serialization::grammar::*; +Class meta::pure::metamodel::serialization::grammar::Configuration +{ + fullPath : Boolean[1]; + extensions : meta::pure::metamodel::serialization::grammar::GrammarExtension[*]; +} + +Class meta::pure::metamodel::serialization::grammar::GrammarExtension +{ + extraConnectionHandlers : Function<{Nil[0..1]->String[1]}>[*]; + extraInstanceValueHandlers : Function<{Nil[0..1]->String[1]}>[*]; +} + +function meta::pure::metamodel::serialization::grammar::printValueSpecification(v:Any[1], space:String[1]):String[1] +{ + printValueSpecification($v, [], $space); +} + +function meta::pure::metamodel::serialization::grammar::printFunctionDefinition(functionDefinition:FunctionDefinition[1], space:String[1]):String[1] +{ + printFunctionDefinition($functionDefinition, [], $space); +} + +function meta::pure::metamodel::serialization::grammar::printFunctionExpression(functionExpression:FunctionExpression[1], space:String[1]):String[1] +{ + printFunctionExpression($functionExpression, [], $space); +} + function meta::pure::metamodel::serialization::grammar::printFunctionDefinitionExpressions(functionDefinition:FunctionDefinition[1], space:String[1]):String[*] { - $functionDefinition.expressionSequence->evaluateAndDeactivate()->map(vs|printValueSpecification($vs, $space+' ')); + printFunctionDefinitionExpressions($functionDefinition, [], $space); +} + + +function meta::pure::metamodel::serialization::grammar::printFunctionDefinitionExpressions(functionDefinition:FunctionDefinition[1], configuration:Configuration[0..1], space:String[1]):String[*] +{ + $functionDefinition.expressionSequence->evaluateAndDeactivate()->map(vs|printValueSpecification($vs, $configuration, $space+' ')); } function meta::pure::metamodel::serialization::grammar::printLambdaParameters(func:Function[1]):String[1] @@ -29,9 +62,9 @@ function meta::pure::metamodel::serialization::grammar::printLambdaParameters(fu $funcType.parameters->evaluateAndDeactivate()->map(v | $v.name)->joinStrings(', '); } -function meta::pure::metamodel::serialization::grammar::printFunctionDefinition(functionDefinition:FunctionDefinition[1], space:String[1]):String[1] +function meta::pure::metamodel::serialization::grammar::printFunctionDefinition(functionDefinition:FunctionDefinition[1], configuration:Configuration[0..1], space:String[1]):String[1] { - let expressions = printFunctionDefinitionExpressions($functionDefinition, $space); + let expressions = printFunctionDefinitionExpressions($functionDefinition, $configuration, $space); $functionDefinition->match([ lambda:LambdaFunction[1] | let functionParameters = '{'+printLambdaParameters($lambda)+'|'; @@ -44,65 +77,68 @@ function meta::pure::metamodel::serialization::grammar::printFunctionDefinition( ]); } -function meta::pure::metamodel::serialization::grammar::printValueSpecification(v:Any[1], space:String[1]):String[1] +function meta::pure::metamodel::serialization::grammar::printValueSpecification(v:Any[1], configuration:Configuration[0..1], space:String[1]):String[1] { - $v->match( [ f:FunctionExpression[1] |$f->meta::pure::metamodel::serialization::grammar::removeAutomap()->cast(@FunctionExpression)->printPropertyOrFunctionExpression( $space), - i:InstanceValue[1] | printInstanceValue($i, $space), + $v->match( [ f:FunctionExpression[1] |$f->meta::pure::functions::meta::removeAutomap()->cast(@FunctionExpression)->printPropertyOrFunctionExpression($configuration, $space), + i:InstanceValue[1] | printInstanceValue($i, $configuration, $space), v:VariableExpression[1] | '$' + $v.name, - a:Any[1] | 'UNKNOWN ' + $a->type()->toOne()->id() + x:Enum[1] | $x->type()->elementToPath()+'.'+$x.name, + i:Integer[1] | $i->toRepresentation(), + d:Decimal[1] | $d->toRepresentation(), + f:Float[1] | $f->toRepresentation(), + a:Any[1] | 'UNKNOWN: ' + $a->type()->toOne()->id() ] - ) + ); } -function <> meta::pure::metamodel::serialization::grammar::removeAutomap(v:ValueSpecification[1]):ValueSpecification[1] -{ - $v->match([fe:FunctionExpression[1] | if($fe.functionName=='map' - ,| let left = $fe.parametersValues->at(0); - let prop = $fe.parametersValues->at(1)->cast(@InstanceValue).values->at(0)->cast(@LambdaFunction).expressionSequence->at(0)->cast(@FunctionExpression); - if($prop.parametersValues->at(0)->instanceOf(VariableExpression) && $prop.parametersValues->at(0)->cast(@VariableExpression).name=='v_automap', - | let leftUnMapped = $left->meta::pure::metamodel::serialization::grammar::removeAutomap(); - ^$prop(parametersValues=$leftUnMapped);, - | ^$fe(parametersValues=$fe.parametersValues->at(0)->meta::pure::metamodel::serialization::grammar::removeAutomap()->concatenate( $fe.parametersValues->tail())) - ); - ,| if ($fe.parametersValues->isNotEmpty(), - | ^$fe(parametersValues=$fe.parametersValues->at(0)->meta::pure::metamodel::serialization::grammar::removeAutomap()->concatenate( $fe.parametersValues->tail())), - | $fe) - ), - v:ValueSpecification[1] | $v]); +function <> meta::pure::metamodel::serialization::grammar::printConnection(c:Connection[0..1], configuration:Configuration[0..1]):String[1] +{ + $c->match( + $configuration.extensions.extraConnectionHandlers->concatenate( + [ + a:Any[1]|'UNKNOWN:'+$a->type().name->toOne() + ] + )->toOneMany() + ); } - -function meta::pure::metamodel::serialization::grammar::printInstanceValue(i:InstanceValue[1], space:String[1]):String[1] +function meta::pure::metamodel::serialization::grammar::printInstanceValue(i:InstanceValue[1], configuration:Configuration[0..1], space:String[1]):String[1] { if ($i.multiplicity == PureOne && $i.values->isEmpty(), |'@'+$i.genericType->printGenericType(), - |$i.values->map(v|$v->match([ - f:FunctionDefinition[1] | $f->printFunctionDefinition($space+' '), - f:FunctionExpression[1] | $f->printPropertyOrFunctionExpression($space), - x:InstanceValue[1] | $x->printInstanceValue($space), - r:Runtime[1]|'Runtime('+$r.connectionStores->map(s|$s.element->match([x:String[1]|$x,x:Store[1]|$x.name->toOne()]))->makeString(',')+')', - s:RelationElementAccessor[1]|'RelationElementAccessor('+$s->genericType().rawType.name->toOne()+')', - a:Any[1] | $a->toRepresentation() - ]))->match([ + |$i.values->map(v|$v->match( + $configuration.extensions.extraInstanceValueHandlers->concatenate([ + f:FunctionDefinition[1] | $f->printFunctionDefinition($configuration, $space+' '), + f:FunctionExpression[1] | $f->printPropertyOrFunctionExpression($configuration, $space), + x:InstanceValue[1] | $x->printInstanceValue($configuration, $space), + z:KeyExpression[*] | $z->map(f|$f.key.values->toOne()->toString())->joinStrings(','), + r:Runtime[1]|'^meta::core::runtime::Runtime('+ + 'connectionStores='+$r.connectionStores->map(s|'^meta::core::runtime::ConnectionStore(connection='+$s.connection->printConnection($configuration)+', element='+$s.element->match([x:String[1]|$x,x:Store[1]|$x->elementToPath()])+')')->makeString(',')+ + ')', + s:RelationElementAccessor[1]|'RelationElementAccessor('+$s->genericType().rawType.name->toOne()+')', + a:Any[1] | $a->toRepresentation() + ])->toOneMany() + ) + )->match([ empty:String[0] |'[]';, singular:String[1] |$singular;, multiple:String[*] |$multiple->joinStrings('[', ', ', ']'); - ]) - ) + ]) + ); } -function meta::pure::metamodel::serialization::grammar::printPropertyOrFunctionExpression(functionExpression:FunctionExpression[1], space:String[1]):String[1] +function <> meta::pure::metamodel::serialization::grammar::printPropertyOrFunctionExpression(functionExpression:FunctionExpression[1], configuration:Configuration[0..1], space:String[1]):String[1] { $functionExpression.func->match([ - p:Property[1] | printProperty($p, $functionExpression.parametersValues->at(0), $space), - q:QualifiedProperty[1]| printProperty($q, $functionExpression.parametersValues, $space), - c:Column[1] | printColumn($c, $functionExpression.parametersValues->at(0), $space), - a:Any[1] | printFunctionExpression($functionExpression, $space) + p:Property[1] | printProperty($p, $functionExpression.parametersValues->at(0), $configuration, $space), + q:QualifiedProperty[1]| printProperty($q, $functionExpression.parametersValues, $configuration, $space), + c:Column[1] | printColumn($c, $functionExpression.parametersValues->at(0), $configuration, $space), + a:Any[1] | printFunctionExpression($functionExpression, $configuration, $space) ]) } -function meta::pure::metamodel::serialization::grammar::special():Map[1] +function <> meta::pure::metamodel::serialization::grammar::special():Map[1] { [ pair('equal', '=='), @@ -119,70 +155,94 @@ function meta::pure::metamodel::serialization::grammar::special():MapnewMap() } -function meta::pure::metamodel::serialization::grammar::forceArrow():String[*] +function <> meta::pure::metamodel::serialization::grammar::forceArrow():String[*] { 'from' } -function meta::pure::metamodel::serialization::grammar::printFunctionExpression(functionExpression:FunctionExpression[1], space:String[1]):String[1] +function meta::pure::metamodel::serialization::grammar::printColSpec(functionExpression:FunctionExpression[1], configuration:Configuration[0..1], space:String[1]):String[1] { - let name = $functionExpression.func.functionName->toOne(); - if($functionExpression.parametersValues->isEmpty(), - |$name->toOne()+'()', - |if ($name == 'getAll', - |let genericType = $functionExpression.parametersValues->at(0)->cast(@InstanceValue).genericType; - let main = $genericType.rawType->toOne()->cast(@Class); - let val = if ($main == Class, - |$genericType.typeArguments->at(0).rawType->toOne()->cast(@Class), - |$main - ); - $val->elementToPath() + '.all()';, - |let m = special(); - if ($m->get($name)->isEmpty(), - | let firstParam = $functionExpression.parametersValues->head()->toOne(); - if(forceArrow()->contains($name) || - !( - ($firstParam->instanceOf(SimpleFunctionExpression) && $firstParam->cast(@SimpleFunctionExpression).functionName->isNotEmpty() && $m->get($firstParam->cast(@SimpleFunctionExpression).functionName->toOne())->isNotEmpty()) || - ($firstParam->instanceOf(FunctionExpression) && $firstParam->cast(@FunctionExpression).func.functionName->isNotEmpty() && $m->get($firstParam->cast(@FunctionExpression).func.functionName->toOne())->isNotEmpty()) - ) , - | $functionExpression.parametersValues->head()->toOne()->printValueSpecification($space) + '->' + $functionExpression.func.functionName->toOne() + $functionExpression.parametersValues->tail()->map(vs | printValueSpecification($vs, $space))->joinStrings('(', ', ', ')');, - | $functionExpression.func.functionName->toOne() + $functionExpression.parametersValues->map(vs | printValueSpecification($vs, $space))->joinStrings('(', ', ', ')'); - );, - |let vals = if ($name->in(['plus', 'minus', 'times']), - |$functionExpression.parametersValues->match([ - i:InstanceValue[1] | $i.values, - v:ValueSpecification[1] | $v - ]), - |$functionExpression.parametersValues - ); - if ($name == 'minus' && $vals->size() == 1, - | $m->get($name)->toOne() + $functionExpression.parametersValues->at(0)->printValueSpecification($space), - | if ($name->in(['and', 'or']) && $vals->size() == 1, - | $name + '(' + $vals->at(0)->printValueSpecification($space) + ')', - | if ($vals->size() > 1, - |'(' + $vals->at(0)->printValueSpecification($space) + ' ' + $m->get($name)->toOne() + ' ' + $vals->at(1)->printValueSpecification($space) + ')', - | $m->get($name)->toOne()+'('+$vals->at(0)->printValueSpecification($space)+')' - ) - ) - ); - ); - ); + let isAgg = $functionExpression.parametersValues->size() > 3; + $functionExpression.parametersValues->at(if($isAgg,|2,|1))->cast(@InstanceValue).values->at(0)->toString()->printColName() + + ':' + $functionExpression.parametersValues->at(0)->cast(@InstanceValue).values->at(0)->cast(@FunctionDefinition)->printFunctionDefinition($configuration, $space) + + if($isAgg,|':' + $functionExpression.parametersValues->at(1)->cast(@InstanceValue).values->at(0)->cast(@FunctionDefinition)->printFunctionDefinition($configuration, $space),|''); +} + +function meta::pure::metamodel::serialization::grammar::printColName(name:String[1]):String[1] +{ + if($name->contains(' '),|'\''+$name+'\'',|$name); +} + +function meta::pure::metamodel::serialization::grammar::printFunctionExpression(functionExpression:FunctionExpression[1], configuration:Configuration[0..1], space:String[1]):String[1] +{ + let name = if ($functionExpression.func.functionName->isEmpty(),|'UNKNOWN',|$functionExpression.func.functionName->toOne()); + let special = special(); + if ( + [ + pair(|$functionExpression.parametersValues->isEmpty(), | if($configuration->isNotEmpty() && $configuration->toOne().fullPath,|$functionExpression.func->cast(@PackageableElement).package->toOne()->elementToPath()+'::',|'')+$name->toOne()+'()'), + pair(|$name == 'getAll',|let genericType = $functionExpression.parametersValues->at(0)->cast(@InstanceValue).genericType; + let main = $genericType.rawType->toOne()->cast(@Class); + let val = if ($main == Class, + |$genericType.typeArguments->at(0).rawType->toOne()->cast(@Class), + |$main + ); + $val->elementToPath() + '.all()';), + pair(|$name == 'letFunction',|'let '+$functionExpression.parametersValues->at(0)->cast(@InstanceValue).values->toOne()->toString()+ ' = ' +$functionExpression.parametersValues->at(0)->printValueSpecification($space)), + pair(|$name == 'colSpec', |'~'+$functionExpression.parametersValues->at(0)->cast(@InstanceValue).values->at(0)->toString()->printColName()), + pair(|$name == 'funcColSpec' || $name == 'funcColSpec2', | '~'+printColSpec($functionExpression, $configuration, $space)), + pair(|$name == 'aggColSpec' || $name == 'aggColSpec2', | '~'+printColSpec($functionExpression, $configuration, $space)), + pair(|$name == 'colSpecArray' || $name == 'colSpecArray2', | '~['+$functionExpression.parametersValues->at(0)->cast(@InstanceValue).values->map(z|$z->toString()->printColName())->joinStrings(',')+']'), + pair(|$name == 'aggColSpecArray' || $name == 'aggColSpecArray2', | '~['+$functionExpression.parametersValues->at(0)->cast(@InstanceValue).values->cast(@FunctionExpression)->map(z|printColSpec($z, $configuration, $space))->joinStrings(',')+']'), + pair(|$name == 'funcColSpecArray' || $name == 'funcColSpecArray2', | '~['+$functionExpression.parametersValues->at(0)->cast(@InstanceValue).values->cast(@FunctionExpression)->map(z|printColSpec($z, $configuration, $space))->joinStrings(',')+']'), + pair(|!$special->get($name)->isEmpty(),|let vals = if ($name->in(['plus', 'minus', 'times']), + |$functionExpression.parametersValues->match([ + i:InstanceValue[1] | $i.values, + v:ValueSpecification[1] | $v + ]), + |$functionExpression.parametersValues + ); + if ([ + pair(|$name == 'divide' && $vals->size() == 3, | $name + $functionExpression.parametersValues->map(vs | printValueSpecification($vs, $configuration, $space))->joinStrings('(', ', ', ')')), + pair(|$name == 'minus' && $vals->size() == 1, | $special->get($name)->toOne() + $functionExpression.parametersValues->at(0)->printValueSpecification($configuration, $space)), + pair(|$vals->size() == 1 && $vals->at(0)->instanceOf(VariableExpression), | $functionExpression.parametersValues->at(0)->printValueSpecification($configuration, $space)+'->'+$name+'()'), + pair(|$name->in(['and', 'or']) && $vals->size() == 1, |$name + '(' + $vals->at(0)->printValueSpecification($configuration, $space) + ')'), + pair(|$vals->size() > 1, |'(' + $vals->at(0)->printValueSpecification($configuration, $space) + ' ' + $vals->tail()->map(x| $special->get($name)->toOne() + ' ' + $x->printValueSpecification($configuration, $space))->joinStrings(' ') + ')') + ], + |$special->get($name)->toOne()+'('+$vals->at(0)->printValueSpecification($configuration, $space)+')' + ); + ) + + ], + |let firstParam = $functionExpression.parametersValues->head()->toOne(); + if(forceArrow()->contains($name) || + !( + ($firstParam->instanceOf(SimpleFunctionExpression) && $firstParam->cast(@SimpleFunctionExpression).functionName->isNotEmpty() && $special->get($firstParam->cast(@SimpleFunctionExpression).functionName->toOne())->isNotEmpty()) || + ($firstParam->instanceOf(FunctionExpression) && $firstParam->cast(@FunctionExpression).func.functionName->isNotEmpty() && $special->get($firstParam->cast(@FunctionExpression).func.functionName->toOne())->isNotEmpty()) + ) , + | let element = $functionExpression.parametersValues->head()->toOne(); + let t_element = $element->printValueSpecification($configuration, $space); + if ($element->instanceOf(FunctionExpression) && $element->cast(@FunctionExpression).func->in([minus_Integer_MANY__Integer_1_,plus_Integer_MANY__Integer_1_]), + |'('+$t_element+')', + | $t_element + ) + '->' + if($functionExpression.func.functionName->isEmpty(),|'UNKNOWN',|if($configuration->isNotEmpty() && $configuration->toOne().fullPath, |$functionExpression.func->cast(@PackageableElement).package->toOne()->elementToPath()+'::',|'')+$functionExpression.func.functionName->toOne()) + $functionExpression.parametersValues->tail()->map(vs | printValueSpecification($vs, $configuration, $space))->joinStrings('(', ', ', ')');, + | if($configuration->isNotEmpty() && $configuration->toOne().fullPath, |$functionExpression.func->cast(@PackageableElement).package->toOne()->elementToPath()+'::',|'')+$functionExpression.func.functionName->toOne() + $functionExpression.parametersValues->map(vs | printValueSpecification($vs, $configuration, $space))->joinStrings('(', ', ', ')'); + ); ); } -function meta::pure::metamodel::serialization::grammar::printProperty(p:Property[1], o:ValueSpecification[1], space:String[1]):String[1] +function meta::pure::metamodel::serialization::grammar::printProperty(p:Property[1], o:ValueSpecification[1], configuration:Configuration[0..1], space:String[1]):String[1] { - $o->printValueSpecification($space) + '.' + $p.name->toOne(); + $o->printValueSpecification($configuration, $space) + '.' + $p.name->toOne(); } -function meta::pure::metamodel::serialization::grammar::printColumn(c:Column[1], o:ValueSpecification[1], space:String[1]):String[1] +function meta::pure::metamodel::serialization::grammar::printColumn(c:Column[1], o:ValueSpecification[1], configuration:Configuration[0..1], space:String[1]):String[1] { - $c.name->toOne(); + $o->printValueSpecification($configuration, $space) + '.' + $c.name->toOne(); } -function meta::pure::metamodel::serialization::grammar::printProperty(p:QualifiedProperty[1], params:ValueSpecification[*], space:String[1]):String[1] +function meta::pure::metamodel::serialization::grammar::printProperty(p:QualifiedProperty[1], params:ValueSpecification[*], configuration:Configuration[0..1], space:String[1]):String[1] { - $params->at(0)->printValueSpecification($space) + '.' + $p.name->toOne() + '(%s)'->format($params->tail()->map(x | $x->printValueSpecification($space))->joinStrings(', ')); + $params->at(0)->printValueSpecification($configuration, $space) + '.' + $p.name->toOne() + '(%s)'->format($params->tail()->map(x | $x->printValueSpecification($configuration, $space))->joinStrings(', ')); } function <> meta::pure::metamodel::serialization::grammar::printStatements(statements:String[*]):String[1] @@ -214,7 +274,7 @@ function meta::pure::metamodel::serialization::grammar::printConstraint(constrai assert($constraint.name->size() == 1, 'Constraints should have a name.'); assert($constraint.functionDefinition.expressionSequence->size() == 1, 'Constraints can only have a single expression.'); - let expressions = printFunctionDefinitionExpressions($constraint.functionDefinition, '')->toOne(); + let expressions = printFunctionDefinitionExpressions($constraint.functionDefinition, [], '')->toOne(); $constraint.name->toOne()+' : '+$expressions; } diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/treepath/treePath.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/treepath/treePath.pure index b109ce35315..ada7c0f8a92 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/treepath/treePath.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/treepath/treePath.pure @@ -28,11 +28,11 @@ function meta::pure::metamodel::treepath::buildPropertyPathTree(dfts:LambdaFu $threads->mergePropertyPaths(); } -function meta::pure::metamodel::treepath::removeAutomap(v:ValueSpecification[1]):ValueSpecification[1] +function meta::pure::metamodel::treepath::tp_removeAutomap(v:ValueSpecification[1]):ValueSpecification[1] { $v->match([fe:FunctionExpression[1] | if($fe.functionName=='map',| let left = $fe.parametersValues->at(0); let prop = $fe.parametersValues->at(1)->cast(@InstanceValue).values->at(0)->cast(@LambdaFunction).expressionSequence->at(0)->cast(@FunctionExpression); - let leftUnMapped = $left->removeAutomap(); + let leftUnMapped = $left->tp_removeAutomap(); ^$prop(parametersValues=$leftUnMapped); ,| $fe);, v:ValueSpecification[1] | $v]); @@ -43,7 +43,7 @@ function <> meta::pure::metamodel::treepath::buildPropertyPath(v $vs->evaluateAndDeactivate() ->match([ r:RoutedValueSpecification[1] | $r.value->buildPropertyPath($child), v:VariableExpression[1] | if($child->isNotEmpty(),|$child->toOne(),|assert(false,'Unsupported Deep Fetch Path');^PropertyPathTreeNode();), - fe:FunctionExpression[1] | let unMappedFe = $fe->removeAutomap()->cast(@FunctionExpression); + fe:FunctionExpression[1] | let unMappedFe = $fe->tp_removeAutomap()->cast(@FunctionExpression); let property = $unMappedFe.func->cast(@AbstractProperty); let parent = ^PropertyPathTreeNode(property=$property, childrenData=$child); $unMappedFe.parametersValues->map(p|$p->buildPropertyPath($parent))->toOne(); diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/ascending.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/ascending.pure new file mode 100644 index 00000000000..e6436a71671 --- /dev/null +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/ascending.pure @@ -0,0 +1,22 @@ +// Copyright 2024 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. + +import meta::pure::test::pct::*; +import meta::pure::metamodel::relation::*; + +function <> meta::pure::functions::relation::ascending (column:ColSpec[1]):SortInfo[1] +{ + ^SortInfo(column=$column, direction=SortType.ASC) +} \ No newline at end of file diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/descending.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/descending.pure new file mode 100644 index 00000000000..d96bf7f48c1 --- /dev/null +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/descending.pure @@ -0,0 +1,22 @@ +// Copyright 2024 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. + +import meta::pure::test::pct::*; +import meta::pure::metamodel::relation::*; + +function <> meta::pure::functions::relation::descending(column:ColSpec[1]):SortInfo[1] +{ + ^SortInfo(column=$column, direction=SortType.DESC) +} \ No newline at end of file diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/sort.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/sort.pure index 6eb1644572b..5850108e348 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/sort.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/order/sort.pure @@ -15,16 +15,6 @@ import meta::pure::test::pct::*; import meta::pure::metamodel::relation::*; -function <> meta::pure::functions::relation::descending(column:ColSpec[1]):SortInfo[1] -{ - ^SortInfo(column=$column, direction=SortType.DESC) -} - -function <> meta::pure::functions::relation::ascending (column:ColSpec[1]):SortInfo[1] -{ - ^SortInfo(column=$column, direction=SortType.ASC) -} - native function <> meta::pure::functions::relation::sort(rel:Relation[1], sortInfo:SortInfo[*]):Relation[1]; diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/slice/lag.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/slice/lag.pure index ef6eac81d6e..70e5bf51cdf 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/slice/lag.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/slice/lag.pure @@ -16,12 +16,14 @@ import meta::pure::test::pct::*; import meta::pure::metamodel::relation::*; import meta::pure::functions::relation::*; -function <> meta::pure::functions::relation::lag(w:Relation[1],r:T[1]):T[0..1] +function <> meta::pure::functions::relation::lag(w:Relation[1],r:T[1]):T[0..1] { lag($w, $r, 1); } -function <> meta::pure::functions::relation::lag(w:Relation[1],r:T[1], offset:Integer[1]):T[0..1] +function <> meta::pure::functions::relation::lag(w:Relation[1],r:T[1], offset:Integer[1]):T[0..1] { offset($w, $r, -$offset); } diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/slice/lead.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/slice/lead.pure index c7353efd147..48ba9537a68 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/slice/lead.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/slice/lead.pure @@ -16,12 +16,14 @@ import meta::pure::test::pct::*; import meta::pure::metamodel::relation::*; import meta::pure::functions::relation::*; -function <> meta::pure::functions::relation::lead(w:Relation[1],r:T[1]):T[0..1] +function <> meta::pure::functions::relation::lead(w:Relation[1],r:T[1]):T[0..1] { lead($w, $r, 1) } -function <> meta::pure::functions::relation::lead(w:Relation[1],r:T[1], offset:Integer[1]):T[0..1] +function <> meta::pure::functions::relation::lead(w:Relation[1],r:T[1], offset:Integer[1]):T[0..1] { offset($w, $r, $offset); } diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/transformation/extend.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/transformation/extend.pure index 89bd6cc6044..43e670cef46 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/transformation/extend.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-functions-relation/legend-engine-pure-functions-relation-pure/src/main/resources/core_functions_relation/relation/functions/transformation/extend.pure @@ -417,43 +417,6 @@ function <> meta::pure::functions::relation::tests::extend::testOLAPAg '#', $res->sort([~grp->ascending(), ~id->descending()])->toString()); } - -function <> meta::pure::functions::relation::tests::extend::testOLAPWithPartitionAndOrderLastWindow(f:Function<{Function<{->T[m]}>[1]->T[m]}>[1]):Boolean[1] -{ - let expr = { - | #TDS - id, grp, name - 1, 2, A - 2, 1, B - 3, 3, C - 4, 4, D - 5, 2, E - 6, 1, F - 7, 3, G - 8, 1, H - 9, 5, I - 10, 0, J - #->extend(over(~grp, ~id->descending()), ~newCol:{p,w,r|$p->last($w, $r).id}) - }; - - - let res = $f->eval($expr); - - assertEquals( '#TDS\n'+ - ' id,grp,name,newCol\n'+ - ' 10,0,J,10\n'+ - ' 8,1,H,8\n'+ - ' 6,1,F,6\n'+ - ' 2,1,B,2\n'+ - ' 5,2,E,5\n'+ - ' 1,2,A,1\n'+ - ' 7,3,G,7\n'+ - ' 3,3,C,3\n'+ - ' 4,4,D,4\n'+ - ' 9,5,I,9\n'+ - '#', $res->sort([~grp->ascending(), ~id->descending()])->toString()); -} - function <> meta::pure::functions::relation::tests::extend::testOLAPWithPartitionAndOrderWindowMultipleColumns(f:Function<{Function<{->T[m]}>[1]->T[m]}>[1]):Boolean[1] { let expr = { diff --git a/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/pom.xml b/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/pom.xml index 96db62b6e6f..6f69ecd5c7f 100644 --- a/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/pom.xml +++ b/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/pom.xml @@ -166,6 +166,25 @@ runtime + + org.finos.legend.engine + legend-engine-xt-relationalStore-snowflake-PCT + runtime + + + + org.finos.legend.engine + legend-engine-shared-vault-core + + + org.finos.legend.engine + legend-engine-shared-vault-aws + + + software.amazon.awssdk + regions + + org.finos.legend.engine legend-engine-pure-runtime-java-extension-compiled-functions-pureExtensions diff --git a/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/java/org/finos/legend/engine/ide/PureIDEServer.java b/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/java/org/finos/legend/engine/ide/PureIDEServer.java index 196ad4c4984..e88af292e41 100644 --- a/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/java/org/finos/legend/engine/ide/PureIDEServer.java +++ b/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/java/org/finos/legend/engine/ide/PureIDEServer.java @@ -39,11 +39,14 @@ import org.finos.legend.engine.ide.api.find.FindTextPreview; import org.finos.legend.engine.ide.api.source.UpdateSource; import org.finos.legend.engine.ide.session.PureSession; +import org.finos.legend.engine.shared.core.vault.Vault; +import org.finos.legend.engine.shared.core.vault.aws.AWSVaultImplementation; import org.finos.legend.pure.m3.serialization.filesystem.repository.CodeRepository; import org.finos.legend.pure.m3.serialization.filesystem.repository.CodeRepositoryProviderHelper; import org.finos.legend.pure.m3.serialization.filesystem.repository.CodeRepositorySet; import org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.RepositoryCodeStorage; import org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.classpath.ClassLoaderCodeStorage; +import software.amazon.awssdk.regions.Region; import javax.servlet.DispatcherType; import javax.servlet.FilterRegistration; @@ -58,6 +61,18 @@ public abstract class PureIDEServer extends Application @Override public void initialize(Bootstrap bootstrap) { + if (System.getProperty("env.AWS_ACCESS_KEY_ID") != null && System.getProperty("env.AWS_SECRET_ACCESS_KEY") != null) + { + Vault.INSTANCE.registerImplementation( + new AWSVaultImplementation( + System.getProperty("env.AWS_ACCESS_KEY_ID"), + System.getProperty("env.AWS_SECRET_ACCESS_KEY"), + Region.US_EAST_1, + "snowflake.INTEGRATION_USER1" + ) + ); + } + bootstrap.addBundle(new SwaggerBundle() { @Override diff --git a/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/java/org/finos/legend/engine/ide/api/execution/go/GoRun.java b/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/java/org/finos/legend/engine/ide/api/execution/go/GoRun.java index 9b96fe7f8b8..31572b2ca5d 100644 --- a/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/java/org/finos/legend/engine/ide/api/execution/go/GoRun.java +++ b/legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/java/org/finos/legend/engine/ide/api/execution/go/GoRun.java @@ -62,6 +62,7 @@ public void run(PureSession pureSession, JSONObject extraParams, JSONArray modif } catch (Exception ex) { + ex.printStackTrace(); IDEResponse exceptionResponse = ExceptionTranslation.buildExceptionMessage(pureSession, ex, new ByteArrayOutputStream()); outputStream.write(JSONValue.escape("\n" + exceptionResponse.getText()).getBytes()); outputStream.write("\"".getBytes()); diff --git a/legend-engine-pure/legend-engine-pure-runtime/legend-engine-pure-runtime-legendCompiler/legend-engine-pure-runtime-java-extension-interpreted-functions-legendCompiler/src/main/java/org/finos/legend/engine/pure/runtime/compiler/interpreted/natives/LegendCompileMixedProcessorSupport.java b/legend-engine-pure/legend-engine-pure-runtime/legend-engine-pure-runtime-legendCompiler/legend-engine-pure-runtime-java-extension-interpreted-functions-legendCompiler/src/main/java/org/finos/legend/engine/pure/runtime/compiler/interpreted/natives/LegendCompileMixedProcessorSupport.java index 88dc8d987a5..e4eca0365d9 100644 --- a/legend-engine-pure/legend-engine-pure-runtime/legend-engine-pure-runtime-legendCompiler/legend-engine-pure-runtime-java-extension-interpreted-functions-legendCompiler/src/main/java/org/finos/legend/engine/pure/runtime/compiler/interpreted/natives/LegendCompileMixedProcessorSupport.java +++ b/legend-engine-pure/legend-engine-pure-runtime/legend-engine-pure-runtime-legendCompiler/legend-engine-pure-runtime-java-extension-interpreted-functions-legendCompiler/src/main/java/org/finos/legend/engine/pure/runtime/compiler/interpreted/natives/LegendCompileMixedProcessorSupport.java @@ -23,6 +23,7 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType; import org.finos.legend.pure.m3.navigation.*; +import org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement; import org.finos.legend.pure.m3.navigation._package._Package; import org.finos.legend.pure.m4.ModelRepository; import org.finos.legend.pure.m4.coreinstance.CoreInstance; @@ -63,6 +64,7 @@ public CoreInstance getClassifier(CoreInstance instance) } } } + CoreInstance classifier = instance.getClassifier(); if (classifier == null && instance instanceof GenericType) @@ -95,6 +97,16 @@ else if (value instanceof PureMap) map.getMap().forEachKeyValue((k, v) -> target.put(this.convertCompileToInterpretedCoreInstance(ValCoreInstance.toCoreInstance(k)), this.convertCompileToInterpretedCoreInstance(ValCoreInstance.toCoreInstance(v)))); return mapCoreInstance; } + else if (value instanceof AbstractCompiledCoreInstance) + { + CoreInstance classifier = ((CoreInstance) value).getClassifier(); + CoreInstance fetched = this.package_getByUserPath(PackageableElement.getUserPathForPackageableElement((CoreInstance) value, "::")); + if (classifier != null && (classifier.getName().equals("Class") || classifier.getName().equals("NativeFunction") || classifier.getName().equals("PrimitiveType"))) + { + return fetched == null ? (CoreInstance) value : fetched; + } + return (CoreInstance) value; + } else { return (CoreInstance) value; @@ -121,12 +133,31 @@ public CoreInstance instance_getValueForMetaPropertyToOneResolved(CoreInstance o if (owner instanceof AbstractCompiledCoreInstance) { CoreInstance classifier = this.getClassifier(owner); + + // Avoid circular loop while fetching inheritance + if (classifier.getName().equals("Generalization") && "general".equals(property) || + classifier.getName().equals("Property") && "genericType".equals(property) || + classifier.getName().equals("GenericType") && "rawType".equals(property) + ) + { + return super.instance_getValueForMetaPropertyToOneResolved(owner, property); + } + CoreInstance prop = this.class_findPropertyUsingGeneralization(classifier, property); if (prop != null) { - CoreInstance genericType = Instance.getValueForMetaPropertyToOneResolved(prop, M3Properties.genericType, this); - CoreInstance type = Instance.getValueForMetaPropertyToOneResolved(genericType, M3Properties.rawType, this); + CoreInstance genericType = prop.getValueForMetaPropertyToOne(M3Properties.genericType); + if (!org.finos.legend.pure.m3.navigation.generictype.GenericType.isGenericTypeConcrete(genericType)) + { + CoreInstance classifierGenericType = owner.getValueForMetaPropertyToOne(M3Properties.classifierGenericType); + if (classifierGenericType != null) + { + genericType = org.finos.legend.pure.m3.navigation.generictype.GenericType.resolvePropertyReturnType(classifierGenericType, prop, this); + } + } + CoreInstance type = genericType.getValueForMetaPropertyToOne(M3Properties.rawType); + CoreInstance mapType = _Package.getByUserPath(M3Paths.Map, this); if (this.type_subTypeOf(type, mapType)) diff --git a/legend-engine-xts-data-space/legend-engine-xt-data-space-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/DataSpaceCompilerExtension.java b/legend-engine-xts-data-space/legend-engine-xt-data-space-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/DataSpaceCompilerExtension.java index 8909f176e52..c1b241ea10d 100644 --- a/legend-engine-xts-data-space/legend-engine-xt-data-space-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/DataSpaceCompilerExtension.java +++ b/legend-engine-xts-data-space/legend-engine-xt-data-space-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/DataSpaceCompilerExtension.java @@ -406,7 +406,7 @@ public Listlegend-engine-xt-relationalStore-pure ${project.version} + + org.finos.legend.engine + legend-engine-pure-functions-legendCompiler-pure + ${project.version} + diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-functions-relationalStore-PCT-pure/src/main/resources/core_external_test_connection.definition.json b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-functions-relationalStore-PCT-pure/src/main/resources/core_external_test_connection.definition.json index 0847421c04e..8eea5def446 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-functions-relationalStore-PCT-pure/src/main/resources/core_external_test_connection.definition.json +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-functions-relationalStore-PCT-pure/src/main/resources/core_external_test_connection.definition.json @@ -7,6 +7,7 @@ "platform_dsl_store", "platform_dsl_tds", "platform_store_relational", + "core_external_compiler", "core_functions_relation", "core_functions_json", "core", diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-functions-relationalStore-PCT-pure/src/main/resources/core_external_test_connection/pct_relational.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-functions-relationalStore-PCT-pure/src/main/resources/core_external_test_connection/pct_relational.pure index 2d592a86249..fc8dcaa7654 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-functions-relationalStore-PCT-pure/src/main/resources/core_external_test_connection/pct_relational.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-functions-relationalStore-PCT-pure/src/main/resources/core_external_test_connection/pct_relational.pure @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +import meta::relational::tests::pct::*; +import meta::json::*; +import meta::relational::mapping::*; +import meta::relational::metamodel::datatype::*; import meta::relational::functions::sqlQueryToString::*; import meta::relational::metamodel::execute::*; import meta::relational::metamodel::relation::*; @@ -57,11 +61,22 @@ function <> meta::relational::tests::pct::testAdapterForRelationalW ) } +function meta::relational::tests::pct::extractDependentFunctions(f:Any[1]):Function[*] +{ + $f->match([ + z:FunctionDefinition[1]|$z.expressionSequence->evaluateAndDeactivate()->map(x|$x->extractDependentFunctions()), + x:SimpleFunctionExpression[1]|let res = $x.parametersValues->map(p|$p->extractDependentFunctions()); + $res->concatenate(if(!$x.func->hasStereotype('function', PCT),|$x.func,|[]));, + a:Any[1]|[] + ]); +} + function meta::relational::tests::pct::testAdapterForRelationalExecution(f:Function<{->X[o]}>[1], dbc:meta::external::store::relational::runtime::DatabaseConnection[1]):X[o] { let debug = noDebug(); - let newFunction = $f->meta::relational::tests::pct::process::reprocess($dbc, $debug).first; + let repocessed = $f->meta::relational::tests::pct::process::reprocess($dbc, $debug); + let newFunction = $repocessed.first; let extensions = meta::relational::extension::relationalExtensions(); @@ -79,42 +94,47 @@ function meta::relational::tests::pct::testAdapterForRelationalExecution(f: print(if($debug.debug,|'\nResult JSON:\n'+$x+'\n',|'')); // ---- - - let res = $x->meta::json::parseJSON()->meta::json::fromJSON(meta::protocols::pure::vX_X_X::metamodel::invocation::execution::execute::RelationalTDSResult, ^meta::json::ExtendedJSONDeserializationConfig(typeKeyName='__TYPE', failOnUnknownProperties=true, nullReplacementInArray=TDSNull))->cast(@meta::protocols::pure::vX_X_X::metamodel::invocation::execution::execute::RelationalTDSResult); - - // processResult - let resultType = $f->functionReturnType().rawType; - - if ($resultType->toOne()->instanceOf(PrimitiveType), - | let preResultFinal = $res.result.rows->at(0).values->at(0); - let resultFinal = - if ([ - pair(|$resultType->toOne()->subTypeOf(Date), |buildDate($preResultFinal->toString())), - pair(|$resultType->toOne()->subTypeOf(Decimal), |$preResultFinal->cast(@Number)->toDecimal()), - pair(|$resultType->toOne()->subTypeOf(Integer), |$preResultFinal->cast(@Number)->round()), - pair(|$resultType->toOne()->subTypeOf(Float), |$preResultFinal->cast(@Number)->toFloat()) - ], - | $preResultFinal->toOne() - ); - print(if($debug.debug,|'\nResult Final:\n'+$resultFinal->makeString(','),|'')); - $resultFinal;, - | let tdsString = $res.result.columns->joinStrings(',') + '\n' + - $res.result.rows->map(x| - range($x.values->size())->map(z | if($x.values->at($z) == TDSNull, - |let type = $res.builder->cast(@meta::protocols::pure::vX_X_X::metamodel::invocation::execution::execute::TDSBuilder).columns->at($z).type; - if ([ - pair(|$type == 'Integer', |-2147483648), - pair(|$type == 'String', |'null') - ], - |fail();0; - );, - |$x.values->at($z) - ) - )->makeString(',') - )->joinStrings('\n'); - let resultFinal = $tdsString->stringToTDS(); - print(if($debug.debug,|'\nResult Final:\n'+$resultFinal->toString(),|'')); - $resultFinal; + + let json = $x->meta::json::parseJSON(); + + if ($json->cast(@JSONObject).keyValuePairs->filter(k|$k.key.value=='result').value->isEmpty(), + | let res = $json->meta::json::fromJSON(meta::protocols::pure::vX_X_X::metamodel::invocation::execution::execute::RelationalClassResult, ^meta::json::ExtendedJSONDeserializationConfig(typeKeyName='__TYPE', failOnUnknownProperties=true, nullReplacementInArray=TDSNull))->cast(@meta::protocols::pure::vX_X_X::metamodel::invocation::execution::execute::RelationalClassResult)->toOne(); + let x= meta::protocols::pure::vX_X_X::invocation::execution::execute::processRelationalClassResult($res, $repocessed.second.mapping->toOne(), $repocessed.second.runtime, [], $extensions); + $x.first.values;, + | let res = $json->meta::json::fromJSON(meta::protocols::pure::vX_X_X::metamodel::invocation::execution::execute::RelationalTDSResult, ^meta::json::ExtendedJSONDeserializationConfig(typeKeyName='__TYPE', failOnUnknownProperties=true, nullReplacementInArray=TDSNull))->cast(@meta::protocols::pure::vX_X_X::metamodel::invocation::execution::execute::RelationalTDSResult)->toOne(); + // processResult + let resultType = $f->functionReturnType().rawType; + if ($resultType->toOne()->instanceOf(PrimitiveType), + | let preResultFinal = $res.result.rows->at(0).values->at(0); + let resultFinal = + if ([ + pair(|$resultType->toOne()->subTypeOf(Date), |buildDate($preResultFinal->toString())), + pair(|$resultType->toOne()->subTypeOf(Decimal), |$preResultFinal->cast(@Number)->toDecimal()), + pair(|$resultType->toOne()->subTypeOf(Integer), |$preResultFinal->cast(@Number)->round()), + pair(|$resultType->toOne()->subTypeOf(Float), |$preResultFinal->cast(@Number)->toFloat()) + ], + | $preResultFinal->toOne() + ); + print(if($debug.debug,|'\nResult Final:\n'+$resultFinal->makeString(','),|'')); + $resultFinal;, + | let tdsString = $res.result.columns->joinStrings(',') + '\n' + + $res.result.rows->map(x| + range($x.values->size())->map(z | if($x.values->at($z) == TDSNull, + |let type = $res.builder->cast(@meta::protocols::pure::vX_X_X::metamodel::invocation::execution::execute::TDSBuilder).columns->at($z).type; + if ([ + pair(|$type == 'Integer', |-2147483648), + pair(|$type == 'String', |'null') + ], + |fail();0; + );, + |$x.values->at($z) + ) + )->makeString(',') + )->joinStrings('\n'); + let resultFinal = $tdsString->stringToTDS(); + print(if($debug.debug,|'\nResult Final:\n'+$resultFinal->toString(),|'')); + $resultFinal; + ); )->cast(@X)->toMultiplicity(@[o]); } @@ -152,12 +172,111 @@ function meta::relational::tests::pct::process::buildDate(dateStr:String[1]):Dat meta::pure::functions::string::parseDate($_strict); } -function meta::relational::tests::pct::process::reprocess(f:Function<{->Any[*]}>[1], dbc:meta::external::store::relational::runtime::DatabaseConnection[1], debug: DebugContext[1]):PairAny[*]}>,ProcessingState>[1] +function meta::relational::tests::pct::process::printDatabase(d:Database[1]):String[1] +{ + 'Database '+$d->elementToPath()+ + '('+ + $d.schemas->map( + s | 'Schema '+$s.name + '('+ $s.tables->map(x| + 'Table '+$x.name+'('+ + $x.columns->map(z|let c = $z->cast(@meta::relational::metamodel::Column); + if($c.name->contains(' '),|'"'+$c.name+'"',|$c.name) + ' ' + $c.type->match([ + x : Varchar[1] | 'VARCHAR('+$x.size->toString()+')', + z : Any[1] | $z->type().name->toOne() + ] + ) + if ($x.primaryKey->contains($c),|' PRIMARY KEY',|''); + )->joinStrings(',')+ + ')' + )->joinStrings(' ') + ')' + )->joinStrings(';')+ + $d.joins->map( + j | 'Join '+$j.name+'('+$j.operation->printRelationalOperationElement(false)+')' + )->joinStrings(' ')+ + ')'; +} + +function meta::relational::tests::pct::process::printMapping(d:Mapping[1]):String[1] +{ + 'Mapping '+$d->elementToPath()+ + '('+ + $d.classMappings->map(si| + $si.class->elementToPath() + '['+$si.id+']:' + $si->match( + [ + rs:RootRelationalInstanceSetImplementation[1] | 'Relational {'+ + $rs.propertyMappings->cast(@RelationalPropertyMapping)->map(pm| + $pm.property.name->toOne() + if($pm.targetSetImplementationId == '',|'',|'['+$pm.targetSetImplementationId+']') + ':'+$pm.relationalOperationElement->printRelationalOperationElement(true))->joinStrings(', ') + +'}' + ] + ) + )->joinStrings(' ')+ + ')'; +} + +function meta::relational::tests::pct::process::printRelationalOperationElement(d:RelationalOperationElement[1], forMapping:Boolean[1]):String[1] +{ + $d->match( + [ + t:TableAliasColumn[1]|if($forMapping,|'['+$t.alias.database->toOne()->elementToPath()+']',|'')+$t.alias.relationalElement->cast(@Table).schema.name->toOne()+'.'+$t.alias.relationalElement->cast(@Table).name+'.'+$t.column.name, + x:RelationalOperationElementWithJoin[1]|'['+$x.joinTreeNode.database->toOne()->elementToPath()+']@'+$x.joinTreeNode.joinName->toOne(), + v:DynaFunction[1]|$v.name + '('+$v.parameters->map(p|$p->printRelationalOperationElement($forMapping))->joinStrings(',')+')' + ] + ) +} + +function meta::relational::tests::pct::process::reprocess(connection:meta::external::store::relational::runtime::RelationalDatabaseConnection[1]):String[1] +{ + '^meta::external::store::relational::runtime::RelationalDatabaseConnection('+ + 'type='+$connection.type->meta::pure::metamodel::serialization::grammar::printValueSpecification([], '')+','+ + 'authenticationStrategy = '+$connection.authenticationStrategy->printNew()+','+ //^meta::pure::alloy::connections::alloy::authentication::TestDatabaseAuthenticationStrategy(),'+ + 'datasourceSpecification = '+$connection.datasourceSpecification->printNew()+ //^meta::pure::alloy::connections::alloy::specification::DuckDBDatasourceSpecification(path = \'\')'+ + ')' +} + +function meta::relational::tests::pct::process::printNew(a:Any[1]):String[1] { + $a->match( + [ + i:Integer[1] | $i->toString(), + x:String[1] | '\''+$x+'\'', + a:Any[1] | + let _type = $a->type()->cast(@Class); + let properties = $_type->meta::pure::functions::meta::hierarchicalProperties(); + '^'+$a->type()->elementToPath()+'('+ + $properties->map(p| let value = $p->eval($a); + if ($value->isEmpty(), + |'', + |$p.name->toOne() + '=' + $value->map(w|$w->printNew())->joinStrings(',') + ); + )->filter(v|$v != '')->joinStrings(',')+ + ')'; + ] + ); +} + +function meta::relational::tests::pct::process::reprocess(f:Function[1], dbc:meta::external::store::relational::runtime::DatabaseConnection[1], debug: DebugContext[1]):Pair,ProcessingState>[1] +{ + let otherFuncs = $f->cast(@FunctionDefinition)->meta::relational::tests::pct::extractDependentFunctions(); + + let ext = ^meta::pure::metamodel::serialization::grammar::Configuration + ( + fullPath = true, + extensions = ^meta::pure::metamodel::serialization::grammar::GrammarExtension( + extraConnectionHandlers = + [ + x:RelationalDatabaseConnection[0..1] | + $x->toOne()->reprocess(); + ], + extraInstanceValueHandlers = + [ + x:RelationStoreAccessor[1]|'#>{'+$x.store->elementToPath()+'.'+$x.sourceElement->cast(@Table).name->toOne()+'}#', + t:meta::pure::metamodel::relation::TDS[1]|'#TDS\n'+$t.csv->replace(' ','')+'#' + ] + ) + ); $f->match( [ - z:FunctionDefinition<{->Any[*]}>[1]| - print(if($debug.debug,|'BEFORE: ' + meta::pure::metamodel::serialization::grammar::printFunctionDefinition($z, '')+'\n',|'')); + z:FunctionDefinition[1]| + print(if($debug.debug,|'BEFORE: ' + meta::pure::metamodel::serialization::grammar::printFunctionDefinition($z, $ext, '')+'\n',|'')); // Init let initState = meta::relational::tests::pct::process::initState( @@ -207,7 +326,7 @@ function meta::relational::tests::pct::process::reprocess(f:Function<{->Any[*]}> ) ); - print(if($debug.debug,|'AFTER: ' + meta::pure::metamodel::serialization::grammar::printFunctionDefinition($newFunction, '') + '\n',|'')); + print(if($debug.debug,|'AFTER: ' + meta::pure::metamodel::serialization::grammar::printFunctionDefinition($newFunction, $ext, '') + '\n',|'')); // Update the database ------------ let setUpSQLs = $reprocessed.csvs->joinStrings('\n-\n')->meta::alloy::service::execution::setUpDataSQLs($reprocessed.database->toOne(), $dbc.type); @@ -232,7 +351,28 @@ function meta::relational::tests::pct::process::reprocess(f:Function<{->Any[*]}> meta::legend::executePlanAsJSON($planAsJson, []); // Update the database ------------ - pair($newFunction, $reprocessed->toOne()); + let code = '\n###Relational\n'+ + $reprocessed.database->toOne()->printDatabase()+ + if ($reprocessed.mapping->isEmpty(), + |'', + |'\n###Mapping\n' + + $reprocessed.mapping->toOne()->printMapping() + )+ + '\n###Pure\n'+ + $otherFuncs->filter(x|$x->instanceOf(FunctionDefinition))->map(o|'function '+$o->cast(@PackageableElement).package->toOne()->elementToPath()+'::'+$o->cast(@FunctionDefinition)->meta::pure::metamodel::serialization::grammar::printFunctionDefinition($ext, '');)->joinStrings('')+ + 'function test::lambdaContainer():Any[*]{\n'+ + ' '+meta::pure::metamodel::serialization::grammar::printFunctionDefinition($newFunction, $ext, '')+'\n'+ + '}' + ; + + //println($code); + + let alloyCompiled = meta::legend::compile($code)->filter(x|$x.name == 'lambdaContainer__Any_MANY_')->cast(@FunctionDefinition).expressionSequence->cast(@InstanceValue)->evaluateAndDeactivate().values->toOne()->cast(@FunctionDefinition); + + //println($alloyCompiled.expressionSequence->at(0)->cast(@FunctionExpression)->evaluateAndDeactivate().parametersValues); + + //pair($newFunction, $reprocessed->toOne()); + pair($alloyCompiled, $reprocessed->toOne()); ] ); } @@ -483,7 +623,8 @@ function meta::relational::tests::pct::process::classesToDatabase(values:Any[*], let state = ^$_state( mapping = ^Mapping ( - name = 'myMapping' + name = 'myMapping', + package = meta::relational::tests::pct::process ) ); @@ -494,7 +635,7 @@ function meta::relational::tests::pct::process::classesToDatabase(values:Any[*], | let allClasses = scanClass($rootType); // Build schema - let tables = $allClasses->map(c|$c->classToTable($state.schema, $state.mapping->toOne())); + let tables = $allClasses->map(c|$c->classToTable($state.database, $state.schema, $state.mapping->toOne())); let joins = $allClasses->map(c|$c->buildJoins($tables, $state.database)); $state.schema->mutateAdd('tables', $tables.table); @@ -567,14 +708,14 @@ Class meta::relational::tests::pct::process::PropertyColumnMapping column : Column[1]; } -function meta::relational::tests::pct::process::classToTable(class:Class[1], schema:Schema[1], mapping:Mapping[1]):ClassTableMapping[1] +function meta::relational::tests::pct::process::classToTable(class:Class[1], db:Database[1], schema:Schema[1], mapping:Mapping[1]):ClassTableMapping[1] { let map = meta::relational::transform::fromPure::pureTypeToDataTypeMap(); let properties = $class.properties->filter(p|$p->isPrimitiveValueProperty()); let cols = $properties->map(p|^PropertyColumnMapping(property=$p, column=^Column(name=$p.name->toOne(), type=$map->get($p->functionReturnType().rawType->toOne())->toOne()))); let idCol = ^Column(name='_pureId', type=^meta::relational::metamodel::datatype::Integer()); let table = ^Table(name=$class.name->toOne(), schema=$schema, primaryKey=$idCol, columns=$idCol->concatenate($cols.column)); - let tableAlias = ^TableAlias(name=$table.name, relationalElement = $table); + let tableAlias = ^TableAlias(database=$db, name=$table.name, relationalElement = $table); let set = ^RootRelationalInstanceSetImplementation @@ -636,8 +777,8 @@ function meta::relational::tests::pct::process::buildJoins(class:Class[1], let fkColumn = ^Column(name='_'+$class.name->toOne()+'_'+$p.name->toOne(), type=^meta::relational::metamodel::datatype::Integer()); let targetTable = $target.table; $targetTable->mutateAdd('columns', $fkColumn); - let srcAlias = ^TableAlias(name='src', relationalElement=$src.table); - let targetAlias = ^TableAlias(name=$targetTable.name, relationalElement=$targetTable); + let srcAlias = ^TableAlias(database=$db, name='src', relationalElement=$src.table); + let targetAlias = ^TableAlias(database=$db, name=$targetTable.name, relationalElement=$targetTable); let join = ^Join ( name = $class.name->toOne() + '_' + $p.name->toOne(), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-runtime-java-extension-compiled-functions-relationalStore-PCT/pom.xml b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-runtime-java-extension-compiled-functions-relationalStore-PCT/pom.xml index e2ee0251e8e..6f45e372750 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-runtime-java-extension-compiled-functions-relationalStore-PCT/pom.xml +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-PCT/legend-engine-pure-runtime-java-extension-compiled-functions-relationalStore-PCT/pom.xml @@ -75,6 +75,11 @@ legend-engine-xt-relationalStore-protocol ${project.version} + + org.finos.legend.engine + legend-engine-pure-runtime-java-extension-compiled-functions-legendCompiler + ${project.version} + @@ -117,6 +122,11 @@ legend-engine-pure-runtime-java-extension-compiled-functions-json + + org.finos.legend.engine + legend-engine-pure-runtime-java-extension-compiled-functions-legendCompiler + + org.finos.legend.engine legend-engine-pure-runtime-java-extension-compiled-functions-unclassified diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/duckdb/pct/Test_Relational_DuckDB_EssentialFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/duckdb/pct/Test_Relational_DuckDB_EssentialFunctions_PCT.java index a0377207461..ea9f80a5f33 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/duckdb/pct/Test_Relational_DuckDB_EssentialFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/duckdb/pct/Test_Relational_DuckDB_EssentialFunctions_PCT.java @@ -37,7 +37,7 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // Add - one("meta::pure::functions::collection::tests::add::testAddWithOffset_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'add_T_MANY__Integer_1__T_1__T_$1_MANY$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::add::testAddWithOffset_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), one("meta::pure::functions::collection::tests::add::testAdd_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'add_T_MANY__T_1__T_$1_MANY$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Concatenate @@ -46,14 +46,14 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::collection::tests::concatenate::testConcatenateTypeInference_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // Contains - one("meta::pure::functions::collection::tests::contains::testContainsNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::contains::testContainsPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::contains::testContainsWithFunction_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::contains::testContainsNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.CO_Firm (_pureId,legalName) values (10,'f1');"), + one("meta::pure::functions::collection::tests::contains::testContainsPrimitive_Function_1__Boolean_1_", "java.sql.SQLException: Conversion Error: Unimplemented type for cast (INTEGER -> DATE)\nLINE 1: select 1 in (1, 2, 5, 2, 'a', true, DATE '2014...\n ^"), + one("meta::pure::functions::collection::tests::contains::testContainsWithFunction_Function_1__Boolean_1_", "Error while executing: insert into leSchema.ClassWithoutEquality (_pureId,name) values (10,'f1');"), // Drop one("meta::pure::functions::collection::tests::drop::testDropExceedsSizeOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::drop::testDropExceedsSizeOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::drop::testDropInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::drop::testDropInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::drop::testDropManyOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::drop::testDropManyOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::drop::testDropNegativeOnEmptyList_Function_1__Boolean_1_", "\"Invalid type for parameter inside the drop function. Expected a value, found operation/function\""), @@ -64,30 +64,29 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::collection::tests::drop::testDropZeroOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // Exists - one("meta::pure::functions::collection::tests::exists::testExistsInSelect_Function_1__Boolean_1_", "\"Error mapping not found for class CO_Firm cache:''\""), - one("meta::pure::functions::collection::tests::exists::testExists_Function_1__Boolean_1_", "\"Error mapping not found for class CO_Firm cache:''\""), + one("meta::pure::functions::collection::tests::exists::testExists_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), // Find - one("meta::pure::functions::collection::tests::find::testFindInstance_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::find::testFindLiteralFromVar_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'find_T_MANY__Function_1__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::find::testFindLiteral_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'find_T_MANY__Function_1__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::find::testFindUsingVarForFunction_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::find::testFindInstance_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/collection/iteration/find.pure:38cc38-42); error compiling generated Java code:\nimport org.eclipse.collections.api.LazyIterable;\nimport org.eclipse.collections.api.block.function.Function0;\nimport org.eclipse.collections.api.block.function.Function;\nimport org.eclipse.collections.api.block.function.Function2;\nimport org.eclipse.collections.api.block.predicate.Predicate;\nimport org.eclipse.collections.api.block.procedure.Procedure;\nimport org.eclipse.collections.api.map.ImmutableMap;\nimport org.eclipse.collections.api.map.MutableMap;\nimport org.eclipse.collections.api.map.MutableMapIterable;\nimport org.eclipse.collections.api.map.MapIterable;\nimport org.eclipse.collections.api.map.primitive.IntObjectMap;\nimport org.eclipse.collections.api.set.MutableSet;\nimport org.eclipse.collections.api.set.SetIterable;\nimport org.eclipse.collections.api.list.MutableList;\nimport org.eclipse.collections.api.list.ListIterable;\nimport org.eclipse.collections.api.RichIterable;\nimport org.eclipse.collections.api.tuple.Pair;\nimport org.eclipse.collections.impl.factory.Lists;\nimport org.eclipse.collections.impl.factory.Maps;\nimport org.eclipse.collections.impl.map.mutable.UnifiedMap;\nimport org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy;\nimport org.eclipse.collections.impl.set.mutable.UnifiedSet;\nimport org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy;\nimport org.eclipse.collections.impl.list.mutable.FastList;\nimport org.eclipse.collections.impl.factory.Sets;\nimport org.eclipse.collections.impl.block.function.checked.CheckedFunction0;\nimport org.eclipse.collections.impl.utility.Iterate;\nimport org.eclipse.collections.impl.utility.LazyIterate;\nimport org.eclipse.collections.impl.utility.StringIterate;\nimport org.finos.legend.pure.m3.navigation.generictype.GenericType;\nimport org.finos.legend.pure.m3.navigation.ProcessorSupport;\nimport org.finos.legend.pure.m3.execution.ExecutionSupport;\nimport org.finos.legend.pure.m3.exception.PureExecutionException;\nimport org.finos.legend.pure.m4.coreinstance.CoreInstance;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.PureDate;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.DateFunctions;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.map.*;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangeType;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangedPath;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.Revision;\nimport org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement;\nimport org.finos.legend.pure.m3.tools.ListHelper;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.defended.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.sourceInformation.*;\nimport org.finos.legend.pure.runtime.java.compiled.serialization.model.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport java.lang.reflect.Method;\nimport java.math.BigInteger;\nimport java.sql.DatabaseMetaData;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSetMetaData;\nimport java.util.Iterator;\nimport java.util.Calendar;\nimport java.util.Map;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport org.json.simple.JSONObject;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type;\n\n\npublic class DynaClass{\n public static org.finos.legend.pure.generated.Root_meta_pure_functions_collection_tests_model_CO_Person doProcess(final MapIterable vars, final MutableMap valMap, final IntObjectMap localLambdas, final ExecutionSupport es){\n return _smith;\n }\n}\n"), + one("meta::pure::functions::collection::tests::find::testFindLiteralFromVar_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::find' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::find]"), + one("meta::pure::functions::collection::tests::find::testFindLiteral_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::find' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::find]"), + one("meta::pure::functions::collection::tests::find::testFindUsingVarForFunction_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/collection/iteration/find.pure:47cc38-42); error compiling generated Java code:\nimport org.eclipse.collections.api.LazyIterable;\nimport org.eclipse.collections.api.block.function.Function0;\nimport org.eclipse.collections.api.block.function.Function;\nimport org.eclipse.collections.api.block.function.Function2;\nimport org.eclipse.collections.api.block.predicate.Predicate;\nimport org.eclipse.collections.api.block.procedure.Procedure;\nimport org.eclipse.collections.api.map.ImmutableMap;\nimport org.eclipse.collections.api.map.MutableMap;\nimport org.eclipse.collections.api.map.MutableMapIterable;\nimport org.eclipse.collections.api.map.MapIterable;\nimport org.eclipse.collections.api.map.primitive.IntObjectMap;\nimport org.eclipse.collections.api.set.MutableSet;\nimport org.eclipse.collections.api.set.SetIterable;\nimport org.eclipse.collections.api.list.MutableList;\nimport org.eclipse.collections.api.list.ListIterable;\nimport org.eclipse.collections.api.RichIterable;\nimport org.eclipse.collections.api.tuple.Pair;\nimport org.eclipse.collections.impl.factory.Lists;\nimport org.eclipse.collections.impl.factory.Maps;\nimport org.eclipse.collections.impl.map.mutable.UnifiedMap;\nimport org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy;\nimport org.eclipse.collections.impl.set.mutable.UnifiedSet;\nimport org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy;\nimport org.eclipse.collections.impl.list.mutable.FastList;\nimport org.eclipse.collections.impl.factory.Sets;\nimport org.eclipse.collections.impl.block.function.checked.CheckedFunction0;\nimport org.eclipse.collections.impl.utility.Iterate;\nimport org.eclipse.collections.impl.utility.LazyIterate;\nimport org.eclipse.collections.impl.utility.StringIterate;\nimport org.finos.legend.pure.m3.navigation.generictype.GenericType;\nimport org.finos.legend.pure.m3.navigation.ProcessorSupport;\nimport org.finos.legend.pure.m3.execution.ExecutionSupport;\nimport org.finos.legend.pure.m3.exception.PureExecutionException;\nimport org.finos.legend.pure.m4.coreinstance.CoreInstance;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.PureDate;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.DateFunctions;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.map.*;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangeType;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangedPath;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.Revision;\nimport org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement;\nimport org.finos.legend.pure.m3.tools.ListHelper;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.defended.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.sourceInformation.*;\nimport org.finos.legend.pure.runtime.java.compiled.serialization.model.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport java.lang.reflect.Method;\nimport java.math.BigInteger;\nimport java.sql.DatabaseMetaData;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSetMetaData;\nimport java.util.Iterator;\nimport java.util.Calendar;\nimport java.util.Map;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport org.json.simple.JSONObject;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type;\n\n\npublic class DynaClass{\n public static org.finos.legend.pure.generated.Root_meta_pure_functions_collection_tests_model_CO_Person doProcess(final MapIterable vars, final MutableMap valMap, final IntObjectMap localLambdas, final ExecutionSupport es){\n return _smith;\n }\n}\n"), // Fold one("meta::pure::functions::collection::tests::fold::testFoldCollectionAccumulator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndEmptyIdentity_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndEmptyIdentity_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndNonEmptyIdentity_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldFiltering_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::fold::testFoldFiltering_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,'John','Roe',null);"), one("meta::pure::functions::collection::tests::fold::testFoldMixedAccumulatorTypes_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldToMany_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::fold::testFoldWithEmptyAccumulator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldWithSingleValue_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFold_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::fold::testFoldToMany_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,'John','Roe',null);"), + one("meta::pure::functions::collection::tests::fold::testFoldWithEmptyAccumulator_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), + one("meta::pure::functions::collection::tests::fold::testFoldWithSingleValue_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), + one("meta::pure::functions::collection::tests::fold::testFold_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,null,'init:',null);"), one("meta::pure::functions::collection::tests::fold::testIntegerSum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::fold::testStringSum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // ForAll - one("meta::pure::functions::collection::tests::forall::testforAllOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::forall::testforAllOnEmptySet_Function_1__Boolean_1_", "Can't find a match for function 'equal(?)'"), one("meta::pure::functions::collection::tests::forall::testforAllOnNonEmptySetIsFalse_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::forall::testforAllOnNonEmptySetIsTrue_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -96,22 +95,28 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::collection::tests::indexof::testIndexOf_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'indexOf_T_MANY__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Init - one("meta::pure::functions::collection::tests::init::testInitOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::init::testInitOneElement_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::init::testInit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::init::testInitOnEmptySet_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), + one("meta::pure::functions::collection::tests::init::testInitOneElement_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), + one("meta::pure::functions::collection::tests::init::testInit_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), // Last one("meta::pure::functions::collection::tests::last::testLastFromEmpty_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::last::testLastOfOneElementList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::last::testLast_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + // Mod + one("meta::pure::functions::math::tests::mod::testModInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"cast(fmod(%s,%s) as integer)\"\""), + + // Pow + one("meta::pure::functions::math::tests::pow::testNumberPow_Function_1__Boolean_1_", "\"\nexpected: 9.0\nactual: 27.0\""), + // Reverse one("meta::pure::functions::collection::tests::reverse::testReverseEmpty_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'reverse_T_m__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::reverse::testReverse_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'reverse_T_m__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Slice one("meta::pure::functions::collection::tests::slice::testSliceEqualBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::slice::testSliceInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::slice::testSliceInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::slice::testSliceOnBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::slice::testSliceOnEmpty_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::slice::testSliceOutOfBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), @@ -121,8 +126,8 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::collection::tests::sort::testMixedSortNoComparator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSimpleSortNoComparator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSimpleSortReversed_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::sort::testSimpleSortWithFunctionVariables_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::sort::testSimpleSortWithKey_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::sort::testSimpleSortWithFunctionVariables_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'x' in the graph"), + one("meta::pure::functions::collection::tests::sort::testSimpleSortWithKey_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'x' in the graph"), one("meta::pure::functions::collection::tests::sort::testSimpleSort_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSortEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -134,7 +139,7 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf // Take one("meta::pure::functions::collection::tests::take::testTakeExceedsSizeOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::take::testTakeExceedsSizeOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::take::testTakeInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::take::testTakeInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::take::testTakeManyOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::take::testTakeManyOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::take::testTakeNegativeOnEmptyList_Function_1__Boolean_1_", "\"Invalid type for parameter inside the take/limit function. Expected a value, found operation/function\""), @@ -192,7 +197,7 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::string::tests::toString::testComplexClassToString_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), one("meta::pure::functions::string::tests::toString::testDateTimeToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-01T00:00:00.000+0000'\nactual: '2014-01-01 00:00:00'\""), one("meta::pure::functions::string::tests::toString::testDateTimeWithTimezoneToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-01T00:00:00.0000+0000'\nactual: '2014-01-01 00:00:00'\""), - one("meta::pure::functions::string::tests::toString::testDateToString_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::string::tests::toString::testDateToString_Function_1__Boolean_1_", "Date has no day: 2014-01"), one("meta::pure::functions::string::tests::toString::testEnumerationToString_Function_1__Boolean_1_", "\"Match failure: ClassInstanceHolderObject instanceOf ClassInstanceHolder\""), one("meta::pure::functions::string::tests::toString::testListToString_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), one("meta::pure::functions::string::tests::toString::testPairCollectionToString_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), @@ -200,17 +205,10 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::string::tests::toString::testPersonToString_Function_1__Boolean_1_", "\"Assert failed\""), one("meta::pure::functions::string::tests::toString::testSimpleDateToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-02T01:54:27.352+0000'\nactual: '2014-01-02 01:54:27.352'\""), - // Mod - one("meta::pure::functions::math::tests::mod::testModInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), - one("meta::pure::functions::math::tests::mod::testModWithNegativeNumbers_Function_1__Boolean_1_", "\"\nexpected: 3\nactual: -2\""), - - // Pow - one("meta::pure::functions::math::tests::pow::testNumberPow_Function_1__Boolean_1_", "\"\nexpected: 9.0\nactual: 27.0\""), - // Rem + one("meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_", "\"\nexpected: 0.14D\nactual: 0.14\""), one("meta::pure::functions::math::tests::rem::testRemInEvalWithNegativeNumbers_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), one("meta::pure::functions::math::tests::rem::testRemInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), - one("meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_", "\"\nexpected: 0.14D\nactual: 0.14\""), // Round one("meta::pure::functions::math::tests::round::testPositiveFloatRoundHalfEvenDown_Function_1__Boolean_1_", "\"\nexpected: 16\nactual: 17\""), @@ -228,7 +226,7 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf // Is one("meta::pure::functions::boolean::tests::testIsEnum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'is_Any_1__Any_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::boolean::tests::testIsNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::testIsNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::testIsPrimitive_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'is_Any_1__Any_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // At @@ -237,7 +235,7 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::collection::tests::at::testAt_Function_1__Boolean_1_", "\"->at(...) function is supported only after direct access of 1->MANY properties. Current expression: ['a', 'b', 'c'] -> at(0)\""), // RemoveDuplicates - one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyListExplicit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyListExplicit_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::string::toString(?)'"), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesPrimitiveNonStandardFunction_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesPrimitiveStandardFunctionExplicit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -245,12 +243,12 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::collection::tests::removeDuplicatesBy::testRemoveDuplicatesByPrimitive_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), //Date - one("meta::pure::functions::date::tests::testAdjustByDaysBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByHoursBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::date::tests::testAdjustByDaysBigNumber_Function_1__Boolean_1_", "java.sql.SQLException: java.sql.SQLException: Binder Error: No function matches the given name and argument types 'to_days(INTEGER_LITERAL)'."), + one("meta::pure::functions::date::tests::testAdjustByHoursBigNumber_Function_1__Boolean_1_", "java.sql.SQLException: Out of Range Error: Interval value 12345678912 hours out of range"), one("meta::pure::functions::date::tests::testAdjustByMicrosecondsBigNumber_Function_1__Boolean_1_", "\"\nexpected: %2021-06-21T09:37:37.4990000+0000\nactual: %2021-06-21T09:37:37.499+0000\""), one("meta::pure::functions::date::tests::testAdjustByMinutesBigNumber_Function_1__Boolean_1_", "\"\nexpected: %-21457-01-08T20:48:00+0000\nactual: %21458-01-08T20:48:00+0000\""), - one("meta::pure::functions::date::tests::testAdjustByMonthsBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustReflectiveEvaluation_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'eval_Function_1__T_n__U_p__W_q__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::date::tests::testAdjustByMonthsBigNumber_Function_1__Boolean_1_", "java.sql.SQLException: java.sql.SQLException: Binder Error: No function matches the given name and argument types 'to_months(INTEGER_LITERAL)'."), + one("meta::pure::functions::date::tests::testAdjustReflectiveEvaluation_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::eval(?)'"), one("meta::pure::functions::date::tests::testDateFromDay_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__StrictDate_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testDateFromHour_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__Integer_1__DateTime_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testDateFromMinute_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__Integer_1__Integer_1__DateTime_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -266,40 +264,37 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::date::tests::testHasSecond_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSecond_Date_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testHasSubsecondWithAtLeastPrecision_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSubsecondWithAtLeastPrecision_Date_1__Integer_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testHasSubsecond_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSubsecond_Date_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::date::tests::testAdjustByMonths_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testAdjustByWeeksBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByYears_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testAdjustByMonths_Function_1__Boolean_1_", "Date has no day: 2012-03"), + one("meta::pure::functions::date::tests::testAdjustByWeeksBigNumber_Function_1__Boolean_1_", "java.sql.SQLException: java.sql.SQLException: Binder Error: No function matches the given name and argument types 'to_weeks(INTEGER_LITERAL)'. You might need to add explicit type casts."), + one("meta::pure::functions::date::tests::testAdjustByYears_Function_1__Boolean_1_", "\"DuckDB doesn't support YEAR and YEAR-MONTH\""), one("meta::pure::functions::date::tests::testDateDiffWeeks_Function_1__Boolean_1_", "\"\nexpected: 1\nactual: 0\""), - one("meta::pure::functions::date::tests::testDateDiffYears_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDatePartYearMonthOnly_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDatePartYearOnly_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testDateDiffYears_Function_1__Boolean_1_", "\"DuckDB doesn't support YEAR and YEAR-MONTH\""), + one("meta::pure::functions::date::tests::testDatePartYearMonthOnly_Function_1__Boolean_1_", "Date has no day: 1973-11"), + one("meta::pure::functions::date::tests::testDatePartYearOnly_Function_1__Boolean_1_", "\"DuckDB doesn't support YEAR and YEAR-MONTH\""), one("meta::pure::functions::date::tests::testHour_Function_1__Boolean_1_", "\"\nexpected: 17\nactual: 0\""), one("meta::pure::functions::date::tests::testMinute_Function_1__Boolean_1_", "\"\nexpected: 9\nactual: 0\""), - one("meta::pure::functions::date::tests::testMonthNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testYear_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testMonthNumber_Function_1__Boolean_1_", "Date has no day: 2015-04"), + one("meta::pure::functions::date::tests::testYear_Function_1__Boolean_1_", "\"DuckDB doesn't support YEAR and YEAR-MONTH\""), // MultiIf - one("meta::pure::functions::lang::tests::if::testMultiIf_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::lang::tests::if::testMultiIf_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/lang/flow/if.pure"), // Match - one("meta::pure::functions::lang::tests::match::testMatchManyWithMany_Function_1__Boolean_1_", "\"Match only supports operands with multiplicity [1]..! Current operand : ['w', 'w', 'w']\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWithMany_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWithZeroOne_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWith_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithExtraParam_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'match_Any_MANY__Function_$1_MANY$__P_o__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::lang::tests::match::testMatchWithExtraParamsAndFunctionsAsParam_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'match_Any_MANY__Function_$1_MANY$__P_o__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParamManyMatch_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParam_Function_1__Boolean_1_", "\"Cast exception: Literal cannot be cast to SemiStructuredPropertyAccess\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsManyMatch_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctions_Function_1__Boolean_1_", "\"Cast exception: Literal cannot be cast to SemiStructuredPropertyAccess\""), + one("meta::pure::functions::lang::tests::match::testMatchManyWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWithZeroOne_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWith_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithExtraParam_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::match(?)'"), + one("meta::pure::functions::lang::tests::match::testMatchWithExtraParamsAndFunctionsAsParam_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::match(?)'"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParamManyMatch_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParam_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsManyMatch_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctions_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), one("meta::pure::functions::lang::tests::match::testMatchWithMixedReturnType_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::lang::tests::match::testMatchZeroWithMany_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchZeroWithZero_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), + one("meta::pure::functions::lang::tests::match::testMatchZeroWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchZeroWithZero_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), one("meta::pure::functions::lang::tests::match::testMatch_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - // Abs - one("meta::pure::functions::math::tests::abs::testDecimalAbs_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'abs_Decimal_1__Decimal_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // IndexOf one("meta::pure::functions::string::tests::indexOf::testFromIndex_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'indexOf_String_1__String_1__Integer_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::string::tests::indexOf::testSimple_Function_1__Boolean_1_", "\"[unsupported-api] The function 'indexOf' (state: [Select, false]) is not supported yet\""), @@ -315,14 +310,14 @@ public class Test_Relational_DuckDB_EssentialFunctions_PCT extends PCTReportConf one("meta::pure::functions::string::tests::parseDate::testParseDate_Function_1__Boolean_1_", "\"[unsupported-api] The function 'toTimestamp' (state: [Select, false]) is not supported yet\""), // ParseDecimal - one("meta::pure::functions::string::tests::parseDecimal::testParseDecimal_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::string::tests::parseDecimal::testParseDecimal_Function_1__Boolean_1_", "java.sql.SQLException: Conversion Error: Could not convert string \"3.14159d\" to DECIMAL(18,3)\nLINE 1: select cast('3.14159d' as decimal)\n ^"), one("meta::pure::functions::string::tests::parseDecimal::testParseZero_Function_1__Boolean_1_", "\"\nexpected: 0.000D\nactual: 0.0D\""), // ParseInteger - one("meta::pure::functions::string::tests::parseInteger::testParseInteger_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::string::tests::parseInteger::testParseInteger_Function_1__Boolean_1_", "java.sql.SQLException: Conversion Error: Could not convert string '9999999999999992' to INT32\nLINE 1: select cast('9999999999999992' as integer)\n ^"), // ReverseString - one("meta::pure::functions::string::tests::reverse::testReverseString_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") + one("meta::pure::functions::string::tests::reverse::testReverseString_Function_1__Boolean_1_", "java.sql.SQLException: java.sql.SQLException: Catalog Error: Scalar Function with name legend_h2_extension_reverse_string does not exist!\nDid you mean \"list_reverse_sort\"?\nLINE 1: select legend_h2_extension_reverse_string('')\n ^") ); diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/duckdb/pct/Test_Relational_DuckDB_GrammarFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/duckdb/pct/Test_Relational_DuckDB_GrammarFunctions_PCT.java index 4f0740bb843..a926035c765 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/duckdb/pct/Test_Relational_DuckDB_GrammarFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/duckdb/pct/Test_Relational_DuckDB_GrammarFunctions_PCT.java @@ -41,16 +41,16 @@ public class Test_Relational_DuckDB_GrammarFunctions_PCT extends PCTReportConfig one("meta::pure::functions::boolean::tests::conjunctions::not::testNotInCollection_Function_1__Boolean_1_", "\"->at(...) function is supported only after direct access of 1->MANY properties. Current expression: [false, false -> not()] -> at(1)\""), // Eq - one("meta::pure::functions::boolean::tests::equality::eq::testEqDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::boolean::tests::equality::eq::testEqEnum_Function_1__Boolean_1_", "\"Assert failed\""), - one("meta::pure::functions::boolean::tests::equality::eq::testEqNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqDate_Function_1__Boolean_1_", "\"DuckDB doesn't support YEAR and YEAR-MONTH\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::equality::eq::testEqVarIdentity_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 1 where the collection is of size 1\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqEnum_Function_1__Boolean_1_", "\"Assert failed\""), // Equal - one("meta::pure::functions::boolean::tests::equality::equal::testEqualDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), one("meta::pure::functions::boolean::tests::equality::equal::testEqualEnum_Function_1__Boolean_1_", "\"Assert failed\""), - one("meta::pure::functions::boolean::tests::equality::equal::testEqualNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::equality::equal::testEqualNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::equality::equal::testEqualVarIdentity_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 1 where the collection is of size 1\""), + one("meta::pure::functions::boolean::tests::equality::equal::testEqualDateStrictYear_Function_1__Boolean_1_", "\"DuckDB doesn't support YEAR and YEAR-MONTH\""), // GreaterThan one("meta::pure::functions::boolean::tests::inequalities::greaterThan::testGreaterThan_Boolean_Function_1__Boolean_1_", "\"Assert failed\""), @@ -59,21 +59,21 @@ public class Test_Relational_DuckDB_GrammarFunctions_PCT extends PCTReportConfig one("meta::pure::functions::boolean::tests::inequalities::greaterThanEqual::testGreaterThanEqual_Boolean_Function_1__Boolean_1_", "\"Assert failed\""), // Filter - one("meta::pure::functions::collection::tests::filter::testFilterInstance_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::filter::testFilterInstance_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/filter.pure:49cc46-50); error compiling generated Java code:"), one("meta::pure::functions::collection::tests::filter::testFilterLiteralFromVar_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::filter::testFilterLiteral_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::filter::testLambdaAsFunctionParameter_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // First - one("meta::pure::functions::collection::tests::first::testFirstComplex_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 0 where the collection is of size 0\""), + one("meta::pure::functions::collection::tests::first::testFirstComplex_Function_1__Boolean_1_", "\"Expected at most one object, but found many\""), one("meta::pure::functions::collection::tests::first::testFirstOnEmptySet_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::first::testFirstSimple_Function_1__Boolean_1_", "\"Cannot cast a collection of size 2 to multiplicity [1]\""), // Map one("meta::pure::functions::collection::tests::map::testMapInstance_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToMany_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToOne_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromOneToOne_Function_1__Boolean_1_", "\"Error during dynamic reactivation: Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:43cc92-98); error compiling generated Java code:\nimport org.eclipse.collections.api.LazyIterable;\nimport org.eclipse.collections.api.block.function.Function0;\nimport org.eclipse.collections.api.block.function.Function;\nimport org.eclipse.collections.api.block.function.Function2;\nimport org.eclipse.collections.api.block.predicate.Predicate;\nimport org.eclipse.collections.api.block.procedure.Procedure;\nimport org.eclipse.collections.api.map.ImmutableMap;\nimport org.eclipse.collections.api.map.MutableMap;\nimport org.eclipse.collections.api.map.MutableMapIterable;\nimport org.eclipse.collections.api.map.MapIterable;\nimport org.eclipse.collections.api.map.primitive.IntObjectMap;\nimport org.eclipse.collections.api.set.MutableSet;\nimport org.eclipse.collections.api.set.SetIterable;\nimport org.eclipse.collections.api.list.MutableList;\nimport org.eclipse.collections.api.list.ListIterable;\nimport org.eclipse.collections.api.RichIterable;\nimport org.eclipse.collections.api.tuple.Pair;\nimport org.eclipse.collections.impl.factory.Lists;\nimport org.eclipse.collections.impl.factory.Maps;\nimport org.eclipse.collections.impl.map.mutable.UnifiedMap;\nimport org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy;\nimport org.eclipse.collections.impl.set.mutable.UnifiedSet;\nimport org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy;\nimport org.eclipse.collections.impl.list.mutable.FastList;\nimport org.eclipse.collections.impl.factory.Sets;\nimport org.eclipse.collections.impl.block.function.checked.CheckedFunction0;\nimport org.eclipse.collections.impl.utility.Iterate;\nimport org.eclipse.collections.impl.utility.LazyIterate;\nimport org.eclipse.collections.impl.utility.StringIterate;\nimport org.finos.legend.pure.m3.navigation.generictype.GenericType;\nimport org.finos.legend.pure.m3.navigation.ProcessorSupport;\nimport org.finos.legend.pure.m3.execution.ExecutionSupport;\nimport org.finos.legend.pure.m3.exception.PureExecutionException;\nimport org.finos.legend.pure.m4.coreinstance.CoreInstance;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.PureDate;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.DateFunctions;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.map.*;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangeType;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangedPath;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.Revision;\nimport org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement;\nimport org.finos.legend.pure.m3.tools.ListHelper;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.defended.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.sourceInformation.*;\nimport org.finos.legend.pure.runtime.java.compiled.serialization.model.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport java.lang.reflect.Method;\nimport java.math.BigInteger;\nimport java.sql.DatabaseMetaData;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSetMetaData;\nimport java.util.Iterator;\nimport java.util.Calendar;\nimport java.util.Map;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport org.json.simple.JSONObject;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type;\n\n\npublic class DynaClass{\n public static org.finos.legend.pure.generated.Root_meta_pure_functions_collection_tests_map_model_M_Address doProcess(final MapIterable vars, final MutableMap valMap, final IntObjectMap localLambdas, final ExecutionSupport es){\n return _address;\n }\n}\n\""), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToMany_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:63cc79-83); error compiling generated Java code:"), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToOne_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:52cc64-68); error compiling generated Java code:"), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromOneToOne_Function_1__Boolean_1_", "\"Error during dynamic reactivation: Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:43cc92-98); error compiling generated Java code:"), // Range one("meta::pure::functions::collection::tests::range::testRangeWithStep_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'range_Integer_1__Integer_1__Integer_1__Integer_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -90,28 +90,25 @@ public class Test_Relational_DuckDB_GrammarFunctions_PCT extends PCTReportConfig one("meta::pure::functions::lang::tests::compare::testCompareDecimalAndLongTypes_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'compare_T_1__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::lang::tests::compare::testDateCompare_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'compare_T_1__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // Divide - one("meta::pure::functions::math::tests::divide::testDecimalDivide_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'divide_Decimal_1__Decimal_1__Integer_1__Decimal_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // Minus one("meta::pure::functions::math::tests::minus::testDecimalMinus_Function_1__Boolean_1_", "\"\nexpected: -4.0D\nactual: -4.0\""), - one("meta::pure::functions::math::tests::minus::testLargeMinus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::minus::testLargeMinus_Function_1__Boolean_1_", "java.sql.SQLException: Out of Range Error: Overflow in subtraction of INT64 (-9223372036854775718 - 132)!"), one("meta::pure::functions::math::tests::minus::testSingleMinusType_Function_1__Boolean_1_", "\"Cast exception: StoreRoutingStrategy cannot be cast to StoreMappingRoutingStrategy\""), - one("meta::pure::functions::math::tests::minus::testSingleMinus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::minus::testSingleMinus_Function_1__Boolean_1_", "java.sql.SQLException: java.sql.SQLException: Parser Error: SELECT clause without selection list"), // Plus one("meta::pure::functions::math::tests::plus::testDecimalPlus_Function_1__Boolean_1_", "\"\nexpected: 6.0D\nactual: 6.0\""), - one("meta::pure::functions::math::tests::plus::testLargePlus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::plus::testLargePlus_Function_1__Boolean_1_", "java.sql.SQLException: Out of Range Error: Overflow in addition of INT64 (9223372036854775807 + 3)!"), one("meta::pure::functions::math::tests::plus::testSinglePlusType_Function_1__Boolean_1_", "\"Cast exception: StoreRoutingStrategy cannot be cast to StoreMappingRoutingStrategy\""), // Times one("meta::pure::functions::math::tests::times::testDecimalTimes_Function_1__Boolean_1_", "\"\nexpected: 353791.470D\nactual: 353791.47\""), - one("meta::pure::functions::math::tests::times::testLargeTimes_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::times::testLargeTimes_Function_1__Boolean_1_", "java.sql.SQLException: Out of Range Error: Overflow in multiplication of INT64 (2 * 9223372036854775807)!"), // Plus (String) one("meta::pure::functions::string::tests::plus::testMultiPlusWithPropertyExpressions_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::string::tests::plus::testPlusInCollect_Function_1__Boolean_1_", "\"Error mapping not found for class P_Person cache:''\""), - one("meta::pure::functions::string::tests::plus::testPlusInIterate_Function_1__Boolean_1_", "\"Error mapping not found for class P_Person cache:''\""), + one("meta::pure::functions::string::tests::plus::testPlusInCollect_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'at_T_MANY__Integer_1__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::string::tests::plus::testPlusInIterate_Function_1__Boolean_1_", "\"Match failure: StoreMappingClusteredValueSpecificationObject instanceOf StoreMappingClusteredValueSpecification\""), // Let one("meta::pure::functions::lang::tests::letFn::testAssignLiteralToVariable_Function_1__Boolean_1_", "\"Cannot cast a collection of size 2 to multiplicity [1]\""), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-pure/src/main/resources/core_relational_duckdb/relational/sqlQueryToString/duckdbExtension.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-pure/src/main/resources/core_relational_duckdb/relational/sqlQueryToString/duckdbExtension.pure index dd1ba2cf377..ffaf6f8e55b 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-pure/src/main/resources/core_relational_duckdb/relational/sqlQueryToString/duckdbExtension.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-duckdb/legend-engine-xt-relationalStore-duckdb-pure/src/main/resources/core_relational_duckdb/relational/sqlQueryToString/duckdbExtension.pure @@ -71,8 +71,11 @@ function meta::relational::functions::sqlQueryToString::duckDB::convertDateToSql | let d= format('%t{[' + $timeZone + ']yyyy-MM-dd HH:mm:ss}', $date); format('TIMESTAMP_S \'%s\'',$d); ), - | let d =format('%t{[' + $timeZone + ']yyyy-MM-dd}', $date); - format('DATE \'%s\'',$d); + | if ($date->hasMonth() || $date->hasDay(), + | let d = format('%t{[' + $timeZone + ']yyyy-MM-dd}', $date); + format('DATE \'%s\'',$d);, + | fail('DuckDB doesn\'t support YEAR and YEAR-MONTH'); ''; + ) ); } function <> meta::relational::functions::sqlQueryToString::duckDB::getDynaFunctionToSqlForDuckDB(): DynaFunctionToSql[*] @@ -121,6 +124,7 @@ function <> meta::relational::functions::sqlQueryToString::duckD dynaFnToSql('matches', $allStates, ^ToSql(format= 'regexp_matches(%s,%s)', transform={p:String[2]|$p})), dynaFnToSql('md5', $allStates, ^ToSql(format='md5(%s)')), dynaFnToSql('minute', $allStates, ^ToSql(format='minute(%s)')), + dynaFnToSql('mod', $allStates, ^ToSql(format='cast(fmod(%s,%s) as integer)')), dynaFnToSql('month', $allStates, ^ToSql(format='month(%s)')), dynaFnToSql('monthNumber', $allStates, ^ToSql(format='month(%s)')), dynaFnToSql('monthName', $allStates, ^ToSql(format='monthname(%s)')), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_EssentialFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_EssentialFunctions_PCT.java index a2591420369..854cb2d289c 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_EssentialFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_EssentialFunctions_PCT.java @@ -37,7 +37,7 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // Add - one("meta::pure::functions::collection::tests::add::testAddWithOffset_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'add_T_MANY__Integer_1__T_1__T_$1_MANY$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::add::testAddWithOffset_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), one("meta::pure::functions::collection::tests::add::testAdd_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'add_T_MANY__T_1__T_$1_MANY$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Concatenate @@ -46,14 +46,14 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::collection::tests::concatenate::testConcatenateTypeInference_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // Contains - one("meta::pure::functions::collection::tests::contains::testContainsNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::contains::testContainsPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::contains::testContainsWithFunction_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::contains::testContainsNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.CO_Firm (_pureId,legalName) values (10,'f1');"), + one("meta::pure::functions::collection::tests::contains::testContainsPrimitive_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Values of types \"INTEGER\" and \"BOOLEAN\" are not comparable; SQL statement:\nselect 1 in (1, 2, 5, 2, 'a', true, DATE'2014-02-01', 'c') [90110-214]"), + one("meta::pure::functions::collection::tests::contains::testContainsWithFunction_Function_1__Boolean_1_", "Error while executing: insert into leSchema.ClassWithoutEquality (_pureId,name) values (10,'f1');"), // Drop one("meta::pure::functions::collection::tests::drop::testDropExceedsSizeOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::drop::testDropExceedsSizeOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::drop::testDropInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::drop::testDropInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::drop::testDropManyOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::drop::testDropManyOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::drop::testDropNegativeOnEmptyList_Function_1__Boolean_1_", "\"Invalid type for parameter inside the drop function. Expected a value, found operation/function\""), @@ -64,30 +64,29 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::collection::tests::drop::testDropZeroOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // Exists - one("meta::pure::functions::collection::tests::exists::testExistsInSelect_Function_1__Boolean_1_", "\"Error mapping not found for class CO_Firm cache:''\""), - one("meta::pure::functions::collection::tests::exists::testExists_Function_1__Boolean_1_", "\"Error mapping not found for class CO_Firm cache:''\""), + one("meta::pure::functions::collection::tests::exists::testExists_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), // Find - one("meta::pure::functions::collection::tests::find::testFindInstance_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::find::testFindLiteralFromVar_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'find_T_MANY__Function_1__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::find::testFindLiteral_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'find_T_MANY__Function_1__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::find::testFindUsingVarForFunction_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::find::testFindInstance_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/collection/iteration/find.pure:38cc38-42); error compiling generated Java code:"), + one("meta::pure::functions::collection::tests::find::testFindLiteralFromVar_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::find' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::find]"), + one("meta::pure::functions::collection::tests::find::testFindLiteral_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::find' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::find]"), + one("meta::pure::functions::collection::tests::find::testFindUsingVarForFunction_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/collection/iteration/find.pure:47cc38-42); error compiling generated Java code:"), // Fold one("meta::pure::functions::collection::tests::fold::testFoldCollectionAccumulator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndEmptyIdentity_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndEmptyIdentity_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndNonEmptyIdentity_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldFiltering_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::fold::testFoldFiltering_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,'John','Roe',null);"), one("meta::pure::functions::collection::tests::fold::testFoldMixedAccumulatorTypes_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldToMany_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::fold::testFoldWithEmptyAccumulator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldWithSingleValue_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFold_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::fold::testFoldToMany_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,'John','Roe',null);"), + one("meta::pure::functions::collection::tests::fold::testFoldWithEmptyAccumulator_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), + one("meta::pure::functions::collection::tests::fold::testFoldWithSingleValue_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), + one("meta::pure::functions::collection::tests::fold::testFold_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,null,'init:',null);"), one("meta::pure::functions::collection::tests::fold::testIntegerSum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::fold::testStringSum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // ForAll - one("meta::pure::functions::collection::tests::forall::testforAllOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::forall::testforAllOnEmptySet_Function_1__Boolean_1_", "Can't find a match for function 'equal(?)'"), one("meta::pure::functions::collection::tests::forall::testforAllOnNonEmptySetIsFalse_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::forall::testforAllOnNonEmptySetIsTrue_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -96,22 +95,25 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::collection::tests::indexof::testIndexOf_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'indexOf_T_MANY__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Init - one("meta::pure::functions::collection::tests::init::testInitOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::init::testInitOneElement_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::init::testInit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::init::testInitOnEmptySet_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), + one("meta::pure::functions::collection::tests::init::testInitOneElement_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), + one("meta::pure::functions::collection::tests::init::testInit_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), // Last one("meta::pure::functions::collection::tests::last::testLastFromEmpty_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::last::testLastOfOneElementList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::last::testLast_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + // Pow + one("meta::pure::functions::math::tests::pow::testNumberPow_Function_1__Boolean_1_", "\"\nexpected: 9.0\nactual: 27.0\""), + // Reverse one("meta::pure::functions::collection::tests::reverse::testReverseEmpty_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'reverse_T_m__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::reverse::testReverse_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'reverse_T_m__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Slice one("meta::pure::functions::collection::tests::slice::testSliceEqualBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::slice::testSliceInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::slice::testSliceInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::slice::testSliceOnBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::slice::testSliceOnEmpty_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::slice::testSliceOutOfBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), @@ -121,8 +123,8 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::collection::tests::sort::testMixedSortNoComparator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSimpleSortNoComparator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSimpleSortReversed_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::sort::testSimpleSortWithFunctionVariables_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::sort::testSimpleSortWithKey_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::sort::testSimpleSortWithFunctionVariables_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'x' in the graph"), + one("meta::pure::functions::collection::tests::sort::testSimpleSortWithKey_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'x' in the graph"), one("meta::pure::functions::collection::tests::sort::testSimpleSort_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSortEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -134,7 +136,7 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur // Take one("meta::pure::functions::collection::tests::take::testTakeExceedsSizeOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::take::testTakeExceedsSizeOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::take::testTakeInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::take::testTakeInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::take::testTakeManyOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::take::testTakeManyOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::take::testTakeNegativeOnEmptyList_Function_1__Boolean_1_", "\"Invalid type for parameter inside the take/limit function. Expected a value, found operation/function\""), @@ -196,7 +198,7 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::string::tests::toString::testComplexClassToString_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), one("meta::pure::functions::string::tests::toString::testDateTimeToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-01T00:00:00.000+0000'\nactual: '2014-01-01 00:00:00'\""), one("meta::pure::functions::string::tests::toString::testDateTimeWithTimezoneToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-01T00:00:00.0000+0000'\nactual: '2014-01-01 00:00:00'\""), - one("meta::pure::functions::string::tests::toString::testDateToString_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::string::tests::toString::testDateToString_Function_1__Boolean_1_", "Date has no day: 2014-01"), one("meta::pure::functions::string::tests::toString::testEnumerationToString_Function_1__Boolean_1_", "\"Match failure: ClassInstanceHolderObject instanceOf ClassInstanceHolder\""), one("meta::pure::functions::string::tests::toString::testFloatToStringWithNegativeExponent_Function_1__Boolean_1_", "\"\nexpected: '0.000000013421'\nactual: '1.3421E-8'\""), one("meta::pure::functions::string::tests::toString::testFloatToStringWithPositiveExponent_Function_1__Boolean_1_", "\"\nexpected: '134210000.0'\nactual: '1.3421E8'\""), @@ -209,16 +211,13 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::math::tests::mod::testModInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), one("meta::pure::functions::math::tests::mod::testModWithNegativeNumbers_Function_1__Boolean_1_", "\"\nexpected: 3\nactual: -2\""), - // Pow - one("meta::pure::functions::math::tests::pow::testNumberPow_Function_1__Boolean_1_", "\"\nexpected: 9.0\nactual: 27.0\""), - // Rem one("meta::pure::functions::math::tests::rem::testRemInEvalWithFloat_Function_1__Boolean_1_", "\"\nexpected: 2.5\nactual: 3\""), one("meta::pure::functions::math::tests::rem::testRemInEvalWithMixedIntegersAndFloats_Function_1__Boolean_1_", "\"\nexpected: 2.5\nactual: 3\""), + one("meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_", "\"\nexpected: 0.14D\nactual: 0.14000000000000012\""), + one("meta::pure::functions::math::tests::rem::testRemWithMixedIntegersAndFloats_Function_1__Boolean_1_", "\"\nexpected: 2.5\nactual: 3\""), one("meta::pure::functions::math::tests::rem::testRemInEvalWithNegativeNumbers_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), one("meta::pure::functions::math::tests::rem::testRemInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), - one("meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_", "\"\nexpected: 0.14D\nactual: 0.14\""), - one("meta::pure::functions::math::tests::rem::testRemWithMixedIntegersAndFloats_Function_1__Boolean_1_", "\"\nexpected: 2.5\nactual: 3\""), // Round one("meta::pure::functions::math::tests::round::testNegativeFloatRoundHalfEvenUp_Function_1__Boolean_1_", "\"\nexpected: -16\nactual: -17\""), @@ -229,12 +228,12 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::math::tests::toDecimal::testDoubleToDecimal_Function_1__Boolean_1_", "\"\nexpected: 3.8D\nactual: 4D\""), // CubeRoot - one("meta::pure::functions::math::tests::testCubeRootEval_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::testCubeRoot_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::testCubeRootEval_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Function \"CBRT\" not found; SQL statement:\nselect cbrt(27) [90022-214]"), + one("meta::pure::functions::math::tests::testCubeRoot_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Function \"CBRT\" not found; SQL statement:\nselect cbrt(0) [90022-214]"), // Is one("meta::pure::functions::boolean::tests::testIsEnum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'is_Any_1__Any_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::boolean::tests::testIsNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::testIsNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::testIsPrimitive_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'is_Any_1__Any_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // At @@ -243,7 +242,7 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::collection::tests::at::testAt_Function_1__Boolean_1_", "\"->at(...) function is supported only after direct access of 1->MANY properties. Current expression: ['a', 'b', 'c'] -> at(0)\""), // RemoveDuplicates - one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyListExplicit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyListExplicit_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::string::toString(?)'"), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesPrimitiveNonStandardFunction_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesPrimitiveStandardFunctionExplicit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -251,12 +250,12 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::collection::tests::removeDuplicatesBy::testRemoveDuplicatesByPrimitive_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), //Date - one("meta::pure::functions::date::tests::testAdjustByDaysBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByHoursBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::date::tests::testAdjustByDaysBigNumber_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Invalid value \"12345678912\" for parameter \"DATEADD count\"; SQL statement:\nselect dateadd(DAY, 12345678912, DATE'2016-02-29') [90008-214]"), + one("meta::pure::functions::date::tests::testAdjustByHoursBigNumber_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Invalid value \"12345678912\" for parameter \"DATEADD count\"; SQL statement:\nselect dateadd(HOUR, 12345678912, TIMESTAMP'2016-02-29 00:00:00') [90008-214]"), one("meta::pure::functions::date::tests::testAdjustByMicrosecondsBigNumber_Function_1__Boolean_1_", "\"\nexpected: %2021-06-21T09:37:37.4990000+0000\nactual: %2021-06-21T09:37:37.499+0000\""), - one("meta::pure::functions::date::tests::testAdjustByMinutesBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), one("meta::pure::functions::date::tests::testAdjustByMonthsBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustBySecondsBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustReflectiveEvaluation_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'eval_Function_1__T_n__U_p__W_q__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::date::tests::testAdjustByMinutesBigNumber_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Invalid value \"12345678912\" for parameter \"DATEADD count\"; SQL statement:\nselect dateadd(MINUTE, 12345678912, TIMESTAMP'2016-02-29 00:00:00') [90008-214]"), + one("meta::pure::functions::date::tests::testAdjustBySecondsBigNumber_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Invalid value \"12345678912\" for parameter \"DATEADD count\"; SQL statement:\nselect dateadd(SECOND, 12345678912, TIMESTAMP'2016-02-29 00:00:00') [90008-214]"), + one("meta::pure::functions::date::tests::testAdjustReflectiveEvaluation_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::eval(?)'"), one("meta::pure::functions::date::tests::testDateFromDay_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__StrictDate_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testDateFromHour_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__Integer_1__DateTime_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testDateFromMinute_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__Integer_1__Integer_1__DateTime_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -272,40 +271,38 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::date::tests::testHasSecond_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSecond_Date_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testHasSubsecondWithAtLeastPrecision_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSubsecondWithAtLeastPrecision_Date_1__Integer_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testHasSubsecond_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSubsecond_Date_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::date::tests::testAdjustByMonths_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testAdjustByWeeksBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByYears_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testAdjustByMonths_Function_1__Boolean_1_", "Date has no day: 2012-03"), + one("meta::pure::functions::date::tests::testAdjustByMonthsBigNumber_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Invalid value \"12345678912\" for parameter \"DATEADD count\"; SQL statement:\nselect dateadd(MONTH, 12345678912, DATE'2016-02-29') [90008-214]"), + one("meta::pure::functions::date::tests::testAdjustByWeeksBigNumber_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Invalid value \"12345678912\" for parameter \"DATEADD count\"; SQL statement:\nselect dateadd(WEEK, 12345678912, DATE'2016-02-29') [90008-214]"), + one("meta::pure::functions::date::tests::testAdjustByYears_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::date::tests::testDateDiffWeeks_Function_1__Boolean_1_", "\"\nexpected: 0\nactual: -1\""), - one("meta::pure::functions::date::tests::testDateDiffYears_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDatePartYearMonthOnly_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDatePartYearOnly_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testDateDiffYears_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), + one("meta::pure::functions::date::tests::testDatePartYearMonthOnly_Function_1__Boolean_1_", "Date has no day: 1973-11"), + one("meta::pure::functions::date::tests::testDatePartYearOnly_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::date::tests::testHour_Function_1__Boolean_1_", "\"\nexpected: 17\nactual: 0\""), one("meta::pure::functions::date::tests::testMinute_Function_1__Boolean_1_", "\"\nexpected: 9\nactual: 0\""), - one("meta::pure::functions::date::tests::testMonthNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testYear_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testMonthNumber_Function_1__Boolean_1_", "Date has no day: 2015-04"), + one("meta::pure::functions::date::tests::testYear_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), // MultiIf - one("meta::pure::functions::lang::tests::if::testMultiIf_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::lang::tests::if::testMultiIf_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/lang/flow/if.pure:58cc29-32); error compiling generated Java code:"), // Match - one("meta::pure::functions::lang::tests::match::testMatchManyWithMany_Function_1__Boolean_1_", "\"Match only supports operands with multiplicity [1]..! Current operand : ['w', 'w', 'w']\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWithMany_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWithZeroOne_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWith_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithExtraParam_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'match_Any_MANY__Function_$1_MANY$__P_o__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::lang::tests::match::testMatchWithExtraParamsAndFunctionsAsParam_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'match_Any_MANY__Function_$1_MANY$__P_o__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParamManyMatch_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParam_Function_1__Boolean_1_", "\"Cast exception: Literal cannot be cast to SemiStructuredPropertyAccess\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsManyMatch_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctions_Function_1__Boolean_1_", "\"Cast exception: Literal cannot be cast to SemiStructuredPropertyAccess\""), + one("meta::pure::functions::lang::tests::match::testMatchManyWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWithZeroOne_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWith_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithExtraParam_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::match(?)'"), + one("meta::pure::functions::lang::tests::match::testMatchWithExtraParamsAndFunctionsAsParam_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::match(?)'"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParamManyMatch_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParam_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsManyMatch_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctions_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), one("meta::pure::functions::lang::tests::match::testMatchWithMixedReturnType_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::lang::tests::match::testMatchZeroWithMany_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchZeroWithZero_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), + one("meta::pure::functions::lang::tests::match::testMatchZeroWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchZeroWithZero_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), one("meta::pure::functions::lang::tests::match::testMatch_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - // Abs - one("meta::pure::functions::math::tests::abs::testDecimalAbs_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'abs_Decimal_1__Decimal_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // IndexOf one("meta::pure::functions::string::tests::indexOf::testFromIndex_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'indexOf_String_1__String_1__Integer_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::string::tests::indexOf::testSimple_Function_1__Boolean_1_", "\"\nexpected: 4\nactual: 5\""), @@ -315,17 +312,17 @@ public class Test_Relational_H2_EssentialFunctions_PCT extends PCTReportConfigur one("meta::pure::functions::string::tests::parseBoolean::testParseTrue_Function_1__Boolean_1_", "\"[unsupported-api] The function 'parseBoolean' (state: [Select, false]) is not supported yet\""), // ParseDate - one("meta::pure::functions::string::tests::parseDate::testParseDateTypes_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::string::tests::parseDate::testParseDateWithTimezone_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::string::tests::parseDate::testParseDateWithZ_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::string::tests::parseDate::testParseDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::string::tests::parseDate::testParseDateTypes_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Error parsing \"2014-02-27T00:00:00.000000\"; SQL statement:\nselect cast(parsedatetime('2014-02-27T00:00:00.000000','yyyy-MM-dd HH:mm:ss[.SSSSSSSSS][.SSSSSSSS][.SSSSSSS][.SSSSSS][.SSSSS][.SSSS][.SSS][.SS][.S]') as timestamp) [90014-214]"), + one("meta::pure::functions::string::tests::parseDate::testParseDateWithTimezone_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Error parsing \"2014-02-27T10:01:35.231-0500\"; SQL statement:\nselect cast(parsedatetime('2014-02-27T10:01:35.231-0500','yyyy-MM-dd HH:mm:ss[.SSSSSSSSS][.SSSSSSSS][.SSSSSSS][.SSSSSS][.SSSSS][.SSSS][.SSS][.SS][.S]') as timestamp) [90014-214]"), + one("meta::pure::functions::string::tests::parseDate::testParseDateWithZ_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Error parsing \"2014-02-27T10:01:35.231Z\"; SQL statement:\nselect cast(parsedatetime('2014-02-27T10:01:35.231Z','yyyy-MM-dd HH:mm:ss[.SSSSSSSSS][.SSSSSSSS][.SSSSSSS][.SSSSSS][.SSSSS][.SSSS][.SSS][.SS][.S]') as timestamp) [90014-214]"), + one("meta::pure::functions::string::tests::parseDate::testParseDate_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Error parsing \"2014-02-27T10:01:35.231\"; SQL statement:\nselect cast(parsedatetime('2014-02-27T10:01:35.231','yyyy-MM-dd HH:mm:ss[.SSSSSSSSS][.SSSSSSSS][.SSSSSSS][.SSSSSS][.SSSSS][.SSSS][.SSS][.SS][.S]') as timestamp) [90014-214]"), // ParseDecimal - one("meta::pure::functions::string::tests::parseDecimal::testParseDecimal_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::string::tests::parseDecimal::testParseDecimal_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Data conversion error converting \"3.14159d\"; SQL statement:\nselect cast('3.14159d' as decimal) [22018-214]"), one("meta::pure::functions::string::tests::parseDecimal::testParseZero_Function_1__Boolean_1_", "\"\nexpected: 0.0D\nactual: 0D\""), // ParseInteger - one("meta::pure::functions::string::tests::parseInteger::testParseInteger_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") + one("meta::pure::functions::string::tests::parseInteger::testParseInteger_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Data conversion error converting \"9999999999999992\"; SQL statement:\nselect cast('9999999999999992' as integer) [22018-214]") ); public static Test suite() diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_GrammarFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_GrammarFunctions_PCT.java index 46534b4b2b2..d5736e62954 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_GrammarFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_GrammarFunctions_PCT.java @@ -37,24 +37,24 @@ public class Test_Relational_H2_GrammarFunctions_PCT extends PCTReportConfigurat private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // And - one("meta::pure::functions::boolean::tests::conjunctions::and::testShortCircuitSimple_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::conjunctions::and::testShortCircuitSimple_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Division by zero: \"12.0\"; SQL statement:\nselect (false and ((1.0 * 12) / 0) > 0)"), // Not one("meta::pure::functions::boolean::tests::conjunctions::not::testNotInCollection_Function_1__Boolean_1_", "\"->at(...) function is supported only after direct access of 1->MANY properties. Current expression: [false, false -> not()] -> at(1)\""), // Or - one("meta::pure::functions::boolean::tests::conjunctions::or::testShortCircuitSimple_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::conjunctions::or::testShortCircuitSimple_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Division by zero: \"12.0\"; SQL statement:\nselect (true or ((1.0 * 12) / 0) > 0)"), // Eq - one("meta::pure::functions::boolean::tests::equality::eq::testEqDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqDate_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::boolean::tests::equality::eq::testEqEnum_Function_1__Boolean_1_", "\"Assert failed\""), - one("meta::pure::functions::boolean::tests::equality::eq::testEqNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::equality::eq::testEqVarIdentity_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 1 where the collection is of size 1\""), // Equal - one("meta::pure::functions::boolean::tests::equality::equal::testEqualDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::boolean::tests::equality::equal::testEqualDateStrictYear_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::boolean::tests::equality::equal::testEqualEnum_Function_1__Boolean_1_", "\"Assert failed\""), - one("meta::pure::functions::boolean::tests::equality::equal::testEqualNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::equality::equal::testEqualNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::equality::equal::testEqualVarIdentity_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 1 where the collection is of size 1\""), // GreaterThan @@ -64,20 +64,20 @@ public class Test_Relational_H2_GrammarFunctions_PCT extends PCTReportConfigurat one("meta::pure::functions::boolean::tests::inequalities::greaterThanEqual::testGreaterThanEqual_Boolean_Function_1__Boolean_1_", "\"Assert failed\""), // Filter - one("meta::pure::functions::collection::tests::filter::testFilterInstance_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::filter::testFilterInstance_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/filter.pure:49cc46-50); error compiling generated Java code:"), one("meta::pure::functions::collection::tests::filter::testFilterLiteralFromVar_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::filter::testFilterLiteral_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::filter::testLambdaAsFunctionParameter_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // First - one("meta::pure::functions::collection::tests::first::testFirstComplex_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 0 where the collection is of size 0\""), + one("meta::pure::functions::collection::tests::first::testFirstComplex_Function_1__Boolean_1_", "\"Expected at most one object, but found many\""), one("meta::pure::functions::collection::tests::first::testFirstOnEmptySet_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::first::testFirstSimple_Function_1__Boolean_1_", "\"Cannot cast a collection of size 2 to multiplicity [1]\""), // Map one("meta::pure::functions::collection::tests::map::testMapInstance_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToMany_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToOne_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToMany_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:63cc79-83); error compiling generated Java code:"), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToOne_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:52cc64-68); error compiling generated Java code:"), one("meta::pure::functions::collection::tests::map::testMapRelationshipFromOneToOne_Function_1__Boolean_1_", "\"Error during dynamic reactivation: Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:43cc92-98); error compiling generated Java code:\nimport org.eclipse.collections.api.LazyIterable;\nimport org.eclipse.collections.api.block.function.Function0;\nimport org.eclipse.collections.api.block.function.Function;\nimport org.eclipse.collections.api.block.function.Function2;\nimport org.eclipse.collections.api.block.predicate.Predicate;\nimport org.eclipse.collections.api.block.procedure.Procedure;\nimport org.eclipse.collections.api.map.ImmutableMap;\nimport org.eclipse.collections.api.map.MutableMap;\nimport org.eclipse.collections.api.map.MutableMapIterable;\nimport org.eclipse.collections.api.map.MapIterable;\nimport org.eclipse.collections.api.map.primitive.IntObjectMap;\nimport org.eclipse.collections.api.set.MutableSet;\nimport org.eclipse.collections.api.set.SetIterable;\nimport org.eclipse.collections.api.list.MutableList;\nimport org.eclipse.collections.api.list.ListIterable;\nimport org.eclipse.collections.api.RichIterable;\nimport org.eclipse.collections.api.tuple.Pair;\nimport org.eclipse.collections.impl.factory.Lists;\nimport org.eclipse.collections.impl.factory.Maps;\nimport org.eclipse.collections.impl.map.mutable.UnifiedMap;\nimport org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy;\nimport org.eclipse.collections.impl.set.mutable.UnifiedSet;\nimport org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy;\nimport org.eclipse.collections.impl.list.mutable.FastList;\nimport org.eclipse.collections.impl.factory.Sets;\nimport org.eclipse.collections.impl.block.function.checked.CheckedFunction0;\nimport org.eclipse.collections.impl.utility.Iterate;\nimport org.eclipse.collections.impl.utility.LazyIterate;\nimport org.eclipse.collections.impl.utility.StringIterate;\nimport org.finos.legend.pure.m3.navigation.generictype.GenericType;\nimport org.finos.legend.pure.m3.navigation.ProcessorSupport;\nimport org.finos.legend.pure.m3.execution.ExecutionSupport;\nimport org.finos.legend.pure.m3.exception.PureExecutionException;\nimport org.finos.legend.pure.m4.coreinstance.CoreInstance;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.PureDate;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.DateFunctions;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.map.*;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangeType;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangedPath;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.Revision;\nimport org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement;\nimport org.finos.legend.pure.m3.tools.ListHelper;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.defended.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.sourceInformation.*;\nimport org.finos.legend.pure.runtime.java.compiled.serialization.model.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport java.lang.reflect.Method;\nimport java.math.BigInteger;\nimport java.sql.DatabaseMetaData;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSetMetaData;\nimport java.util.Iterator;\nimport java.util.Calendar;\nimport java.util.Map;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport org.json.simple.JSONObject;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type;\n\n\npublic class DynaClass{\n public static org.finos.legend.pure.generated.Root_meta_pure_functions_collection_tests_map_model_M_Address doProcess(final MapIterable vars, final MutableMap valMap, final IntObjectMap localLambdas, final ExecutionSupport es){\n return _address;\n }\n}\n\""), // Range @@ -95,29 +95,26 @@ public class Test_Relational_H2_GrammarFunctions_PCT extends PCTReportConfigurat one("meta::pure::functions::lang::tests::compare::testCompareDecimalAndLongTypes_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'compare_T_1__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::lang::tests::compare::testDateCompare_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'compare_T_1__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // Divide - one("meta::pure::functions::math::tests::divide::testDecimalDivide_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'divide_Decimal_1__Decimal_1__Integer_1__Decimal_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // Minus - one("meta::pure::functions::math::tests::minus::testDecimalMinus_Function_1__Boolean_1_", "\"\nexpected: -4.0D\nactual: -4\""), - one("meta::pure::functions::math::tests::minus::testLargeMinus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::minus::testDecimalMinus_Function_1__Boolean_1_", "\"\nexpected: -4.0D\nactual: -4.0\""), + one("meta::pure::functions::math::tests::minus::testLargeMinus_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Numeric value out of range: \"-9223372036854775718\"; SQL statement:\nselect (-9223372036854775718 - 132) [22003-214]\n"), one("meta::pure::functions::math::tests::minus::testSingleMinusType_Function_1__Boolean_1_", "\"Cast exception: StoreRoutingStrategy cannot be cast to StoreMappingRoutingStrategy\""), - one("meta::pure::functions::math::tests::minus::testSingleMinus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::minus::testSingleMinus_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Invalid value \"1\" for parameter \"columnIndex\" [90008-214]"), // Plus - one("meta::pure::functions::math::tests::plus::testDecimalPlus_Function_1__Boolean_1_", "\"\nexpected: 6.0D\nactual: 6\""), + one("meta::pure::functions::math::tests::plus::testDecimalPlus_Function_1__Boolean_1_", "\"\nexpected: 6.0D\nactual: 6.0\""), - one("meta::pure::functions::math::tests::plus::testLargePlus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::plus::testLargePlus_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Numeric value out of range: \"9223372036854775807\"; SQL statement:\nselect (9223372036854775807 + 3 + (4 + 5) + 7) [22003-214]"), one("meta::pure::functions::math::tests::plus::testSinglePlusType_Function_1__Boolean_1_", "\"Cast exception: StoreRoutingStrategy cannot be cast to StoreMappingRoutingStrategy\""), // Times - one("meta::pure::functions::math::tests::times::testDecimalTimes_Function_1__Boolean_1_", "\"\nexpected: 353791.470D\nactual: 353791.47\""), - one("meta::pure::functions::math::tests::times::testLargeTimes_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::times::testDecimalTimes_Function_1__Boolean_1_", "\"\nexpected: 353791.470D\nactual: 353791.47000000003\""), + one("meta::pure::functions::math::tests::times::testLargeTimes_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLDataException: Numeric value out of range: \"2\"; SQL statement:\nselect (2 * 9223372036854775807) [22003-214]"), // Plus (String) one("meta::pure::functions::string::tests::plus::testMultiPlusWithPropertyExpressions_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::string::tests::plus::testPlusInCollect_Function_1__Boolean_1_", "\"Error mapping not found for class P_Person cache:''\""), - one("meta::pure::functions::string::tests::plus::testPlusInIterate_Function_1__Boolean_1_", "\"Error mapping not found for class P_Person cache:''\""), + one("meta::pure::functions::string::tests::plus::testPlusInCollect_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'at_T_MANY__Integer_1__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::string::tests::plus::testPlusInIterate_Function_1__Boolean_1_", "\"Match failure: StoreMappingClusteredValueSpecificationObject instanceOf StoreMappingClusteredValueSpecification\""), // Let one("meta::pure::functions::lang::tests::letFn::testAssignLiteralToVariable_Function_1__Boolean_1_", "\"Cannot cast a collection of size 2 to multiplicity [1]\""), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_RelationFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_RelationFunctions_PCT.java index d7d663e74b6..4670e84a5bb 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_RelationFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_RelationFunctions_PCT.java @@ -36,7 +36,7 @@ public class Test_Relational_H2_RelationFunctions_PCT extends PCTReportConfigura private static final Adapter adapter = CoreExternalTestConnectionCodeRepositoryProvider.H2Adapter; private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( - one("meta::pure::functions::relation::tests::select::testSingleSelectWithQuotedColumn_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") + one("meta::pure::functions::relation::tests::select::testSingleSelectWithQuotedColumn_Function_1__Boolean_1_", "Error while executing: Create Table leSchema.tb") ); public static Test suite() diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_StandardFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_StandardFunctions_PCT.java index 37345f330b4..dfdaf3fcd5f 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_StandardFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-h2/legend-engine-xt-relationalStore-h2-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/h2/pct/Test_Relational_H2_StandardFunctions_PCT.java @@ -37,17 +37,17 @@ public class Test_Relational_H2_StandardFunctions_PCT extends PCTReportConfigura private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // StD Dev - one("meta::pure::functions::math::tests::stdDev::testFloatStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testIntStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testMixedStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testNegativeNumberStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testPopulationStandardDeviation_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::stdDev::testFloatStdDev_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select sqrt(var_samp([*][CAST(1.0 AS FLOAT),CAST(2.0 AS FLOAT),CAST(3.0 AS FLOAT)]))\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect sqrt(var_samp([CAST(1.0 AS FLOAT),CAST(2.0 AS FLOAT),CAST(3.0 AS FLOAT)])) [42001-214]"), + one("meta::pure::functions::math::tests::stdDev::testIntStdDev_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select sqrt(var_samp([*][1,2,3]))\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect sqrt(var_samp([1,2,3])) [42001-214]"), + one("meta::pure::functions::math::tests::stdDev::testMixedStdDev_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select sqrt(var_samp([*][CAST(1.0 AS FLOAT),2,CAST(3.0 AS FLOAT)]))\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect sqrt(var_samp([CAST(1.0 AS FLOAT),2,CAST(3.0 AS FLOAT)])) [42001-214]"), + one("meta::pure::functions::math::tests::stdDev::testNegativeNumberStdDev_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select sqrt(var_samp([*][-2,-4,-6]))\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect sqrt(var_samp([-2,-4,-6])) [42001-214]"), + one("meta::pure::functions::math::tests::stdDev::testPopulationStandardDeviation_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select sqrt(var_pop([*][1,2]))\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect sqrt(var_pop([1,2])) [42001-214]"), // Variance - one("meta::pure::functions::math::tests::variance::testVariancePopulation_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVarianceSample_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVariance_Population_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVariance_Sample_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") + one("meta::pure::functions::math::tests::variance::testVariancePopulation_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select var_pop([*][1,2])\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect var_pop([1,2]) [42001-214]"), + one("meta::pure::functions::math::tests::variance::testVarianceSample_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select var_samp([*][CAST(1.0 AS FLOAT),CAST(2.0 AS FLOAT),CAST(3.0 AS FLOAT)])\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect var_samp([CAST(1.0 AS FLOAT),CAST(2.0 AS FLOAT),CAST(3.0 AS FLOAT)]) [42001-214]"), + one("meta::pure::functions::math::tests::variance::testVariance_Population_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select var_pop([*][1,2])\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect var_pop([1,2]) [42001-214]"), + one("meta::pure::functions::math::tests::variance::testVariance_Sample_Function_1__Boolean_1_", "org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement \"select var_samp([*][CAST(1.0 AS FLOAT),CAST(2.0 AS FLOAT),CAST(3.0 AS FLOAT)])\"; expected \"DISTINCT, ALL, INTERSECTS (, NOT, EXISTS, UNIQUE, INTERSECTS\"; SQL statement:\nselect var_samp([CAST(1.0 AS FLOAT),CAST(2.0 AS FLOAT),CAST(3.0 AS FLOAT)]) [42001-214]") ); public static Test suite() diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_EssentialFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_EssentialFunctions_PCT.java index 578742ad3bc..26dbdf7ac02 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_EssentialFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_EssentialFunctions_PCT.java @@ -37,7 +37,7 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // Add - one("meta::pure::functions::collection::tests::add::testAddWithOffset_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'add_T_MANY__Integer_1__T_1__T_$1_MANY$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::add::testAddWithOffset_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), one("meta::pure::functions::collection::tests::add::testAdd_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'add_T_MANY__T_1__T_$1_MANY$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Concatenate @@ -46,14 +46,14 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::collection::tests::concatenate::testConcatenateTypeInference_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // Contains - one("meta::pure::functions::collection::tests::contains::testContainsNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::contains::testContainsPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::contains::testContainsWithFunction_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::contains::testContainsNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.CO_Firm (_pureId,legalName) values (10,'f1');"), + one("meta::pure::functions::collection::tests::contains::testContainsPrimitive_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: operator does not exist: integer = text\n Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.\n Position: 10"), + one("meta::pure::functions::collection::tests::contains::testContainsWithFunction_Function_1__Boolean_1_", "Error while executing: insert into leSchema.ClassWithoutEquality (_pureId,name) values (10,'f1');"), // Drop one("meta::pure::functions::collection::tests::drop::testDropExceedsSizeOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::drop::testDropExceedsSizeOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::drop::testDropInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::drop::testDropInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::drop::testDropManyOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::drop::testDropManyOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::drop::testDropNegativeOnEmptyList_Function_1__Boolean_1_", "\"Invalid type for parameter inside the drop function. Expected a value, found operation/function\""), @@ -64,30 +64,29 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::collection::tests::drop::testDropZeroOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // Exists - one("meta::pure::functions::collection::tests::exists::testExistsInSelect_Function_1__Boolean_1_", "\"Error mapping not found for class CO_Firm cache:''\""), - one("meta::pure::functions::collection::tests::exists::testExists_Function_1__Boolean_1_", "\"Error mapping not found for class CO_Firm cache:''\""), + one("meta::pure::functions::collection::tests::exists::testExists_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), // Find - one("meta::pure::functions::collection::tests::find::testFindInstance_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::find::testFindLiteralFromVar_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'find_T_MANY__Function_1__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::find::testFindLiteral_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'find_T_MANY__Function_1__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::find::testFindUsingVarForFunction_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::find::testFindInstance_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/collection/iteration/find.pure:38cc38-42); error compiling generated Java code:"), + one("meta::pure::functions::collection::tests::find::testFindLiteralFromVar_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::find' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::find]"), + one("meta::pure::functions::collection::tests::find::testFindLiteral_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::find' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::find]"), + one("meta::pure::functions::collection::tests::find::testFindUsingVarForFunction_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/collection/iteration/find.pure:47cc38-42); error compiling generated Java code:"), // Fold one("meta::pure::functions::collection::tests::fold::testFoldCollectionAccumulator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndEmptyIdentity_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndEmptyIdentity_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndNonEmptyIdentity_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldFiltering_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::fold::testFoldFiltering_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,'John','Roe',null);"), one("meta::pure::functions::collection::tests::fold::testFoldMixedAccumulatorTypes_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldToMany_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::fold::testFoldWithEmptyAccumulator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldWithSingleValue_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFold_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::fold::testFoldToMany_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,'John','Roe',null);"), + one("meta::pure::functions::collection::tests::fold::testFoldWithEmptyAccumulator_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), + one("meta::pure::functions::collection::tests::fold::testFoldWithSingleValue_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), + one("meta::pure::functions::collection::tests::fold::testFold_Function_1__Boolean_1_", "Error while executing: insert into leSchema.FO_Person (_pureId,firstName,lastName,otherNames) values (10,null,'init:',null);"), one("meta::pure::functions::collection::tests::fold::testIntegerSum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::fold::testStringSum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // ForAll - one("meta::pure::functions::collection::tests::forall::testforAllOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::forall::testforAllOnEmptySet_Function_1__Boolean_1_", "Can't find a match for function 'equal(?)'"), one("meta::pure::functions::collection::tests::forall::testforAllOnNonEmptySetIsFalse_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::forall::testforAllOnNonEmptySetIsTrue_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -96,22 +95,25 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::collection::tests::indexof::testIndexOf_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'indexOf_T_MANY__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Init - one("meta::pure::functions::collection::tests::init::testInitOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::init::testInitOneElement_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::init::testInit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::init::testInitOnEmptySet_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), + one("meta::pure::functions::collection::tests::init::testInitOneElement_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), + one("meta::pure::functions::collection::tests::init::testInit_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), // Last one("meta::pure::functions::collection::tests::last::testLastFromEmpty_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::last::testLastOfOneElementList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::last::testLast_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + // Pow + one("meta::pure::functions::math::tests::pow::testNumberPow_Function_1__Boolean_1_", "\"\nexpected: 9.0\nactual: 27.0\""), + // Reverse one("meta::pure::functions::collection::tests::reverse::testReverseEmpty_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'reverse_T_m__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::reverse::testReverse_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'reverse_T_m__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Slice one("meta::pure::functions::collection::tests::slice::testSliceEqualBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::slice::testSliceInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::slice::testSliceInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::slice::testSliceOnBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::slice::testSliceOnEmpty_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::slice::testSliceOutOfBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), @@ -121,8 +123,8 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::collection::tests::sort::testMixedSortNoComparator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSimpleSortNoComparator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSimpleSortReversed_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::sort::testSimpleSortWithFunctionVariables_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::sort::testSimpleSortWithKey_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::sort::testSimpleSortWithFunctionVariables_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'x' in the graph"), + one("meta::pure::functions::collection::tests::sort::testSimpleSortWithKey_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'x' in the graph"), one("meta::pure::functions::collection::tests::sort::testSimpleSort_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSortEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -130,11 +132,12 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::collection::tests::tail::testTailOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'tail_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::tail::testTailOneElement_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'tail_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::tail::testTail_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'tail_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::tail::testTail_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'tail_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Take one("meta::pure::functions::collection::tests::take::testTakeExceedsSizeOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::take::testTakeExceedsSizeOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::take::testTakeInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::take::testTakeInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::take::testTakeManyOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::take::testTakeManyOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::take::testTakeNegativeOnEmptyList_Function_1__Boolean_1_", "\"Invalid type for parameter inside the take/limit function. Expected a value, found operation/function\""), @@ -192,7 +195,7 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::string::tests::toString::testComplexClassToString_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), one("meta::pure::functions::string::tests::toString::testDateTimeToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-01T00:00:00.000+0000'\nactual: '2014-01-01 00:00:00'\""), one("meta::pure::functions::string::tests::toString::testDateTimeWithTimezoneToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-01T00:00:00.0000+0000'\nactual: '2014-01-01 00:00:00'\""), - one("meta::pure::functions::string::tests::toString::testDateToString_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::string::tests::toString::testDateToString_Function_1__Boolean_1_", "Date has no day: 2014-01"), one("meta::pure::functions::string::tests::toString::testEnumerationToString_Function_1__Boolean_1_", "\"Match failure: ClassInstanceHolderObject instanceOf ClassInstanceHolder\""), one("meta::pure::functions::string::tests::toString::testListToString_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), one("meta::pure::functions::string::tests::toString::testPairCollectionToString_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), @@ -201,21 +204,21 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::string::tests::format::testFormatInEval_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'format_String_1__Any_MANY__String_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + // Mod one("meta::pure::functions::math::tests::mod::testModInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), one("meta::pure::functions::math::tests::mod::testModWithNegativeNumbers_Function_1__Boolean_1_", "\"\nexpected: 3\nactual: -2\""), - one("meta::pure::functions::math::tests::pow::testNumberPow_Function_1__Boolean_1_", "\"\nexpected: 9.0\nactual: 27.0\""), - + // Rem + one("meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_", "\"\nexpected: 0.14D\nactual: 0.14\""), one("meta::pure::functions::math::tests::rem::testRemInEvalWithNegativeNumbers_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), one("meta::pure::functions::math::tests::rem::testRemInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), - one("meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_", "\"\nexpected: 0.14D\nactual: 0.14\""), one("meta::pure::functions::math::tests::round::testPositiveFloatRoundHalfEvenDown_Function_1__Boolean_1_", "\"\nexpected: 16\nactual: 17\""), one("meta::pure::functions::math::tests::round::testNegativeFloatRoundHalfEvenUp_Function_1__Boolean_1_", "\"\nexpected: -16\nactual: -17\""), // Is one("meta::pure::functions::boolean::tests::testIsEnum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'is_Any_1__Any_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::boolean::tests::testIsNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::testIsNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::testIsPrimitive_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'is_Any_1__Any_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // At @@ -224,7 +227,7 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::collection::tests::at::testAt_Function_1__Boolean_1_", "\"->at(...) function is supported only after direct access of 1->MANY properties. Current expression: ['a', 'b', 'c'] -> at(0)\""), // RemoveDuplicates - one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyListExplicit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyListExplicit_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::string::toString(?)'"), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesPrimitiveNonStandardFunction_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesPrimitiveStandardFunctionExplicit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -232,12 +235,12 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::collection::tests::removeDuplicatesBy::testRemoveDuplicatesByPrimitive_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), //Date - one("meta::pure::functions::date::tests::testAdjustByDaysBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByHoursBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::date::tests::testAdjustByDaysBigNumber_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: interval out of range"), + one("meta::pure::functions::date::tests::testAdjustByHoursBigNumber_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: interval out of range"), one("meta::pure::functions::date::tests::testAdjustByMicrosecondsBigNumber_Function_1__Boolean_1_", "\"\nexpected: %2021-06-21T09:37:37.4990000+0000\nactual: %2021-06-21T09:37:37.499+0000\""), - one("meta::pure::functions::date::tests::testAdjustByMinutesBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByMonthsBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustReflectiveEvaluation_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'eval_Function_1__T_n__U_p__W_q__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::date::tests::testAdjustByMinutesBigNumber_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: timestamp out of range"), + one("meta::pure::functions::date::tests::testAdjustByMonthsBigNumber_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: interval out of range"), + one("meta::pure::functions::date::tests::testAdjustReflectiveEvaluation_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::eval(?)'"), one("meta::pure::functions::date::tests::testDateFromDay_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__StrictDate_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testDateFromHour_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__Integer_1__DateTime_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testDateFromMinute_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__Integer_1__Integer_1__DateTime_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -253,18 +256,18 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::date::tests::testHasSecond_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSecond_Date_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testHasSubsecondWithAtLeastPrecision_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSubsecondWithAtLeastPrecision_Date_1__Integer_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testHasSubsecond_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSubsecond_Date_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::date::tests::testAdjustByMonths_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testAdjustByWeeksBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByYears_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDateDiffWeeks_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testDateDiffYears_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDatePartYearMonthOnly_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDatePartYearOnly_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testAdjustByMonths_Function_1__Boolean_1_", "Date has no day: 2012-03"), + one("meta::pure::functions::date::tests::testAdjustByWeeksBigNumber_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: interval out of range"), + one("meta::pure::functions::date::tests::testAdjustByYears_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), + one("meta::pure::functions::date::tests::testDateDiffWeeks_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: function date_part(unknown, integer) does not exist\n Hint: No function matches the given name and argument types. You might need to add explicit type casts.\n Position: 15"), + one("meta::pure::functions::date::tests::testDateDiffYears_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), + one("meta::pure::functions::date::tests::testDatePartYearMonthOnly_Function_1__Boolean_1_", "Date has no day: 1973-11"), + one("meta::pure::functions::date::tests::testDatePartYearOnly_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::date::tests::testHour_Function_1__Boolean_1_", "\"\nexpected: 17\nactual: 0\""), one("meta::pure::functions::date::tests::testMinute_Function_1__Boolean_1_", "\"\nexpected: 9\nactual: 0\""), - one("meta::pure::functions::date::tests::testMonthNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testYear_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDateDiffDays_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::date::tests::testMonthNumber_Function_1__Boolean_1_", "Date has no day: 2015-04"), + one("meta::pure::functions::date::tests::testYear_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), + one("meta::pure::functions::date::tests::testDateDiffDays_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: function date_part(unknown, integer) does not exist\n Hint: No function matches the given name and argument types. You might need to add explicit type casts.\n Position: 9"), one("meta::pure::functions::date::tests::testDateDiffHours_Function_1__Boolean_1_", "\"\nexpected: 1\nactual: -1\""), one("meta::pure::functions::date::tests::testDateDiffMilliseconds_Function_1__Boolean_1_", "\"\nexpected: 1000\nactual: -2000\""), one("meta::pure::functions::date::tests::testDateDiffMinutes_Function_1__Boolean_1_", "\"\nexpected: 1\nactual: -1\""), @@ -273,27 +276,24 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo // MultiIf - one("meta::pure::functions::lang::tests::if::testMultiIf_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::lang::tests::if::testMultiIf_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/lang/flow/if.pure:58cc29-32); error compiling generated Java code:"), // Match - one("meta::pure::functions::lang::tests::match::testMatchManyWithMany_Function_1__Boolean_1_", "\"Match only supports operands with multiplicity [1]..! Current operand : ['w', 'w', 'w']\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWithMany_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWithZeroOne_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWith_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithExtraParam_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'match_Any_MANY__Function_$1_MANY$__P_o__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::lang::tests::match::testMatchWithExtraParamsAndFunctionsAsParam_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'match_Any_MANY__Function_$1_MANY$__P_o__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParamManyMatch_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParam_Function_1__Boolean_1_", "\"Cast exception: Literal cannot be cast to SemiStructuredPropertyAccess\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsManyMatch_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctions_Function_1__Boolean_1_", "\"Cast exception: Literal cannot be cast to SemiStructuredPropertyAccess\""), + one("meta::pure::functions::lang::tests::match::testMatchManyWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWithZeroOne_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWith_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithExtraParam_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::match(?)'"), + one("meta::pure::functions::lang::tests::match::testMatchWithExtraParamsAndFunctionsAsParam_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::match(?)'"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParamManyMatch_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParam_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsManyMatch_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctions_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), one("meta::pure::functions::lang::tests::match::testMatchWithMixedReturnType_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::lang::tests::match::testMatchZeroWithMany_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchZeroWithZero_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), + one("meta::pure::functions::lang::tests::match::testMatchZeroWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchZeroWithZero_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), one("meta::pure::functions::lang::tests::match::testMatch_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - // Abs - one("meta::pure::functions::math::tests::abs::testDecimalAbs_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'abs_Decimal_1__Decimal_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // IndexOf one("meta::pure::functions::string::tests::indexOf::testFromIndex_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'indexOf_String_1__String_1__Integer_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::string::tests::indexOf::testSimple_Function_1__Boolean_1_", "\"\nexpected: 4\nactual: 5\""), @@ -309,11 +309,11 @@ public class Test_Relational_Postgres_EssentialFunctions_PCT extends PCTReportCo one("meta::pure::functions::string::tests::parseDate::testParseDate_Function_1__Boolean_1_", "\"\nexpected: %2014-02-27T10:01:35.231+0000\nactual: %2014-02-27T10:01:35+0000\""), // ParseDecimal - one("meta::pure::functions::string::tests::parseDecimal::testParseDecimal_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::string::tests::parseDecimal::testParseDecimal_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: invalid input syntax for type numeric: \"3.14159d\""), one("meta::pure::functions::string::tests::parseDecimal::testParseZero_Function_1__Boolean_1_", "\"\nexpected: 0.000D\nactual: 0.0D\""), // ParseInteger - one("meta::pure::functions::string::tests::parseInteger::testParseInteger_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") + one("meta::pure::functions::string::tests::parseInteger::testParseInteger_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: value \"9999999999999992\" is out of range for type integer") ); public static Test suite() diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_GrammarFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_GrammarFunctions_PCT.java index 0ecf40c20c9..afd13dbd5d2 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_GrammarFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_GrammarFunctions_PCT.java @@ -40,16 +40,16 @@ public class Test_Relational_Postgres_GrammarFunctions_PCT extends PCTReportConf one("meta::pure::functions::boolean::tests::conjunctions::not::testNotInCollection_Function_1__Boolean_1_", "\"->at(...) function is supported only after direct access of 1->MANY properties. Current expression: [false, false -> not()] -> at(1)\""), // Eq - one("meta::pure::functions::boolean::tests::equality::eq::testEqDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqDate_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::boolean::tests::equality::eq::testEqEnum_Function_1__Boolean_1_", "\"Assert failed\""), - one("meta::pure::functions::boolean::tests::equality::eq::testEqNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::equality::eq::testEqVarIdentity_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 1 where the collection is of size 1\""), // Equal - one("meta::pure::functions::boolean::tests::equality::equal::testEqualDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), one("meta::pure::functions::boolean::tests::equality::equal::testEqualEnum_Function_1__Boolean_1_", "\"Assert failed\""), - one("meta::pure::functions::boolean::tests::equality::equal::testEqualNonPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::boolean::tests::equality::equal::testEqualNonPrimitive_Function_1__Boolean_1_", "Error while executing: insert into leSchema.SideClass (_pureId,stringId,intId) values (10,'firstSide',1);"), one("meta::pure::functions::boolean::tests::equality::equal::testEqualVarIdentity_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 1 where the collection is of size 1\""), + one("meta::pure::functions::boolean::tests::equality::equal::testEqualDateStrictYear_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), // GreaterThan one("meta::pure::functions::boolean::tests::inequalities::greaterThan::testGreaterThan_Boolean_Function_1__Boolean_1_", "\"Assert failed\""), @@ -58,20 +58,20 @@ public class Test_Relational_Postgres_GrammarFunctions_PCT extends PCTReportConf one("meta::pure::functions::boolean::tests::inequalities::greaterThanEqual::testGreaterThanEqual_Boolean_Function_1__Boolean_1_", "\"Assert failed\""), // Filter - one("meta::pure::functions::collection::tests::filter::testFilterInstance_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::filter::testFilterInstance_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/filter.pure:49cc46-50); error compiling generated Java code:\nimport org.eclipse.collections.api.LazyIterable;\nimport org.eclipse.collections.api.block.function.Function0;\nimport org.eclipse.collections.api.block.function.Function;\nimport org.eclipse.collections.api.block.function.Function2;\nimport org.eclipse.collections.api.block.predicate.Predicate;\nimport org.eclipse.collections.api.block.procedure.Procedure;\nimport org.eclipse.collections.api.map.ImmutableMap;\nimport org.eclipse.collections.api.map.MutableMap;\nimport org.eclipse.collections.api.map.MutableMapIterable;\nimport org.eclipse.collections.api.map.MapIterable;\nimport org.eclipse.collections.api.map.primitive.IntObjectMap;\nimport org.eclipse.collections.api.set.MutableSet;\nimport org.eclipse.collections.api.set.SetIterable;\nimport org.eclipse.collections.api.list.MutableList;\nimport org.eclipse.collections.api.list.ListIterable;\nimport org.eclipse.collections.api.RichIterable;\nimport org.eclipse.collections.api.tuple.Pair;\nimport org.eclipse.collections.impl.factory.Lists;\nimport org.eclipse.collections.impl.factory.Maps;\nimport org.eclipse.collections.impl.map.mutable.UnifiedMap;\nimport org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy;\nimport org.eclipse.collections.impl.set.mutable.UnifiedSet;\nimport org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy;\nimport org.eclipse.collections.impl.list.mutable.FastList;\nimport org.eclipse.collections.impl.factory.Sets;\nimport org.eclipse.collections.impl.block.function.checked.CheckedFunction0;\nimport org.eclipse.collections.impl.utility.Iterate;\nimport org.eclipse.collections.impl.utility.LazyIterate;\nimport org.eclipse.collections.impl.utility.StringIterate;\nimport org.finos.legend.pure.m3.navigation.generictype.GenericType;\nimport org.finos.legend.pure.m3.navigation.ProcessorSupport;\nimport org.finos.legend.pure.m3.execution.ExecutionSupport;\nimport org.finos.legend.pure.m3.exception.PureExecutionException;\nimport org.finos.legend.pure.m4.coreinstance.CoreInstance;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.PureDate;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.DateFunctions;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.map.*;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangeType;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangedPath;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.Revision;\nimport org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement;\nimport org.finos.legend.pure.m3.tools.ListHelper;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.defended.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.sourceInformation.*;\nimport org.finos.legend.pure.runtime.java.compiled.serialization.model.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport java.lang.reflect.Method;\nimport java.math.BigInteger;\nimport java.sql.DatabaseMetaData;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSetMetaData;\nimport java.util.Iterator;\nimport java.util.Calendar;\nimport java.util.Map;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport org.json.simple.JSONObject;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type;\n\n\npublic class DynaClass{\n public static org.finos.legend.pure.generated.Root_meta_pure_functions_collection_tests_model_CO_Person doProcess(final MapIterable vars, final MutableMap valMap, final IntObjectMap localLambdas, final ExecutionSupport es){\n return _smith;\n }\n}\n"), one("meta::pure::functions::collection::tests::filter::testFilterLiteralFromVar_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::filter::testFilterLiteral_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::filter::testLambdaAsFunctionParameter_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // First - one("meta::pure::functions::collection::tests::first::testFirstComplex_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 0 where the collection is of size 0\""), + one("meta::pure::functions::collection::tests::first::testFirstComplex_Function_1__Boolean_1_", "\"Expected at most one object, but found many\""), one("meta::pure::functions::collection::tests::first::testFirstOnEmptySet_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::first::testFirstSimple_Function_1__Boolean_1_", "\"Cannot cast a collection of size 2 to multiplicity [1]\""), // Map one("meta::pure::functions::collection::tests::map::testMapInstance_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToMany_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToOne_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToMany_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:63cc79-83); error compiling generated Java code:"), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToOne_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:52cc64-68); error compiling generated Java code:"), one("meta::pure::functions::collection::tests::map::testMapRelationshipFromOneToOne_Function_1__Boolean_1_", "\"Error during dynamic reactivation: Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:43cc92-98); error compiling generated Java code:\nimport org.eclipse.collections.api.LazyIterable;\nimport org.eclipse.collections.api.block.function.Function0;\nimport org.eclipse.collections.api.block.function.Function;\nimport org.eclipse.collections.api.block.function.Function2;\nimport org.eclipse.collections.api.block.predicate.Predicate;\nimport org.eclipse.collections.api.block.procedure.Procedure;\nimport org.eclipse.collections.api.map.ImmutableMap;\nimport org.eclipse.collections.api.map.MutableMap;\nimport org.eclipse.collections.api.map.MutableMapIterable;\nimport org.eclipse.collections.api.map.MapIterable;\nimport org.eclipse.collections.api.map.primitive.IntObjectMap;\nimport org.eclipse.collections.api.set.MutableSet;\nimport org.eclipse.collections.api.set.SetIterable;\nimport org.eclipse.collections.api.list.MutableList;\nimport org.eclipse.collections.api.list.ListIterable;\nimport org.eclipse.collections.api.RichIterable;\nimport org.eclipse.collections.api.tuple.Pair;\nimport org.eclipse.collections.impl.factory.Lists;\nimport org.eclipse.collections.impl.factory.Maps;\nimport org.eclipse.collections.impl.map.mutable.UnifiedMap;\nimport org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy;\nimport org.eclipse.collections.impl.set.mutable.UnifiedSet;\nimport org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy;\nimport org.eclipse.collections.impl.list.mutable.FastList;\nimport org.eclipse.collections.impl.factory.Sets;\nimport org.eclipse.collections.impl.block.function.checked.CheckedFunction0;\nimport org.eclipse.collections.impl.utility.Iterate;\nimport org.eclipse.collections.impl.utility.LazyIterate;\nimport org.eclipse.collections.impl.utility.StringIterate;\nimport org.finos.legend.pure.m3.navigation.generictype.GenericType;\nimport org.finos.legend.pure.m3.navigation.ProcessorSupport;\nimport org.finos.legend.pure.m3.execution.ExecutionSupport;\nimport org.finos.legend.pure.m3.exception.PureExecutionException;\nimport org.finos.legend.pure.m4.coreinstance.CoreInstance;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.PureDate;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.DateFunctions;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.map.*;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangeType;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangedPath;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.Revision;\nimport org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement;\nimport org.finos.legend.pure.m3.tools.ListHelper;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.defended.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.sourceInformation.*;\nimport org.finos.legend.pure.runtime.java.compiled.serialization.model.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport java.lang.reflect.Method;\nimport java.math.BigInteger;\nimport java.sql.DatabaseMetaData;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSetMetaData;\nimport java.util.Iterator;\nimport java.util.Calendar;\nimport java.util.Map;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport org.json.simple.JSONObject;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type;\n\n\npublic class DynaClass{\n public static org.finos.legend.pure.generated.Root_meta_pure_functions_collection_tests_map_model_M_Address doProcess(final MapIterable vars, final MutableMap valMap, final IntObjectMap localLambdas, final ExecutionSupport es){\n return _address;\n }\n}\n\""), // Range @@ -89,28 +89,25 @@ public class Test_Relational_Postgres_GrammarFunctions_PCT extends PCTReportConf one("meta::pure::functions::lang::tests::compare::testCompareDecimalAndLongTypes_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'compare_T_1__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::lang::tests::compare::testDateCompare_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'compare_T_1__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // Divide - one("meta::pure::functions::math::tests::divide::testDecimalDivide_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'divide_Decimal_1__Decimal_1__Integer_1__Decimal_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - // Minus one("meta::pure::functions::math::tests::minus::testDecimalMinus_Function_1__Boolean_1_", "\"\nexpected: -4.0D\nactual: -4.0\""), - one("meta::pure::functions::math::tests::minus::testLargeMinus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::minus::testLargeMinus_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: bigint out of range"), one("meta::pure::functions::math::tests::minus::testSingleMinusType_Function_1__Boolean_1_", "\"Cast exception: StoreRoutingStrategy cannot be cast to StoreMappingRoutingStrategy\""), - one("meta::pure::functions::math::tests::minus::testSingleMinus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::minus::testSingleMinus_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0."), // Plus one("meta::pure::functions::math::tests::plus::testDecimalPlus_Function_1__Boolean_1_", "\"\nexpected: 6.0D\nactual: 6.0\""), - one("meta::pure::functions::math::tests::plus::testLargePlus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::plus::testLargePlus_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: bigint out of range"), one("meta::pure::functions::math::tests::plus::testSinglePlusType_Function_1__Boolean_1_", "\"Cast exception: StoreRoutingStrategy cannot be cast to StoreMappingRoutingStrategy\""), // Times one("meta::pure::functions::math::tests::times::testDecimalTimes_Function_1__Boolean_1_", "\"\nexpected: 353791.470D\nactual: 353791.47\""), - one("meta::pure::functions::math::tests::times::testLargeTimes_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::times::testLargeTimes_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: bigint out of range"), // Plus (String) one("meta::pure::functions::string::tests::plus::testMultiPlusWithPropertyExpressions_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::string::tests::plus::testPlusInCollect_Function_1__Boolean_1_", "\"Error mapping not found for class P_Person cache:''\""), - one("meta::pure::functions::string::tests::plus::testPlusInIterate_Function_1__Boolean_1_", "\"Error mapping not found for class P_Person cache:''\""), + one("meta::pure::functions::string::tests::plus::testPlusInCollect_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'at_T_MANY__Integer_1__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::string::tests::plus::testPlusInIterate_Function_1__Boolean_1_", "\"Match failure: StoreMappingClusteredValueSpecificationObject instanceOf StoreMappingClusteredValueSpecification\""), // Let one("meta::pure::functions::lang::tests::letFn::testAssignLiteralToVariable_Function_1__Boolean_1_", "\"Cannot cast a collection of size 2 to multiplicity [1]\""), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_RelationFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_RelationFunctions_PCT.java index 266e77b8f70..a62cc325f84 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_RelationFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_RelationFunctions_PCT.java @@ -37,7 +37,7 @@ public class Test_Relational_Postgres_RelationFunctions_PCT extends PCTReportCon private static final Adapter adapter = CoreExternalTestConnectionCodeRepositoryProvider.postgresAdapter; private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( - one("meta::pure::functions::relation::tests::select::testSingleSelectWithQuotedColumn_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") + one("meta::pure::functions::relation::tests::select::testSingleSelectWithQuotedColumn_Function_1__Boolean_1_", "Error while executing: Create Table leSchema.") ); public static Test suite() diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_StandardFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_StandardFunctions_PCT.java index 08dcef68181..b25f7029d93 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_StandardFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-postgres/legend-engine-xt-relationalStore-postgres-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/postgres/pct/Test_Relational_Postgres_StandardFunctions_PCT.java @@ -37,17 +37,17 @@ public class Test_Relational_Postgres_StandardFunctions_PCT extends PCTReportCon private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // StD Dev - one("meta::pure::functions::math::tests::stdDev::testFloatStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testIntStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testMixedStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testNegativeNumberStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testPopulationStandardDeviation_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::stdDev::testFloatStdDev_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 21"), + one("meta::pure::functions::math::tests::stdDev::testIntStdDev_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 21"), + one("meta::pure::functions::math::tests::stdDev::testMixedStdDev_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 21"), + one("meta::pure::functions::math::tests::stdDev::testNegativeNumberStdDev_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 21"), + one("meta::pure::functions::math::tests::stdDev::testPopulationStandardDeviation_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 21"), // Variance - one("meta::pure::functions::math::tests::variance::testVariancePopulation_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVarianceSample_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVariance_Population_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVariance_Sample_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") + one("meta::pure::functions::math::tests::variance::testVariancePopulation_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 16"), + one("meta::pure::functions::math::tests::variance::testVarianceSample_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 17"), + one("meta::pure::functions::math::tests::variance::testVariance_Population_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 16"), + one("meta::pure::functions::math::tests::variance::testVariance_Sample_Function_1__Boolean_1_", "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"[\"\n Position: 16") ); public static Test suite() diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_EssentialFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_EssentialFunctions_PCT.java index 2a867b73f96..96ab347f423 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_EssentialFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_EssentialFunctions_PCT.java @@ -37,7 +37,7 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // Add - one("meta::pure::functions::collection::tests::add::testAddWithOffset_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'add_T_MANY__Integer_1__T_1__T_$1_MANY$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::add::testAddWithOffset_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), one("meta::pure::functions::collection::tests::add::testAdd_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'add_T_MANY__T_1__T_$1_MANY$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Concatenate @@ -46,14 +46,14 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::collection::tests::concatenate::testConcatenateTypeInference_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // Contains - one("meta::pure::functions::collection::tests::contains::testContainsNonPrimitive_Function_1__Boolean_1_", "\"Parameter to IN operation isn't a literal!\""), - one("meta::pure::functions::collection::tests::contains::testContainsPrimitive_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::contains::testContainsWithFunction_Function_1__Boolean_1_", "\"Error mapping not found for class ClassWithoutEquality cache:''\""), + one("meta::pure::functions::collection::tests::contains::testContainsNonPrimitive_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::contains(CO_Firm[*],CO_Firm[*])'"), + one("meta::pure::functions::collection::tests::contains::testContainsPrimitive_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error:\nCan not convert parameter 'CAST('2014-02-01' AS DATE)' of type [DATE] into expected type [BOOLEAN]"), + one("meta::pure::functions::collection::tests::contains::testContainsWithFunction_Function_1__Boolean_1_", "Unexpected token ':'. Valid alternatives: [',', ')']"), // Drop one("meta::pure::functions::collection::tests::drop::testDropExceedsSizeOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::drop::testDropExceedsSizeOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::drop::testDropInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::drop::testDropInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::drop::testDropManyOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::drop::testDropManyOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::drop::testDropNegativeOnEmptyList_Function_1__Boolean_1_", "\"Invalid type for parameter inside the drop function. Expected a value, found operation/function\""), @@ -64,30 +64,29 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::collection::tests::drop::testDropZeroOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // Exists - one("meta::pure::functions::collection::tests::exists::testExistsInSelect_Function_1__Boolean_1_", "\"Error mapping not found for class CO_Firm cache:''\""), - one("meta::pure::functions::collection::tests::exists::testExists_Function_1__Boolean_1_", "\"Error mapping not found for class CO_Firm cache:''\""), + one("meta::pure::functions::collection::tests::exists::testExists_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), // Find - one("meta::pure::functions::collection::tests::find::testFindInstance_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::find::testFindLiteralFromVar_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'find_T_MANY__Function_1__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::find::testFindLiteral_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'find_T_MANY__Function_1__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::find::testFindUsingVarForFunction_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::find::testFindInstance_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/collection/iteration/find.pure:38cc38-42); error compiling generated Java code:"), + one("meta::pure::functions::collection::tests::find::testFindLiteralFromVar_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::find' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::find]"), + one("meta::pure::functions::collection::tests::find::testFindLiteral_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::find' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::find]"), + one("meta::pure::functions::collection::tests::find::testFindUsingVarForFunction_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/collection/iteration/find.pure:47cc38-42); error compiling generated Java code:"), // Fold one("meta::pure::functions::collection::tests::fold::testFoldCollectionAccumulator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndEmptyIdentity_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndEmptyIdentity_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), one("meta::pure::functions::collection::tests::fold::testFoldEmptyListAndNonEmptyIdentity_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldFiltering_Function_1__Boolean_1_", "\"Error mapping not found for class FO_Person cache:''\""), + one("meta::pure::functions::collection::tests::fold::testFoldFiltering_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::lang::copy' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::fold, new lambda, Applying meta::pure::functions::lang::if, new lambda, Applying meta::pure::functions::lang::copy]"), one("meta::pure::functions::collection::tests::fold::testFoldMixedAccumulatorTypes_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldToMany_Function_1__Boolean_1_", "\"Error mapping not found for class FO_Person cache:''\""), - one("meta::pure::functions::collection::tests::fold::testFoldWithEmptyAccumulator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFoldWithSingleValue_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::fold::testFold_Function_1__Boolean_1_", "\"Error mapping not found for class FO_Person cache:''\""), + one("meta::pure::functions::collection::tests::fold::testFoldToMany_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::lang::copy' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::fold, new lambda, Applying meta::pure::functions::lang::copy]"), + one("meta::pure::functions::collection::tests::fold::testFoldWithEmptyAccumulator_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), + one("meta::pure::functions::collection::tests::fold::testFoldWithSingleValue_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::collection::add(?)'"), + one("meta::pure::functions::collection::tests::fold::testFold_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::lang::copy' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::fold, new lambda, Applying meta::pure::functions::lang::copy]"), one("meta::pure::functions::collection::tests::fold::testIntegerSum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::fold::testStringSum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'fold_T_MANY__Function_1__V_m__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // ForAll - one("meta::pure::functions::collection::tests::forall::testforAllOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::forall::testforAllOnEmptySet_Function_1__Boolean_1_", "Can't find a match for function 'equal(?)'"), one("meta::pure::functions::collection::tests::forall::testforAllOnNonEmptySetIsFalse_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::forall::testforAllOnNonEmptySetIsTrue_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'forAll_T_MANY__Function_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -96,9 +95,9 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::collection::tests::indexof::testIndexOf_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'indexOf_T_MANY__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Init - one("meta::pure::functions::collection::tests::init::testInitOnEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::init::testInitOneElement_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::init::testInit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'init_T_MANY__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::init::testInitOnEmptySet_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), + one("meta::pure::functions::collection::tests::init::testInitOneElement_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), + one("meta::pure::functions::collection::tests::init::testInit_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::init' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::init]"), // Last one("meta::pure::functions::collection::tests::last::testLastFromEmpty_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'last_T_MANY__T_$0_1$_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -109,8 +108,8 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::collection::tests::sort::testMixedSortNoComparator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSimpleSortNoComparator_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSimpleSortReversed_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::sort::testSimpleSortWithFunctionVariables_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::collection::tests::sort::testSimpleSortWithKey_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::sort::testSimpleSortWithFunctionVariables_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'x' in the graph"), + one("meta::pure::functions::collection::tests::sort::testSimpleSortWithKey_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'x' in the graph"), one("meta::pure::functions::collection::tests::sort::testSimpleSort_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::sort::testSortEmptySet_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'sort_T_m__Function_$0_1$__Function_$0_1$__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -125,7 +124,7 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC // Slice one("meta::pure::functions::collection::tests::slice::testSliceEqualBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::slice::testSliceInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::slice::testSliceInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::slice::testSliceOnBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::slice::testSliceOnEmpty_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::slice::testSliceOutOfBounds_Function_1__Boolean_1_", "\"Cannot cast a collection of size 4 to multiplicity [1]\""), @@ -134,7 +133,7 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC // Take one("meta::pure::functions::collection::tests::take::testTakeExceedsSizeOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::take::testTakeExceedsSizeOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::take::testTakeInList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'new_Class_1__String_1__KeyExpression_MANY__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::take::testTakeInList_Function_1__Boolean_1_", "Can't resolve the builder for function 'meta::pure::functions::collection::list' - stack:[Function 'test::lambdaContainer__Any_MANY_' Fifth Pass, new lambda, Applying meta::pure::mapping::from, Applying meta::pure::functions::collection::list]"), one("meta::pure::functions::collection::tests::take::testTakeManyOnEmptyList_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::take::testTakeManyOnNonEmptyList_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::take::testTakeNegativeOnEmptyList_Function_1__Boolean_1_", "\"Invalid type for parameter inside the take/limit function. Expected a value, found operation/function\""), @@ -191,7 +190,7 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::string::tests::toString::testComplexClassToString_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), one("meta::pure::functions::string::tests::toString::testDateTimeToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-01T00:00:00.000+0000'\nactual: '2014-01-01 00:00:00.000'\""), one("meta::pure::functions::string::tests::toString::testDateTimeWithTimezoneToString_Function_1__Boolean_1_", "\"\nexpected: '2014-01-01T00:00:00.0000+0000'\nactual: '2014-01-01 00:00:00.000'\""), - one("meta::pure::functions::string::tests::toString::testDateToString_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::string::tests::toString::testDateToString_Function_1__Boolean_1_", "Date has no day: 2014-01"), one("meta::pure::functions::string::tests::toString::testEnumerationToString_Function_1__Boolean_1_", "\"Match failure: ClassInstanceHolderObject instanceOf ClassInstanceHolder\""), one("meta::pure::functions::string::tests::toString::testFloatToStringWithExcessTrailingZeros_Function_1__Boolean_1_", "\"\nexpected: '17.0'\nactual: '17'\""), one("meta::pure::functions::string::tests::toString::testFloatToStringWithPositiveExponent_Function_1__Boolean_1_", "\"\nexpected: '134210000.0'\nactual: '134210000'\""), @@ -204,13 +203,10 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::math::tests::mod::testModInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), one("meta::pure::functions::math::tests::mod::testModWithNegativeNumbers_Function_1__Boolean_1_", "\"\nexpected: 3\nactual: -2\""), - // Pow - one("meta::pure::functions::math::tests::pow::testNumberPow_Function_1__Boolean_1_", "\"\nexpected: 9.0\nactual: 27.0\""), - // Rem + one("meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_", "\"\nexpected: 0.14D\nactual: 0.14\""), one("meta::pure::functions::math::tests::rem::testRemInEvalWithNegativeNumbers_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), one("meta::pure::functions::math::tests::rem::testRemInEval_Function_1__Boolean_1_", "\"Unused format args. [3] arguments provided to expression \"mod(%s,%s)\"\""), - one("meta::pure::functions::math::tests::rem::testRemWithDecimals_Function_1__Boolean_1_", "\"\nexpected: 0.14D\nactual: 0.14\""), // Round one("meta::pure::functions::math::tests::round::testNegativeFloatRoundHalfEvenUp_Function_1__Boolean_1_", "\"\nexpected: -16\nactual: -17\""), @@ -222,7 +218,7 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC // Is one("meta::pure::functions::boolean::tests::testIsEnum_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'is_Any_1__Any_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::boolean::tests::testIsNonPrimitive_Function_1__Boolean_1_", "\"Match failure: StoreMappingClusteredValueSpecificationObject instanceOf StoreMappingClusteredValueSpecification\""), + one("meta::pure::functions::boolean::tests::testIsNonPrimitive_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::boolean::is(SideClass[*],SideClass[*])'"), one("meta::pure::functions::boolean::tests::testIsPrimitive_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'is_Any_1__Any_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // At @@ -231,7 +227,7 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::collection::tests::at::testAt_Function_1__Boolean_1_", "\"->at(...) function is supported only after direct access of 1->MANY properties. Current expression: ['a', 'b', 'c'] -> at(0)\""), // RemoveDuplicates - one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyListExplicit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyListExplicit_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::string::toString(?)'"), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesEmptyList_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesPrimitiveNonStandardFunction_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::collection::tests::removeDuplicates::testRemoveDuplicatesPrimitiveStandardFunctionExplicit_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -239,12 +235,12 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::collection::tests::removeDuplicatesBy::testRemoveDuplicatesByPrimitive_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'removeDuplicates_T_MANY__Function_$0_1$__Function_$0_1$__T_MANY_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), //Date - one("meta::pure::functions::date::tests::testAdjustByDaysBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByHoursBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::date::tests::testAdjustByDaysBigNumber_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: Numeric value '12345678912' is out of range"), + one("meta::pure::functions::date::tests::testAdjustByHoursBigNumber_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: Numeric value '12345678912' is out of range"), one("meta::pure::functions::date::tests::testAdjustByMicrosecondsBigNumber_Function_1__Boolean_1_", "\"\nexpected: %2021-06-21T09:37:37.4990000+0000\nactual: %2021-06-21T09:37:37.499+0000\""), one("meta::pure::functions::date::tests::testAdjustByMinutesBigNumber_Function_1__Boolean_1_", "\"\nexpected: %-21457-01-08T20:48:00+0000\nactual: %21458-01-18T17:39:38+0000\""), - one("meta::pure::functions::date::tests::testAdjustByMonthsBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustReflectiveEvaluation_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'eval_Function_1__T_n__U_p__W_q__V_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::date::tests::testAdjustByMonthsBigNumber_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: Numeric value '12345678912' is out of range"), + one("meta::pure::functions::date::tests::testAdjustReflectiveEvaluation_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::eval(?)'"), one("meta::pure::functions::date::tests::testDateFromDay_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__StrictDate_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testDateFromHour_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__Integer_1__DateTime_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testDateFromMinute_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'date_Integer_1__Integer_1__Integer_1__Integer_1__Integer_1__DateTime_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), @@ -260,50 +256,52 @@ public class Test_Relational_Snowflake_EssentialFunctions_PCT extends PCTReportC one("meta::pure::functions::date::tests::testHasSecond_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSecond_Date_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testHasSubsecondWithAtLeastPrecision_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSubsecondWithAtLeastPrecision_Date_1__Integer_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::date::tests::testHasSubsecond_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'hasSubsecond_Date_1__Boolean_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::date::tests::testAdjustByMonths_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testAdjustByWeeksBigNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::date::tests::testAdjustByYears_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testAdjustByMonths_Function_1__Boolean_1_", "Date has no day: 2012-03"), + one("meta::pure::functions::date::tests::testAdjustByWeeksBigNumber_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: Numeric value '12345678912' is out of range"), + one("meta::pure::functions::date::tests::testAdjustByYears_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::date::tests::testDateDiffWeeks_Function_1__Boolean_1_", "\"\nexpected: 1\nactual: 0\""), - one("meta::pure::functions::date::tests::testDateDiffYears_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDatePartYearMonthOnly_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testDatePartYearOnly_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testDateDiffYears_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), + one("meta::pure::functions::date::tests::testDatePartYearMonthOnly_Function_1__Boolean_1_", "Date has no day: 1973-11"), + one("meta::pure::functions::date::tests::testDatePartYearOnly_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::date::tests::testHour_Function_1__Boolean_1_", "\"\nexpected: 17\nactual: 0\""), one("meta::pure::functions::date::tests::testMinute_Function_1__Boolean_1_", "\"\nexpected: 9\nactual: 0\""), - one("meta::pure::functions::date::tests::testMonthNumber_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), - one("meta::pure::functions::date::tests::testYear_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::date::tests::testMonthNumber_Function_1__Boolean_1_", "Date has no day: 2015-04"), + one("meta::pure::functions::date::tests::testYear_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), // MultiIf - one("meta::pure::functions::lang::tests::if::testMultiIf_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::lang::tests::if::testMultiIf_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/essential/lang/flow/if.pure:58cc29-32); error compiling generated Java code:"), // Match - one("meta::pure::functions::lang::tests::match::testMatchManyWithMany_Function_1__Boolean_1_", "\"Match only supports operands with multiplicity [1]..! Current operand : ['w', 'w', 'w']\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWithMany_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWithZeroOne_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchOneWith_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithExtraParam_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'match_Any_MANY__Function_$1_MANY$__P_o__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::lang::tests::match::testMatchWithExtraParamsAndFunctionsAsParam_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'match_Any_MANY__Function_$1_MANY$__P_o__T_m_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParamManyMatch_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParam_Function_1__Boolean_1_", "\"Cast exception: Literal cannot be cast to SemiStructuredPropertyAccess\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsManyMatch_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchWithFunctions_Function_1__Boolean_1_", "\"Cast exception: Literal cannot be cast to SemiStructuredPropertyAccess\""), + one("meta::pure::functions::lang::tests::match::testMatchManyWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWithZeroOne_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchOneWith_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithExtraParam_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::match(?)'"), + one("meta::pure::functions::lang::tests::match::testMatchWithExtraParamsAndFunctionsAsParam_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::lang::match(?)'"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParamManyMatch_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsAsParam_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctionsManyMatch_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchWithFunctions_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'a' in the graph"), one("meta::pure::functions::lang::tests::match::testMatchWithMixedReturnType_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::lang::tests::match::testMatchZeroWithMany_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), - one("meta::pure::functions::lang::tests::match::testMatchZeroWithZero_Function_1__Boolean_1_", "\"Match does not support Non-Primitive return type..! Current return type : Any\""), + one("meta::pure::functions::lang::tests::match::testMatchZeroWithMany_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), + one("meta::pure::functions::lang::tests::match::testMatchZeroWithZero_Function_1__Boolean_1_", "Error in 'test::lambdaContainer__Any_MANY_': Can't find variable class for variable 'i' in the graph"), one("meta::pure::functions::lang::tests::match::testMatch_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), + // Pow + one("meta::pure::functions::math::tests::pow::testNumberPow_Function_1__Boolean_1_", "\"\nexpected: 9.0\nactual: 27.0\""), + // Abs - one("meta::pure::functions::math::tests::abs::testDecimalAbs_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'abs_Decimal_1__Decimal_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::math::tests::abs::testDecimalAbs_Function_1__Boolean_1_", "\"\nexpected: 3.0D\nactual: 3D\""), // IndexOf one("meta::pure::functions::string::tests::indexOf::testFromIndex_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'indexOf_String_1__String_1__Integer_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::string::tests::indexOf::testSimple_Function_1__Boolean_1_", "\"\nexpected: 4\nactual: 5\""), // ParseDate - one("meta::pure::functions::string::tests::parseDate::testParseDateTypes_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::string::tests::parseDate::testParseDateWithTimezone_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::string::tests::parseDate::testParseDateWithZ_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::string::tests::parseDate::testParseDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - + one("meta::pure::functions::string::tests::parseDate::testParseDateTypes_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: Can't parse '2014-02-27T00:00:00.000000' as timestamp with format 'YYYY-MM-DD HH24:MI:SS'"), + one("meta::pure::functions::string::tests::parseDate::testParseDateWithTimezone_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: Can't parse '2014-02-27T10:01:35.231-0500' as timestamp with format 'YYYY-MM-DD HH24:MI:SS'"), + one("meta::pure::functions::string::tests::parseDate::testParseDateWithZ_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: Can't parse '2014-02-27T10:01:35.231Z' as timestamp with format 'YYYY-MM-DD HH24:MI:SS'"), + one("meta::pure::functions::string::tests::parseDate::testParseDate_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: Can't parse '2014-02-27T10:01:35.231' as timestamp with format 'YYYY-MM-DD HH24:MI:SS'"), // ParseDecimal one("meta::pure::functions::string::tests::parseDecimal::testParseDecimal_Function_1__Boolean_1_", "\"[unsupported-api] The function 'parseDecimal' (state: [Select, false]) is not supported yet\""), one("meta::pure::functions::string::tests::parseDecimal::testParseZero_Function_1__Boolean_1_", "\"[unsupported-api] The function 'parseDecimal' (state: [Select, false]) is not supported yet\"") diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_GrammarFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_GrammarFunctions_PCT.java index 3df3f2e37af..5574c3ed9da 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_GrammarFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_GrammarFunctions_PCT.java @@ -40,15 +40,15 @@ public class Test_Relational_Snowflake_GrammarFunctions_PCT extends PCTReportCon one("meta::pure::functions::boolean::tests::conjunctions::not::testNotInCollection_Function_1__Boolean_1_", "\"->at(...) function is supported only after direct access of 1->MANY properties. Current expression: [false, false -> not()] -> at(1)\""), // Eq - one("meta::pure::functions::boolean::tests::equality::eq::testEqDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqDate_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::boolean::tests::equality::eq::testEqEnum_Function_1__Boolean_1_", "\"Assert failed\""), - one("meta::pure::functions::boolean::tests::equality::eq::testEqNonPrimitive_Function_1__Boolean_1_", "\"Left multiplicity error. Please use 'exists' instead of '==' in the expression: [1 SideClass/].all() == [1 SideClass/].all()\""), + one("meta::pure::functions::boolean::tests::equality::eq::testEqNonPrimitive_Function_1__Boolean_1_", "Can't find a match for function 'meta::pure::functions::boolean::eq(SideClass[*],SideClass[*])'"), one("meta::pure::functions::boolean::tests::equality::eq::testEqVarIdentity_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 1 where the collection is of size 1\""), // Equal - one("meta::pure::functions::boolean::tests::equality::equal::testEqualDate_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_NoCounter, Anonymous_NoCounter, false]\""), + one("meta::pure::functions::boolean::tests::equality::equal::testEqualDateStrictYear_Function_1__Boolean_1_", "\"Ensure the target system understands Year or Year-month semantic.\""), one("meta::pure::functions::boolean::tests::equality::equal::testEqualEnum_Function_1__Boolean_1_", "\"Assert failed\""), - one("meta::pure::functions::boolean::tests::equality::equal::testEqualNonPrimitive_Function_1__Boolean_1_", "\"Left multiplicity error. Please use 'exists' instead of '==' in the expression: [1 SideClass/].all() == [1 SideClass/].all()\""), + one("meta::pure::functions::boolean::tests::equality::equal::testEqualNonPrimitive_Function_1__Boolean_1_", "\"Filter expressions are only supported for Primitives and Enums. Filter contains a parameter of type SideClass\""), one("meta::pure::functions::boolean::tests::equality::equal::testEqualVarIdentity_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 1 where the collection is of size 1\""), // GreaterThan @@ -58,20 +58,20 @@ public class Test_Relational_Snowflake_GrammarFunctions_PCT extends PCTReportCon one("meta::pure::functions::boolean::tests::inequalities::greaterThanEqual::testGreaterThanEqual_Boolean_Function_1__Boolean_1_", "\"Assert failed\""), // Filter - one("meta::pure::functions::collection::tests::filter::testFilterInstance_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::filter::testFilterInstance_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/filter.pure:49cc46-50); error compiling generated Java code:"), one("meta::pure::functions::collection::tests::filter::testFilterLiteralFromVar_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::filter::testFilterLiteral_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), one("meta::pure::functions::collection::tests::filter::testLambdaAsFunctionParameter_Function_1__Boolean_1_", "\"Cannot cast a collection of size 3 to multiplicity [1]\""), // First - one("meta::pure::functions::collection::tests::first::testFirstComplex_Function_1__Boolean_1_", "\"The system is trying to get an element at offset 0 where the collection is of size 0\""), + one("meta::pure::functions::collection::tests::first::testFirstComplex_Function_1__Boolean_1_", "\"Expected at most one object, but found many\""), one("meta::pure::functions::collection::tests::first::testFirstOnEmptySet_Function_1__Boolean_1_", "\"Cast exception: SelectSQLQuery cannot be cast to TdsSelectSqlQuery\""), one("meta::pure::functions::collection::tests::first::testFirstSimple_Function_1__Boolean_1_", "\"Cannot cast a collection of size 2 to multiplicity [1]\""), // Map one("meta::pure::functions::collection::tests::map::testMapInstance_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToMany_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToOne_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToMany_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:63cc79-83); error compiling generated Java code:"), + one("meta::pure::functions::collection::tests::map::testMapRelationshipFromManyToOne_Function_1__Boolean_1_", "Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:52cc64-68); error compiling generated Java code:"), one("meta::pure::functions::collection::tests::map::testMapRelationshipFromOneToOne_Function_1__Boolean_1_", "\"Error during dynamic reactivation: Error dynamically evaluating value specification (from /platform/pure/grammar/functions/collection/iteration/map.pure:43cc92-98); error compiling generated Java code:\nimport org.eclipse.collections.api.LazyIterable;\nimport org.eclipse.collections.api.block.function.Function0;\nimport org.eclipse.collections.api.block.function.Function;\nimport org.eclipse.collections.api.block.function.Function2;\nimport org.eclipse.collections.api.block.predicate.Predicate;\nimport org.eclipse.collections.api.block.procedure.Procedure;\nimport org.eclipse.collections.api.map.ImmutableMap;\nimport org.eclipse.collections.api.map.MutableMap;\nimport org.eclipse.collections.api.map.MutableMapIterable;\nimport org.eclipse.collections.api.map.MapIterable;\nimport org.eclipse.collections.api.map.primitive.IntObjectMap;\nimport org.eclipse.collections.api.set.MutableSet;\nimport org.eclipse.collections.api.set.SetIterable;\nimport org.eclipse.collections.api.list.MutableList;\nimport org.eclipse.collections.api.list.ListIterable;\nimport org.eclipse.collections.api.RichIterable;\nimport org.eclipse.collections.api.tuple.Pair;\nimport org.eclipse.collections.impl.factory.Lists;\nimport org.eclipse.collections.impl.factory.Maps;\nimport org.eclipse.collections.impl.map.mutable.UnifiedMap;\nimport org.eclipse.collections.impl.map.strategy.mutable.UnifiedMapWithHashingStrategy;\nimport org.eclipse.collections.impl.set.mutable.UnifiedSet;\nimport org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy;\nimport org.eclipse.collections.impl.list.mutable.FastList;\nimport org.eclipse.collections.impl.factory.Sets;\nimport org.eclipse.collections.impl.block.function.checked.CheckedFunction0;\nimport org.eclipse.collections.impl.utility.Iterate;\nimport org.eclipse.collections.impl.utility.LazyIterate;\nimport org.eclipse.collections.impl.utility.StringIterate;\nimport org.finos.legend.pure.m3.navigation.generictype.GenericType;\nimport org.finos.legend.pure.m3.navigation.ProcessorSupport;\nimport org.finos.legend.pure.m3.execution.ExecutionSupport;\nimport org.finos.legend.pure.m3.exception.PureExecutionException;\nimport org.finos.legend.pure.m4.coreinstance.CoreInstance;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.PureDate;\nimport org.finos.legend.pure.m4.coreinstance.primitive.date.DateFunctions;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.map.*;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangeType;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.ChangedPath;\nimport org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.vcs.Revision;\nimport org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement;\nimport org.finos.legend.pure.m3.tools.ListHelper;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.defended.*;\nimport org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.*;\nimport org.finos.legend.pure.runtime.java.compiled.execution.sourceInformation.*;\nimport org.finos.legend.pure.runtime.java.compiled.serialization.model.*;\nimport org.finos.legend.pure.runtime.java.compiled.metadata.*;\nimport java.lang.reflect.Method;\nimport java.math.BigInteger;\nimport java.sql.DatabaseMetaData;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSetMetaData;\nimport java.util.Iterator;\nimport java.util.Calendar;\nimport java.util.Map;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport org.json.simple.JSONObject;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization;\nimport org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type;\n\n\npublic class DynaClass{\n public static org.finos.legend.pure.generated.Root_meta_pure_functions_collection_tests_map_model_M_Address doProcess(final MapIterable vars, final MutableMap valMap, final IntObjectMap localLambdas, final ExecutionSupport es){\n return _address;\n }\n}\n\""), // Range @@ -90,29 +90,28 @@ public class Test_Relational_Snowflake_GrammarFunctions_PCT extends PCTReportCon one("meta::pure::functions::lang::tests::compare::testDateCompare_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'compare_T_1__T_1__Integer_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), // Divide - one("meta::pure::functions::math::tests::divide::testDecimalDivide_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'divide_Decimal_1__Decimal_1__Integer_1__Decimal_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), one("meta::pure::functions::math::tests::divide::testDivideWithNonTerminatingExpansion_Function_1__Boolean_1_", "\"\nexpected: 0.010416666666666666\nactual: 0.010417\""), // Minus - one("meta::pure::functions::math::tests::minus::testDecimalMinus_Function_1__Boolean_1_", "\"\nexpected: -4.0D\nactual: -4.0\""), - one("meta::pure::functions::math::tests::minus::testLargeMinus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::minus::testDecimalMinus_Function_1__Boolean_1_", "\"\nexpected: -4.0D\nactual: -4D\""), + one("meta::pure::functions::math::tests::minus::testLargeMinus_Function_1__Boolean_1_", "For input string: \"-9223372036854775850\""), one("meta::pure::functions::math::tests::minus::testSingleMinusType_Function_1__Boolean_1_", "\"Cast exception: StoreRoutingStrategy cannot be cast to StoreMappingRoutingStrategy\""), - one("meta::pure::functions::math::tests::minus::testSingleMinus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::minus::testSingleMinus_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error:\nsyntax error line 1 at position 10 unexpected ''."), // Plus - one("meta::pure::functions::math::tests::plus::testDecimalPlus_Function_1__Boolean_1_", "\"\nexpected: 6.0D\nactual: 6.0\""), - one("meta::pure::functions::math::tests::plus::testLargePlus_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::plus::testDecimalPlus_Function_1__Boolean_1_", "\"\nexpected: 6.0D\nactual: 6D\""), + one("meta::pure::functions::math::tests::plus::testLargePlus_Function_1__Boolean_1_", "For input string: \"9223372036854775826\""), one("meta::pure::functions::math::tests::plus::testSinglePlusType_Function_1__Boolean_1_", "\"Cast exception: StoreRoutingStrategy cannot be cast to StoreMappingRoutingStrategy\""), one("meta::pure::functions::math::tests::plus::testPlusNumber_Function_1__Boolean_1_", "\"\nexpected: 32.0\nactual: 32\""), // Times one("meta::pure::functions::math::tests::times::testDecimalTimes_Function_1__Boolean_1_", "\"\nexpected: 353791.470D\nactual: 353791.47\""), - one("meta::pure::functions::math::tests::times::testLargeTimes_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::times::testLargeTimes_Function_1__Boolean_1_", "For input string: \"18446744073709551614\""), // Plus (String) one("meta::pure::functions::string::tests::plus::testMultiPlusWithPropertyExpressions_Function_1__Boolean_1_", "\"Cannot cast a collection of size 0 to multiplicity [1]\""), - one("meta::pure::functions::string::tests::plus::testPlusInCollect_Function_1__Boolean_1_", "\"Error mapping not found for class P_Person cache:''\""), - one("meta::pure::functions::string::tests::plus::testPlusInIterate_Function_1__Boolean_1_", "\"Error mapping not found for class P_Person cache:''\""), + one("meta::pure::functions::string::tests::plus::testPlusInCollect_Function_1__Boolean_1_", "\"No SQL translation exists for the PURE function 'at_T_MANY__Integer_1__T_1_'. \nIf you would like to add a SQL translation for the function then follow the step-by-step guide on the PURE wiki.\""), + one("meta::pure::functions::string::tests::plus::testPlusInIterate_Function_1__Boolean_1_", "\"Match failure: StoreMappingClusteredValueSpecificationObject instanceOf StoreMappingClusteredValueSpecification\""), // Let one("meta::pure::functions::lang::tests::letFn::testAssignLiteralToVariable_Function_1__Boolean_1_", "\"Cannot cast a collection of size 2 to multiplicity [1]\""), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_RelationFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_RelationFunctions_PCT.java index 50cbd90e23c..6f804c56854 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_RelationFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_RelationFunctions_PCT.java @@ -37,8 +37,17 @@ public class Test_Relational_Snowflake_RelationFunctions_PCT extends PCTReportCo private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // Extend - OLAP - one("meta::pure::functions::relation::tests::select::testSingleSelectWithQuotedColumn_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") - ); + one("meta::pure::functions::relation::tests::select::testSingleSelectWithQuotedColumn_Function_1__Boolean_1_", "Error while executing: Create Table leSchema.tb"), + + // Snowflake doesn't support ListAgg as an olap aggregation + one("meta::pure::functions::relation::tests::extend::testOLAPAggStringWithPartitionAndOrderWindow_Function_1__Boolean_1_", "Cumulative window frame unsupported for function LISTAGG"), + one("meta::pure::functions::relation::tests::extend::testOLAPAggWithPartitionAndOrderWindowMultipleColumns_Function_1__Boolean_1_", "Cumulative window frame unsupported for function LISTAGG"), + + // Snowflake doesn't seem to comply to the specification for first, last, nth (they should be bound to the frame) + one("meta::pure::functions::relation::tests::last::testOLAPWithPartitionAndOrderLastWindow_Function_1__Boolean_1_", "\"\nexpected: '#TDS\n id,grp,name,newCol\n 10,0,J,10\n 8,1,H,8\n 6,1,F,6\n 2,1,B,2\n 5,2,E,5\n 1,2,A,1\n 7,3,G,7\n 3,3,C,3\n 4,4,D,4\n 9,5,I,9\n#'\nactual: '#TDS\n id,grp,name,newCol\n 10,0,J,10\n 8,1,H,2\n 6,1,F,2\n 2,1,B,2\n 5,2,E,1\n 1,2,A,1\n 7,3,G,3\n 3,3,C,3\n 4,4,D,4\n 9,5,I,9\n#'\""), + one("meta::pure::functions::relation::tests::nth::testOLAPWithPartitionAndOrderNthWindow2_Function_1__Boolean_1_", "\"\nexpected: '#TDS\n id,grp,name,newCol\n 10,0,J,null\n 8,1,H,null\n 6,1,F,6\n 2,1,B,6\n 5,2,E,null\n 1,2,A,1\n 7,3,G,null\n 3,3,C,3\n 4,4,D,null\n 9,5,I,null\n#'\nactual: '#TDS\n id,grp,name,newCol\n 10,0,J,null\n 8,1,H,6\n 6,1,F,6\n 2,1,B,6\n 5,2,E,1\n 1,2,A,1\n 7,3,G,3\n 3,3,C,3\n 4,4,D,null\n 9,5,I,null\n#'\"") + + ); public static Test suite() { diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_StandardFunctions_PCT.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_StandardFunctions_PCT.java index 4a5ea9b4f1f..68cf1140def 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_StandardFunctions_PCT.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-dbExtension/legend-engine-xt-relationalStore-snowflake/legend-engine-xt-relationalStore-snowflake-PCT/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/test/snowflake/pct/Test_Relational_Snowflake_StandardFunctions_PCT.java @@ -37,18 +37,18 @@ public class Test_Relational_Snowflake_StandardFunctions_PCT extends PCTReportCo private static final String platform = "compiled"; private static final MutableList expectedFailures = Lists.mutable.with( // StD Dev - one("meta::pure::functions::math::tests::stdDev::testFloatStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testIntStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testMixedStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testNegativeNumberStdDev_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::stdDev::testPopulationStandardDeviation_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), + one("meta::pure::functions::math::tests::stdDev::testFloatStdDev_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 12\nInvalid argument types for function '*': (ARRAY, ARRAY)"), + one("meta::pure::functions::math::tests::stdDev::testIntStdDev_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 12\nInvalid argument types for function '*': (ARRAY, ARRAY)"), + one("meta::pure::functions::math::tests::stdDev::testMixedStdDev_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 12\nInvalid argument types for function '*': (ARRAY, ARRAY)"), + one("meta::pure::functions::math::tests::stdDev::testNegativeNumberStdDev_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 12\nInvalid argument types for function '*': (ARRAY, ARRAY)"), + one("meta::pure::functions::math::tests::stdDev::testPopulationStandardDeviation_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 12\nInvalid argument types for function '*': (ARRAY, ARRAY)"), // Variance - one("meta::pure::functions::math::tests::variance::testVariancePopulation_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVarianceSample_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVariance_Population_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\""), - one("meta::pure::functions::math::tests::variance::testVariance_Sample_Function_1__Boolean_1_", "\"Unexpected error executing function with params [Anonymous_Lambda]\"") - ); + one("meta::pure::functions::math::tests::variance::testVariancePopulation_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 7\nInvalid argument types for function '*': (ARRAY, ARRAY)"), + one("meta::pure::functions::math::tests::variance::testVarianceSample_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 7\nInvalid argument types for function '*': (ARRAY, ARRAY)"), + one("meta::pure::functions::math::tests::variance::testVariance_Population_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 7\nInvalid argument types for function '*': (ARRAY, ARRAY)"), + one("meta::pure::functions::math::tests::variance::testVariance_Sample_Function_1__Boolean_1_", "net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: error line 1 at position 7\nInvalid argument types for function '*': (ARRAY, ARRAY)") + ); public static Test suite() { 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/HelperRelationalBuilder.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/HelperRelationalBuilder.java index 88351311ba9..db9d45379a9 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/HelperRelationalBuilder.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/HelperRelationalBuilder.java @@ -109,6 +109,7 @@ import org.finos.legend.pure.generated.Root_meta_relational_metamodel_relation_Table_Impl; import org.finos.legend.pure.generated.Root_meta_relational_metamodel_relation_View_Impl; import org.finos.legend.pure.generated.core_pure_model_modelUnit; +import org.finos.legend.pure.m2.relational.M2RelationalPaths; import org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestoningFunctions; import org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestoningStereotype; import org.finos.legend.pure.m3.coreinstance.meta.pure.functions.collection.Pair; @@ -157,6 +158,7 @@ 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.coreinstance.meta.relational.metamodel.relation.View; +import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement; import org.finos.legend.pure.m4.coreinstance.CoreInstance; import org.finos.legend.pure.m4.coreinstance.primitive.date.PureDate; @@ -610,7 +612,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.jo MutableList selfJoinTargets = Lists.mutable.empty(); Operation op = (Operation) processRelationalOperationElement(srcJoin.operation, context, aliasMap, selfJoinTargets); MutableList aliases = Lists.mutable.withAll(aliasMap.values()); - Join join = new Root_meta_relational_metamodel_join_Join_Impl(srcJoin.name, SourceInformationHelper.toM3SourceInformation(srcJoin.sourceInformation), null) + Join join = new Root_meta_relational_metamodel_join_Join_Impl(srcJoin.name, SourceInformationHelper.toM3SourceInformation(srcJoin.sourceInformation), context.pureModel.getClass(M2RelationalPaths.Join)) ._name(srcJoin.name); if (aliases.size() == 2) { @@ -657,9 +659,20 @@ public static org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.jo selfJoinTarget._column(col); } } - join._aliases(Lists.fixedSize.of(new Root_meta_pure_functions_collection_Pair_Impl("")._first(aliases.get(0))._second(aliases.get(1)), - new Root_meta_pure_functions_collection_Pair_Impl("")._first(aliases.get(1))._second(aliases.get(0)))) - ._database(database) + GenericType gt = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass(M3Paths.GenericType)) + ._rawType(context.pureModel.getType(M3Paths.Pair)) + ._typeArguments(Lists.mutable.with(context.pureModel.getGenericType(M2RelationalPaths.TableAlias),context.pureModel.getGenericType(M2RelationalPaths.TableAlias))); + join._aliases(Lists.fixedSize.of( + new Root_meta_pure_functions_collection_Pair_Impl("", null, context.pureModel.getClass(M3Paths.Pair)) + ._classifierGenericType(gt) + ._first(aliases.get(0)) + ._second(aliases.get(1)), + new Root_meta_pure_functions_collection_Pair_Impl("", null, context.pureModel.getClass(M3Paths.Pair)) + ._classifierGenericType(gt) + ._first(aliases.get(1)) + ._second(aliases.get(0)) + ) + )._database(database) ._operation(op); return join; } @@ -822,18 +835,18 @@ private static JoinTreeNode buildElementWithJoinsJoinTreeNode(List MutableList newJoins = ListIterate.collect(joins, joinPointer -> new JoinWithJoinType( getJoin(joinPointer, context), joinPointer.joinType == null ? null : context.pureModel.getEnumValue("meta::relational::metamodel::join::JoinType", "INNER".equals(joinPointer.joinType) ? "INNER" : "LEFT_OUTER"))); - return processElementWithJoinsJoins(newJoins); + return processElementWithJoinsJoins(newJoins, context); } - private static JoinTreeNode processElementWithJoinsJoins(MutableList joins) + private static JoinTreeNode processElementWithJoinsJoins(MutableList joins, CompileContext context) { Join j = joins.getFirst().join; - JoinTreeNode res = new Root_meta_relational_metamodel_join_JoinTreeNode_Impl(j._name()) + JoinTreeNode res = new Root_meta_relational_metamodel_join_JoinTreeNode_Impl(j._name(), null, context.pureModel.getClass(M2RelationalPaths.JoinTreeNode)) ._joinName(j._name()) ._database(j._database()) ._join(j); res = joins.getFirst().joinType == null ? res : res._joinType(joins.getFirst().joinType); - return joins.size() == 1 ? res : res._childrenData(Lists.fixedSize.of(processElementWithJoinsJoins(joins.subList(1, joins.size())))); + return joins.size() == 1 ? res : res._childrenData(Lists.fixedSize.of(processElementWithJoinsJoins(joins.subList(1, joins.size()), context))); } private static class JoinWithJoinType 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 d376c6f2990..d4aabc2db4d 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 @@ -138,6 +138,7 @@ 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; @@ -851,7 +852,7 @@ else if (c instanceof Bit) { primitiveType = "Boolean"; } - else if (c instanceof Double) + else if (c instanceof Double || c instanceof Float) { primitiveType = "Float"; } diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/pureToSQLQuery/pureToSQLQuery.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/pureToSQLQuery/pureToSQLQuery.pure index dc90c191d80..81fa3a2ece5 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/pureToSQLQuery/pureToSQLQuery.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/pureToSQLQuery/pureToSQLQuery.pure @@ -2915,7 +2915,6 @@ function meta::relational::functions::pureToSqlQuery::processTdsWindowColumn( window = ^meta::relational::metamodel::Window(partition=$windowElement, sortBy=$sortElement, sortDirection=$sortDirection) ); - //let aggOperation = $aggSpec->reprocessVS()->reactivate($state.inScopeVars)->evaluateAndDeactivate(); let func = $aggSpec->match( [ o:OlapOperation[1] | processTdsOlapOperation($o, ^$operation(select=$mainSelect),$vars,$currentPropertyMapping,$state,$context);, @@ -3513,7 +3512,17 @@ function meta::relational::functions::pureToSqlQuery::processWindowFunction(f:Fu ^DynaFunction(name = 'PLACEHOLDER') } +function meta::relational::functions::pureToSqlQuery::processDivideRound(f:FunctionExpression[1], currentPropertyMapping:PropertyMapping[*], operation:SelectWithCursor[1], vars:Map[1], state:State[1], joinType:JoinType[1], nodeId:String[1], aggFromMap:List[1], context:DebugContext[1], extensions:Extension[*]):RelationalOperationElement[1] +{ + processDynaFunction('divideRound', $f, $currentPropertyMapping, $operation, $vars, $state, $joinType, $nodeId, $aggFromMap, $context, $extensions); +} + function meta::relational::functions::pureToSqlQuery::processDynaFunction(f:FunctionExpression[1], currentPropertyMapping:PropertyMapping[*], operation:SelectWithCursor[1], vars:Map[1], state:State[1], joinType:JoinType[1], nodeId:String[1], aggFromMap:List[1], context:DebugContext[1], extensions:Extension[*]):RelationalOperationElement[1] +{ + processDynaFunction($f.func.functionName->toOne(), $f, $currentPropertyMapping, $operation, $vars, $state, $joinType, $nodeId, $aggFromMap, $context, $extensions); +} + +function meta::relational::functions::pureToSqlQuery::processDynaFunction(name:String[1], f:FunctionExpression[1], currentPropertyMapping:PropertyMapping[*], operation:SelectWithCursor[1], vars:Map[1], state:State[1], joinType:JoinType[1], nodeId:String[1], aggFromMap:List[1], context:DebugContext[1], extensions:Extension[*]):RelationalOperationElement[1] { let isIfTrueFalseStmt = $f.func == if_Boolean_1__Function_1__Function_1__T_m_ || $state.inIf == true; let paramIsIfTrueFalseStmt = {paramIndex:Integer[1]|$state.inIf == true && $paramIndex->in([1,2])}; @@ -3534,7 +3543,7 @@ function meta::relational::functions::pureToSqlQuery::processDynaFunction(f:Func | $parameterSQL ); let nsqls = - if($f.func.functionName->toOne() != 'or', + if($name != 'or', |$sqls, |$sqls->map(s|$s->moveExtraFilterToFilter($extensions)) ); @@ -3544,10 +3553,10 @@ function meta::relational::functions::pureToSqlQuery::processDynaFunction(f:Func let res = ^$operation(select = $state.inFilter->if( | let unSupportedBiTemporalProcessing = $mergedSQL.filteringOperation->isEmpty() && $operation.milestoningContext->isNotEmpty() && $operation.milestoningContext->toOne()->isBiTemporalMilestoningTopLevelAnd($f.func); if($unSupportedBiTemporalProcessing ,| $mergedSQL - ,| ^$mergedSQL(filteringOperation = newDynaFunction($f.func.functionName->toOne(), if($parameterSQL->isEmpty(), | [], |$mergedSQL.filteringOperation))));, + ,| ^$mergedSQL(filteringOperation = newDynaFunction($name, if($parameterSQL->isEmpty(), | [], |$mergedSQL.filteringOperation))));, | ^$mergedSQL ( - columns = newDynaFunction($f.func.functionName->toOne(), $mergedSQL.columns) + columns = newDynaFunction($name, $mergedSQL.columns) ) ), currentTreeNode = [], @@ -4643,17 +4652,26 @@ function meta::relational::functions::pureToSqlQuery::processInWithJoin(leftSide | ^$leftSide(select=^$leftSideSelect(columns=$subSelectWithExists))); } +function meta::relational::functions::pureToSqlQuery::replaceVariableByValues(vs:ValueSpecification[1], vals:Map[1]):ValueSpecification[1] +{ + $vs->match([e:StoreMappingRoutedValueSpecification[1]|$e.value,v:ValueSpecification[1]|$v])->match( + [ + x : FunctionExpression[1] | ^$x(parametersValues=$x.parametersValues->evaluateAndDeactivate()->map(z|$z->replaceVariableByValues($vals))), + z : VariableExpression[1] | let var = $vals->get($z.name); + if ($var->isEmpty(),|$z,|$var->toOne());, + x : ValueSpecification[1] | $x + ] + ); +} + function meta::relational::functions::pureToSqlQuery::processEvaluate(expression:FunctionExpression[1], currentPropertyMapping:PropertyMapping[*], operation:SelectWithCursor[1], vars:Map[1], state:State[1], joinType:JoinType[1], nodeId:String[1], aggFromMap:List[1], context:DebugContext[1], extensions:Extension[*]):RelationalOperationElement[1] { if($expression.parametersValues->size() == 1, - | - processValueSpecification($expression.parametersValues->at(0), $currentPropertyMapping, $operation, $vars, $state, $joinType, $nodeId, $aggFromMap, $context, $extensions)->toOne(); - , - | - let filterFunctionExpression = $expression.parametersValues->at(0)->byPassRouterInfo()->cast(@InstanceValue).values->at(0)->match( + | processValueSpecification($expression.parametersValues->at(0), $currentPropertyMapping, $operation, $vars, $state, $joinType, $nodeId, $aggFromMap, $context, $extensions)->toOne();, + | let filterFunctionExpression = $expression.parametersValues->at(0)->byPassRouterInfo()->cast(@InstanceValue).values->at(0)->match( [ f:FunctionDefinition[1]| - $f.expressionSequence->at(0);, + $f.expressionSequence->at(0),//->replaceVariableByValues(newMap($f->functionType().parameters.name->zip($expression.parametersValues->tail())));, n:NativeFunction[1]| ^FunctionExpression ( @@ -4666,8 +4684,8 @@ function meta::relational::functions::pureToSqlQuery::processEvaluate(expression ] ); let operationWithoutFilter = $operation->removeFilteringOperation(); - let rightSide = processValueSpecification($expression.parametersValues->at(1), $currentPropertyMapping, $operationWithoutFilter, $vars, $state, JoinType.LEFT_OUTER, $nodeId, $aggFromMap, $context, $extensions)->toOne(); - processValueSpecification($filterFunctionExpression, $currentPropertyMapping, $rightSide->extractSelectWithCursor($operationWithoutFilter), $vars, $state, JoinType.LEFT_OUTER, $nodeId, $aggFromMap, $context, $extensions)->toOne(); + let rightSide = processValueSpecification($expression.parametersValues->at(1), $currentPropertyMapping, $operationWithoutFilter, $vars, $state, JoinType.LEFT_OUTER, $nodeId, $aggFromMap, $context, $extensions)->toOne(); + processValueSpecification($filterFunctionExpression, $currentPropertyMapping, $rightSide->extractSelectWithCursor($operationWithoutFilter), $vars, $state, JoinType.LEFT_OUTER, $nodeId, $aggFromMap, $context, $extensions)->toOne(); ); } @@ -5521,7 +5539,8 @@ function meta::relational::functions::pureToSqlQuery::processTdsLambda(mapFn:Val $mapFn->match( [ r:FunctionRoutedValueSpecification[1]|$r.value->processTdsLambda($a,$returnColumnName, $vars, $state, $currentPropertyMapping, $paths, $context), - f:FunctionExpression[1]| + fx:FunctionExpression[1]| + let f = $fx->meta::pure::functions::meta::removeAutomap()->cast(@FunctionExpression); if ($f.func->instanceOf(meta::pure::metamodel::relation::Column), | let foundColumn = $a->filter(alias| $alias->match( @@ -8342,6 +8361,7 @@ function meta::relational::functions::pureToSqlQuery::getSupportedFunctions():Ma ^PureFunctionToRelationalFunctionPair(first=meta::pure::functions::math::abs_Number_1__Number_1_,second=meta::relational::functions::pureToSqlQuery::processDynaFunction_FunctionExpression_1__PropertyMapping_MANY__SelectWithCursor_1__Map_1__State_1__JoinType_1__String_1__List_1__DebugContext_1__Extension_MANY__RelationalOperationElement_1_), ^PureFunctionToRelationalFunctionPair(first=meta::pure::functions::math::abs_Float_1__Float_1_,second=meta::relational::functions::pureToSqlQuery::processDynaFunction_FunctionExpression_1__PropertyMapping_MANY__SelectWithCursor_1__Map_1__State_1__JoinType_1__String_1__List_1__DebugContext_1__Extension_MANY__RelationalOperationElement_1_), ^PureFunctionToRelationalFunctionPair(first=meta::pure::functions::math::divide_Number_1__Number_1__Float_1_,second=meta::relational::functions::pureToSqlQuery::processDynaFunction_FunctionExpression_1__PropertyMapping_MANY__SelectWithCursor_1__Map_1__State_1__JoinType_1__String_1__List_1__DebugContext_1__Extension_MANY__RelationalOperationElement_1_), + ^PureFunctionToRelationalFunctionPair(first=meta::pure::functions::math::divide_Decimal_1__Decimal_1__Integer_1__Decimal_1_,second=meta::relational::functions::pureToSqlQuery::processDivideRound_FunctionExpression_1__PropertyMapping_MANY__SelectWithCursor_1__Map_1__State_1__JoinType_1__String_1__List_1__DebugContext_1__Extension_MANY__RelationalOperationElement_1_), ^PureFunctionToRelationalFunctionPair(first=meta::pure::functions::math::pow_Number_1__Number_1__Number_1_,second=meta::relational::functions::pureToSqlQuery::processDynaFunction_FunctionExpression_1__PropertyMapping_MANY__SelectWithCursor_1__Map_1__State_1__JoinType_1__String_1__List_1__DebugContext_1__Extension_MANY__RelationalOperationElement_1_), ^PureFunctionToRelationalFunctionPair(first=meta::pure::functions::math::exp_Number_1__Float_1_,second=meta::relational::functions::pureToSqlQuery::processDynaFunction_FunctionExpression_1__PropertyMapping_MANY__SelectWithCursor_1__Map_1__State_1__JoinType_1__String_1__List_1__DebugContext_1__Extension_MANY__RelationalOperationElement_1_), ^PureFunctionToRelationalFunctionPair(first=meta::pure::functions::math::log_Number_1__Float_1_,second=meta::relational::functions::pureToSqlQuery::processDynaFunction_FunctionExpression_1__PropertyMapping_MANY__SelectWithCursor_1__Map_1__State_1__JoinType_1__String_1__List_1__DebugContext_1__Extension_MANY__RelationalOperationElement_1_), diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/sqlQueryToString/dbExtension.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/sqlQueryToString/dbExtension.pure index 62a8d2cb5b9..e397bdbe8b7 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/sqlQueryToString/dbExtension.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/sqlQueryToString/dbExtension.pure @@ -962,6 +962,7 @@ Enum meta::relational::functions::sqlQueryToString::DynaFunctionRegistry denseRank, distinct, divide, + divideRound, encodeBase64, endsWith, equal, diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/sqlQueryToString/extensionDefaults.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/sqlQueryToString/extensionDefaults.pure index a814e663ff2..d4f3ea5eebb 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/sqlQueryToString/extensionDefaults.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/src/main/resources/core_relational/relational/sqlQueryToString/extensionDefaults.pure @@ -147,7 +147,11 @@ function meta::relational::functions::sqlQueryToString::default::convertDateToSq | if ($date->hasSubsecond(), | format('%t{[' + $timeZone + ']yyyy-MM-dd HH:mm:ss.SSSSSS}', $date), | format('%t{[' + $timeZone + ']yyyy-MM-dd HH:mm:ss}', $date)), - | format('%t{[' + $timeZone + ']yyyy-MM-dd}', $date)); + | if ($date->hasMonth() || $date->hasDay(), + | format('%t{[' + $timeZone + ']yyyy-MM-dd}', $date), + | fail('Ensure the target system understands Year or Year-month semantic.'); ''; + ) + ); } function meta::relational::functions::sqlQueryToString::default::convertGreatestLeastToCaseStatement(func:String[1], params:String[*]):String[1] @@ -196,6 +200,7 @@ function meta::relational::functions::sqlQueryToString::default::getDynaFunction dynaFnToSql('count', $allStates, ^ToSql(format='count(%s)', transform={p:String[*]|if($p->isEmpty(),|'*',|$p)})), dynaFnToSql('denseRank', $allStates, ^ToSql(format='dense_rank()')), dynaFnToSql('distinct', $allStates, ^ToSql(format='distinct(%s)', transform={p:String[*]|if($p->isEmpty(),|'*',|$p)})), + dynaFnToSql('divideRound', $allStates, ^ToSql(format='round(((1.0 * %s) / %s),%s)')), dynaFnToSql('divide', $allStates, ^ToSql(format='((1.0 * %s) / %s)')), dynaFnToSql('equal', $allStates, ^ToSql(format='%s = %s')), dynaFnToSql('endsWith', $allStates, ^ToSql(format=likePattern('%%%s'), transform={p:String[2]|$p->transformLikeParamsDefault()})), diff --git a/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/compiler/toPureGraph/ServiceCompilerExtensionImpl.java b/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/compiler/toPureGraph/ServiceCompilerExtensionImpl.java index 8d352a2d06b..cea25e1a3bf 100644 --- a/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/compiler/toPureGraph/ServiceCompilerExtensionImpl.java +++ b/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/compiler/toPureGraph/ServiceCompilerExtensionImpl.java @@ -338,7 +338,7 @@ public Map - 5.14.0 - 0.25.6 + 5.15.0 + 0.25.4 legend-engine